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)
13 TAG_FILE=~/.ctags/$(PROJECT_NAME).tags
17 UNIT_TEST=nosetests --with-doctest -w .
18 SYNTAX_TEST=support/test_syntax.py
19 STYLE_TEST=../../Python/tools/pep8.py --ignore=W191,E501
20 LINT_RC=./support/pylint.rc
21 LINT=pylint --rcfile=$(LINT_RC)
22 PROFILE_GEN=python -m cProfile -o .profile
23 PROFILE_VIEW=python -m pstats .profile
24 TODO_FINDER=support/todo.py
27 .PHONY: all run profile debug test lint tags todo clean distclean install update_po build_mo
35 $(PROFILE_GEN) $(PROGRAM)
39 $(DEBUGGER) $(PROGRAM)
44 update_po: po/templates.pot
45 @for lang in $(basename $(notdir $(wildcard po/*.po))); do \
46 msgmerge -U --strict --no-wrap po/$$lang.po po/templates.pot; \
49 po/templates.pot: $(POTFILES)
50 xgettext --language=Python --strict --no-wrap --output=$@ $(POTFILES)
53 @for lang in $(basename $(notdir $(wildcard po/*.po))); do \
54 mkdir -p locale/$$lang/LC_MESSAGES; \
55 msgfmt --statistics -c -o locale/$$lang/LC_MESSAGES/$(TEXT_DOMAIN).mo po/$$lang.po; \
58 package: $(OBJ) build_mo
61 mkdir -p $(BUILD_PATH)/generic
62 cp $(SOURCE_PATH)/constants.py $(BUILD_PATH)/generic
63 cp $(PROGRAM) $(BUILD_PATH)/generic
64 $(foreach file, $(DATA), cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
65 $(foreach file, $(SOURCE), cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
66 #$(foreach file, $(OBJ), cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
67 $(foreach file, $(LOCALE_FILES), cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
68 cp data/$(PROJECT_NAME).desktop $(BUILD_PATH)/generic
69 cp data/icons/26_$(PROJECT_NAME).png $(BUILD_PATH)/generic/26x26-$(PROJECT_NAME).png
70 cp data/icons/32_$(PROJECT_NAME).png $(BUILD_PATH)/generic/32x32-$(PROJECT_NAME).png
71 cp data/icons/48_$(PROJECT_NAME).png $(BUILD_PATH)/generic/48x48-$(PROJECT_NAME).png
72 cp support/builddeb.py $(BUILD_PATH)/generic
73 cp support/py2deb.py $(BUILD_PATH)/generic
74 cp support/fake_py2deb.py $(BUILD_PATH)/generic
76 mkdir -p $(BUILD_PATH)/diablo
77 cp -R $(BUILD_PATH)/generic/* $(BUILD_PATH)/diablo
78 cd $(BUILD_PATH)/diablo ; python builddeb.py diablo
79 mkdir -p $(BUILD_PATH)/fremantle
80 cp -R $(BUILD_PATH)/generic/* $(BUILD_PATH)/fremantle
81 cd $(BUILD_PATH)/fremantle ; python builddeb.py fremantle
82 mkdir -p $(BUILD_PATH)/debian
83 cp -R $(BUILD_PATH)/generic/* $(BUILD_PATH)/debian
84 cd $(BUILD_PATH)/debian ; python builddeb.py debian
87 dput fremantle-extras-builder $(BUILD_PATH)/fremantle/$(PROJECT_NAME)*.changes
88 dput diablo-extras-builder $(BUILD_PATH)/diablo/$(PROJECT_NAME)*.changes
89 cp $(BUILD_PATH)/debian/*.deb www/$(PROJECT_NAME).deb
92 $(foreach file, $(SOURCE), $(LINT) $(file) ; )
108 find $(SOURCE_PATH) -name "*.*~" | xargs rm -f
109 find $(SOURCE_PATH) -name "*.swp" | xargs rm -f
110 find $(SOURCE_PATH) -name "*.bak" | xargs rm -f
111 find $(SOURCE_PATH) -name ".*.swp" | xargs rm -f
114 mkdir -p $(dir $(TAG_FILE))
115 $(CTAGS) -o $(TAG_FILE) $(SOURCE)
117 $(TODO_FILE): $(SOURCE)
118 @- $(TODO_FINDER) $(SOURCE) > $(TODO_FILE)
124 #Target to print any variable, can be added to the dependencies of any other target
125 #Userfule flags for make, -d, -p, -n
126 print-%: ; @$(error $* is $($*) ($(value $*)) (from $(origin $*)))