1 PROJECT_NAME=MormonChannel
3 SOURCE=$(shell find $(SOURCE_PATH) -iname "*.py")
4 PROGRAM=$(SOURCE_PATH)/mormonchannel_gtk.py
5 DATA_TYPES=*.ini *.map *.glade *.png
6 DATA=$(foreach type, $(DATA_TYPES), $(shell find $(SOURCE_PATH) -iname "$(type)"))
9 TAG_FILE=~/.ctags/$(PROJECT_NAME).tags
13 UNIT_TEST=nosetests --with-doctest -w .
14 SYNTAX_TEST=support/test_syntax.py
15 STYLE_TEST=../../Python/tools/pep8.py --ignore=W191,E501
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
20 TODO_FINDER=support/todo.py
23 .PHONY: all run profile debug test build lint tags todo clean distclean
31 $(PROFILE_GEN) $(PROGRAM)
35 $(DEBUGGER) $(PROGRAM)
43 mkdir -p $(BUILD_PATH)/generic
44 cp $(SOURCE_PATH)/constants.py $(BUILD_PATH)/generic
45 cp $(SOURCE_PATH)/$(PROJECT_NAME).py $(BUILD_PATH)/generic
46 $(foreach file, $(DATA), cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
47 $(foreach file, $(SOURCE), cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
48 #$(foreach file, $(OBJ), cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
49 cp support/$(PROJECT_NAME).desktop $(BUILD_PATH)/generic
50 cp support/icons/hicolor/26x26/hildon/$(PROJECT_NAME).png $(BUILD_PATH)/generic/26x26-$(PROJECT_NAME).png
51 cp support/icons/hicolor/64x64/hildon/$(PROJECT_NAME).png $(BUILD_PATH)/generic/64x64-$(PROJECT_NAME).png
52 cp support/icons/hicolor/scalable/hildon/$(PROJECT_NAME).png $(BUILD_PATH)/generic/scale-$(PROJECT_NAME).png
53 cp support/builddeb.py $(BUILD_PATH)/generic
54 cp support/py2deb.py $(BUILD_PATH)/generic
55 cp support/fake_py2deb.py $(BUILD_PATH)/generic
57 mkdir -p $(BUILD_PATH)/diablo
58 cp -R $(BUILD_PATH)/generic/* $(BUILD_PATH)/diablo
59 cd $(BUILD_PATH)/diablo ; python builddeb.py diablo
60 mkdir -p $(BUILD_PATH)/fremantle
61 cp -R $(BUILD_PATH)/generic/* $(BUILD_PATH)/fremantle
62 cd $(BUILD_PATH)/fremantle ; python builddeb.py fremantle
63 mkdir -p $(BUILD_PATH)/debian
64 cp -R $(BUILD_PATH)/generic/* $(BUILD_PATH)/debian
65 cd $(BUILD_PATH)/debian ; python builddeb.py debian
68 dput fremantle-extras-builder $(BUILD_PATH)/fremantle/$(PROJECT_NAME)*.changes
69 dput diablo-extras-builder $(BUILD_PATH)/diablo/$(PROJECT_NAME)*.changes
70 cp $(BUILD_PATH)/debian/*.deb ./www/$(PROJECT_NAME).deb
73 $(foreach file, $(SOURCE), $(LINT) $(file) ; )
88 find $(SOURCE_PATH) -name "*.*~" | xargs rm -f
89 find $(SOURCE_PATH) -name "*.swp" | xargs rm -f
90 find $(SOURCE_PATH) -name "*.bak" | xargs rm -f
91 find $(SOURCE_PATH) -name ".*.swp" | xargs rm -f
94 mkdir -p $(dir $(TAG_FILE))
95 $(CTAGS) -o $(TAG_FILE) $(SOURCE)
97 $(TODO_FILE): $(SOURCE)
98 @- $(TODO_FINDER) $(SOURCE) > $(TODO_FILE)
104 #Target to print any variable, can be added to the dependencies of any other target
105 #Userfule flags for make, -d, -p, -n
106 print-%: ; @$(error $* is $($*) ($(value $*)) (from $(origin $*)))