4 SOURCE=$(shell find $(SOURCE_PATH) -iname "*.py")
6 LOCALE_FILES=$(shell find $(LOCALE_PATH) -iname "*.mo")
7 PROGRAM=$(SOURCE_PATH)/$(PROJECT_NAME).py
11 TEXT_DOMAIN=$(PROJECT_NAME)
12 POTFILES=$(wildcard src/quicknoteclasses/*.py)
14 UNIT_TEST=nosetests --with-doctest -w .
15 SYNTAX_TEST=support/test_syntax.py
16 LINT_RC=./support/pylint.rc
17 LINT=pylint --rcfile=$(LINT_RC)
18 PROFILE_GEN=python -m cProfile -o .profile
19 PROFILE_VIEW=python -m pstats .profile
21 .PHONY: all run profile test lint clean distclean install update_po build_mo
24 python2.5 setup.py build
30 $(PROFILE_GEN) $(PROGRAM)
36 package: clean $(OBJ) all
37 dpkg-buildpackage -rfakeroot
38 dpkg -i ../$(PROJECT_NAME)_$(PROJECT_VERSION)_all.deb
40 update_po: po/templates.pot
41 @for lang in $(basename $(notdir $(wildcard po/*.po))); do \
42 msgmerge -U --strict --no-wrap po/$$lang.po po/templates.pot; \
45 po/templates.pot: $(POTFILES)
46 xgettext --language=Python --strict --no-wrap --output=$@ $(POTFILES)
49 @for lang in $(basename $(notdir $(wildcard po/*.po))); do \
50 mkdir -p locale/$$lang/LC_MESSAGES; \
51 msgfmt --statistics -c -o locale/$$lang/LC_MESSAGES/$(TEXT_DOMAIN).mo po/$$lang.po; \
54 build: $(OBJ) build_mo
57 cp $(PROGRAM) $(BUILD_PATH)
58 cp src/constants.py $(BUILD_PATH)
59 $(foreach file, $(DATA), cp $(file) $(BUILD_PATH)/$(subst /,-,$(file)) ; )
60 $(foreach file, $(SOURCE), cp $(file) $(BUILD_PATH)/$(subst /,-,$(file)) ; )
61 $(foreach file, $(OBJ), cp $(file) $(BUILD_PATH)/$(subst /,-,$(file)) ; )
62 $(foreach file, $(LOCALE_FILES), cp $(file) $(BUILD_PATH)/$(subst /,-,$(file)) ; )
63 cp data/$(PROJECT_NAME).desktop $(BUILD_PATH)
64 cp data/$(PROJECT_NAME).service $(BUILD_PATH)
65 cp data/low/$(PROJECT_NAME).png $(BUILD_PATH)/26x26-$(PROJECT_NAME).png
66 cp data/40/$(PROJECT_NAME).png $(BUILD_PATH)/40x40-$(PROJECT_NAME).png
67 cp data/48/$(PROJECT_NAME).png $(BUILD_PATH)/48x48-$(PROJECT_NAME).png
68 cp data/scale/$(PROJECT_NAME).png $(BUILD_PATH)/scale-$(PROJECT_NAME).png
69 cp support/builddeb.py $(BUILD_PATH)
70 cp support/fake_py2deb.py $(BUILD_PATH)
73 $(foreach file, $(SOURCE), $(LINT) $(file) ; )
79 python2.5 setup.py clean --all
82 find $(SOURCE_PATH) -name "*.*~" | xargs rm -f
83 find $(SOURCE_PATH) -name "*.swp" | xargs rm -f
84 find $(SOURCE_PATH) -name "*.bak" | xargs rm -f
85 find $(SOURCE_PATH) -name ".*.swp" | xargs rm -f
88 python2.5 setup.py install --root $(DESTDIR)
94 #Target to print any variable, can be added to the dependencies of any other target
95 #Userfule flags for make, -d, -p, -n
96 print-%: ; @$(error $* is $($*) ($(value $*)) (from $(origin $*)))