Cleaned up the makefile and fixed some minor bugs
[gc-dialer] / Makefile
1 PROJECT_NAME=DialCentral
2 SOURCE_PATH=src
3 SOURCE=$(SOURCE_PATH)/dialcentral/gc_dialer.py $(SOURCE_PATH)/dialcentral/evo_backend.py $(SOURCE_PATH)/dialcentral/gc_backend.py $(SOURCE_PATH)/dialcentral/browser_emu.py
4 OBJ=$(SOURCE:.py=.pyc)
5 TAG_FILE=~/.ctags/$(PROJECT_NAME).tags
6
7 DEBUGGER=winpdb
8 UNIT_TEST=nosetests -w $(TEST_PATH)
9 STYLE_TEST=../../Python/tools/pep8.py --ignore=W191
10 LINT_RC=./support/pylint.rc
11 LINT=pylint --rcfile=$(LINT_RC)
12 COVERAGE_TEST=figleaf
13 PROFILER=pyprofiler
14 CTAGS=ctags-exuberant
15
16 .PHONY: all run debug test lint tags package clean
17
18 all: test package
19
20 run: $(SOURCE)
21         cd $(SOURCE_PATH)/dialcentral ; ./gc_dialer.py
22
23 debug: $(SOURCE)
24         cd $(SOURCE_PATH)/dialcentral ; $(DEBUGGER) ./gc_dialer.py
25
26 test: $(SOURCE)
27         cd $(SOURCE_PATH)/dialcentral ; ./gc_dialer.py -t
28
29 package:
30         ./builddeb.py
31
32 lint:
33         $(foreach file, $(SOURCE), $(LINT) $(file) ; )
34
35 tags: $(TAG_FILE) 
36
37 clean:
38         rm -Rf $(OBJ)
39
40 $(TAG_FILE): $(SOURCE)
41         mkdir -p $(dir $(TAG_FILE))
42         $(CTAGS) -o $(TAG_FILE) $(SOURCE)
43
44 #Makefile Debugging
45 #Target to print any variable, can be added to the dependencies of any other target
46 #Userfule flags for make, -d, -p, -n
47 print-%: ; @$(error $* is $($*) ($(value $*)) (from $(origin $*)))