Made a slight mistake with click to call but this doesn't fix it
[gc-dialer] / Makefile
1 PROJECT_NAME=dialcentral
2 SOURCE_PATH=src
3 SOURCE=$(SOURCE_PATH)/dialer.py \
4            $(SOURCE_PATH)/gtk_toolbox.py \
5            $(SOURCE_PATH)/gv_views.py \
6            $(SOURCE_PATH)/gc_views.py \
7            $(SOURCE_PATH)/null_views.py \
8            $(SOURCE_PATH)/file_backend.py \
9            $(SOURCE_PATH)/evo_backend.py \
10            $(SOURCE_PATH)/gdata_backend.py \
11            $(SOURCE_PATH)/gv_backend.py \
12            $(SOURCE_PATH)/gc_backend.py \
13            $(SOURCE_PATH)/browser_emu.py \
14            $(SOURCE_PATH)/__init__.py \
15
16 PROGRAM=$(SOURCE_PATH)/$(PROJECT_NAME).py
17 OBJ=$(SOURCE:.py=.pyc)
18 BUILD_PATH=./build/
19 TAG_FILE=~/.ctags/$(PROJECT_NAME).tags
20
21 DEBUGGER=winpdb
22 UNIT_TEST=nosetests --with-doctest -w .
23 STYLE_TEST=../../Python/tools/pep8.py --ignore=W191
24 LINT_RC=./support/pylint.rc
25 LINT=pylint --rcfile=$(LINT_RC)
26 PROFILE_GEN=python -m cProfile -o .profile
27 PROFILE_VIEW=python -m pstats .profile
28 CTAGS=ctags-exuberant
29
30 .PHONY: all run debug test lint tags package clean distclean
31
32 all: test package
33
34 run: $(SOURCE)
35         $(SOURCE_PATH)/gc_dialer.py
36
37 profile: $(SOURCE)
38         $(PROFILE_GEN) $(PROGRAM)
39         $(PROFILE_VIEW)
40
41 debug: $(SOURCE)
42         $(DEBUGGER) $(PROGRAM)
43
44 test: $(SOURCE)
45         $(UNIT_TEST)
46
47 package:
48         rm -Rf $(BUILD_PATH)
49         mkdir $(BUILD_PATH)
50         cp $(SOURCE_PATH)/$(PROJECT_NAME).py  $(BUILD_PATH)
51         cp $(SOURCE_PATH)/$(PROJECT_NAME).glade  $(BUILD_PATH)
52         cp $(SOURCE)  $(BUILD_PATH)
53         cp support/$(PROJECT_NAME).desktop $(BUILD_PATH)
54         cp support/icons/hicolor/26x26/hildon/$(PROJECT_NAME).png $(BUILD_PATH)/26x26-$(PROJECT_NAME).png
55         cp support/icons/hicolor/64x64/hildon/$(PROJECT_NAME).png $(BUILD_PATH)/64x64-$(PROJECT_NAME).png
56         cp support/icons/hicolor/scalable/hildon/$(PROJECT_NAME).png $(BUILD_PATH)/scale-$(PROJECT_NAME).png
57         cp support/builddeb.py $(BUILD_PATH)
58
59 lint:
60         $(foreach file, $(SOURCE), $(LINT) $(file) ; )
61
62 tags: $(TAG_FILE) 
63
64 clean:
65         rm -Rf $(OBJ)
66         rm -Rf $(BUILD_PATH)
67
68 distclean:
69         rm -Rf $(OBJ)
70         rm -Rf $(BUILD_PATH)
71         rm -Rf $(TAG_FILE)
72         find $(SOURCE_PATH) -name "*.*~" | xargs rm -f
73         find $(SOURCE_PATH) -name "*.swp" | xargs rm -f
74         find $(SOURCE_PATH) -name "*.bak" | xargs rm -f
75         find $(SOURCE_PATH) -name ".*.swp" | xargs rm -f
76
77 $(TAG_FILE): $(SOURCE)
78         mkdir -p $(dir $(TAG_FILE))
79         $(CTAGS) -o $(TAG_FILE) $(SOURCE)
80
81 #Makefile Debugging
82 #Target to print any variable, can be added to the dependencies of any other target
83 #Userfule flags for make, -d, -p, -n
84 print-%: ; @$(error $* is $($*) ($(value $*)) (from $(origin $*)))