1 PROJECT_NAME=dialcentral
3 SOURCE=$(shell find $(SOURCE_PATH) -iname "*.py")
4 PROGRAM=$(SOURCE_PATH)/$(PROJECT_NAME).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
12 UNIT_TEST=nosetests --with-doctest -w .
13 SYNTAX_TEST=support/test_syntax.py
14 STYLE_TEST=../../Python/tools/pep8.py --ignore=W191
15 LINT_RC=./support/pylint.rc
16 LINT=pylint --rcfile=$(LINT_RC)
17 PROFILE_GEN=python -m cProfile -o .profile
18 PROFILE_VIEW=python -m pstats .profile
21 .PHONY: all run profile debug test lint tags build clean distclean
26 $(SOURCE_PATH)/dc_glade.py
29 $(PROFILE_GEN) $(PROGRAM)
33 $(DEBUGGER) $(PROGRAM)
39 @# @todo Add a PYC generation step
42 cp $(SOURCE_PATH)/$(PROJECT_NAME).py $(BUILD_PATH)
43 $(foreach file, $(DATA), cp $(file) $(BUILD_PATH)/$(subst /,-,$(file)) ; )
44 $(foreach file, $(SOURCE), cp $(file) $(BUILD_PATH)/$(subst /,-,$(file)) ; )
45 $(foreach file, $(OBJ), cp $(file) $(BUILD_PATH)/$(subst /,-,$(file)) ; )
46 cp support/$(PROJECT_NAME).desktop $(BUILD_PATH)
47 cp support/icons/hicolor/26x26/hildon/$(PROJECT_NAME).png $(BUILD_PATH)/26x26-$(PROJECT_NAME).png
48 cp support/icons/hicolor/64x64/hildon/$(PROJECT_NAME).png $(BUILD_PATH)/64x64-$(PROJECT_NAME).png
49 cp support/icons/hicolor/scalable/hildon/$(PROJECT_NAME).png $(BUILD_PATH)/scale-$(PROJECT_NAME).png
50 cp support/builddeb.py $(BUILD_PATH)
53 $(foreach file, $(SOURCE), $(LINT) $(file) ; )
65 find $(SOURCE_PATH) -name "*.*~" | xargs rm -f
66 find $(SOURCE_PATH) -name "*.swp" | xargs rm -f
67 find $(SOURCE_PATH) -name "*.bak" | xargs rm -f
68 find $(SOURCE_PATH) -name ".*.swp" | xargs rm -f
71 mkdir -p $(dir $(TAG_FILE))
72 $(CTAGS) -o $(TAG_FILE) $(SOURCE)
78 #Target to print any variable, can be added to the dependencies of any other target
79 #Userfule flags for make, -d, -p, -n
80 print-%: ; @$(error $* is $($*) ($(value $*)) (from $(origin $*)))