makefile and docstrings

This commit is contained in:
gwen
2013-09-02 15:06:55 +02:00
parent f379a0fc0a
commit 7dd9394b84
4 changed files with 93 additions and 78 deletions

View File

@ -15,8 +15,16 @@ ifneq ($(DESTDIR),)
PYTHON_OPTS += --root $(DESTDIR)
endif
VERSION := 1.0rc
VERSION_FILE := version.in
VERSION := `cat VERSION`
define gettext
if command -v pygettext >/dev/null 2>&1 ; then \
P="pygettext" ; \
else \
P="pygettext.py" ; \
fi ; \
$$P -p translations/ -o $(PACKAGE).pot `find $(PACKAGE)/ -name "*.py"`
endef
# Build translation files
define build_translation
@ -27,6 +35,8 @@ define build_translation
fi
endef
# Install Traduction
define install_translation
if [ -d ${1} ]; then \
@ -43,15 +53,15 @@ all: build-lang
clean:
$(RM) -r build
$(RM) -r $(PACKAGE).egg-info/
$(RM) -r $(VERSION_FILE)
$(RM) -r $(TRADUC_DIR)/*/*.mo
#test: clean
# py.test
# Build or update Portable Object Base Translation for gettext
build-pot:
pygettext.py -p translations/ -o $(PACKAGE).pot `find $(PACKAGE)/ -name "*.py"`
$(call gettext)
build-lang:
$(call build_translation, $(TRADUC_DIR))
@ -60,14 +70,11 @@ install-lang:
$(INSTALL_DIR) $(TRADUC_DEST)
$(call install_translation, $(TRADUC_DIR))
install: version.in install-lang
install: install-lang
python setup.py install --no-compile $(PYTHON_OPTS)
# List in .PHONY to force generation at each call
version.in:
echo -n $(VERSION) > $(VERSION_FILE)
dist:
git archive --format=tar --prefix $(PACKAGE)-$(VERSION)/ HEAD | gzip -9 > $(PACKAGE)-$(VERSION).tar.gz
.PHONY: all clean build-pot build-lang install-lang install version.in dist
# List in .PHONY to force generation at each call
.PHONY: all clean build-pot build-lang install-lang install dist