1 PROJECT_NAME=WatersOfShiloah
3 SOURCE=$(shell find $(SOURCE_PATH) -iname "*.py")
4 PROGRAM=$(SOURCE_PATH)/watersofshiloah_gtk.py
6 DATA_TYPES=*.ini *.map *.glade *.png *.gif
7 DATA=$(foreach type, $(DATA_TYPES), $(shell find $(DATA_PATH) -iname "$(type)")) data/COPYING
10 TAG_FILE=~/.ctags/$(PROJECT_NAME).tags
14 UNIT_TEST=nosetests --with-doctest -w .
15 SYNTAX_TEST=support/test_syntax.py
16 STYLE_TEST=../../Python/tools/pep8.py --ignore=W191,E501
17 LINT_RC=./support/pylint.rc
18 LINT=pylint --rcfile=$(LINT_RC)
19 PROFILE_GEN=python -m cProfile -o .profile
20 PROFILE_VIEW=python -m pstats .profile
21 TODO_FINDER=support/todo.py
24 .PHONY: all run profile debug test build lint tags todo clean distclean
32 $(PROFILE_GEN) $(PROGRAM)
36 $(DEBUGGER) $(PROGRAM)
44 mkdir -p $(BUILD_PATH)/generic
45 cp $(SOURCE_PATH)/constants.py $(BUILD_PATH)/generic
46 cp $(SOURCE_PATH)/$(PROJECT_NAME).py $(BUILD_PATH)/generic
47 $(foreach file, $(DATA), cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
48 $(foreach file, $(SOURCE) $(SOURCE_PATH)/LICENSE, cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
49 cp support/$(PROJECT_NAME).desktop $(BUILD_PATH)/generic
50 cp data/icon.png $(BUILD_PATH)/generic/48x48-$(PROJECT_NAME).png
51 cp support/builddeb.py $(BUILD_PATH)/generic
52 cp support/py2deb.py $(BUILD_PATH)/generic
53 cp support/fake_py2deb.py $(BUILD_PATH)/generic
55 mkdir -p $(BUILD_PATH)/diablo
56 cp -R $(BUILD_PATH)/generic/* $(BUILD_PATH)/diablo
57 cd $(BUILD_PATH)/diablo ; python builddeb.py diablo
58 mkdir -p $(BUILD_PATH)/fremantle
59 cp -R $(BUILD_PATH)/generic/* $(BUILD_PATH)/fremantle
60 cd $(BUILD_PATH)/fremantle ; python builddeb.py fremantle
61 mkdir -p $(BUILD_PATH)/debian
62 cp -R $(BUILD_PATH)/generic/* $(BUILD_PATH)/debian
63 cd $(BUILD_PATH)/debian ; python builddeb.py debian
66 dput fremantle-extras-builder $(BUILD_PATH)/fremantle/watersofshiloah*.changes
67 dput diablo-extras-builder $(BUILD_PATH)/diablo/watersofshiloah*.changes
68 cp $(BUILD_PATH)/debian/*.deb ./www/watersofshiloah.deb
71 $(foreach file, $(SOURCE), $(LINT) $(file) ; )
86 find $(SOURCE_PATH) -name "*.*~" | xargs rm -f
87 find $(SOURCE_PATH) -name "*.swp" | xargs rm -f
88 find $(SOURCE_PATH) -name "*.bak" | xargs rm -f
89 find $(SOURCE_PATH) -name ".*.swp" | xargs rm -f
92 mkdir -p $(dir $(TAG_FILE))
93 $(CTAGS) -o $(TAG_FILE) $(SOURCE)
95 $(TODO_FILE): $(SOURCE)
96 @- $(TODO_FINDER) $(SOURCE) > $(TODO_FILE)
102 #Target to print any variable, can be added to the dependencies of any other target
103 #Userfule flags for make, -d, -p, -n
104 print-%: ; @$(error $* is $($*) ($(value $*)) (from $(origin $*)))