Commit | Line | Data |
---|---|---|
74a237a6 | 1 | MANAGE_PY = python manage.py |
75e78811 RB |
2 | ROOT_DIR = xnet |
3 | APPS = $(shell find $(ROOT_DIR) -name 'models.py' | sed 's,/models.py$$,,; s:.*/::') | |
33234b2f RB |
4 | |
5 | ||
a61373d3 RB |
6 | # In order to help newcomers, this variable holds a full doc of the current Makefile. |
7 | # Please keep it up to date with regard to new commands. | |
8 | # | |
9 | # Structure: | |
10 | # - Group commands in sections | |
11 | # - Align command descriptions | |
12 | ||
13 | define help | |
14 | Makefile command help | |
15 | ||
16 | Available targets are: | |
17 | ||
18 | Running: | |
19 | run: Start a development server on http://127.0.0.1:8000/ | |
20 | shell: Open a development Python shell using the current database | |
21 | ||
22 | Database: | |
23 | resetdb: Reinitialize the database schema | |
24 | ||
25 | Testing: | |
26 | test: Run the test suite | |
27 | ||
28 | Misc: | |
29 | clean: Cleanup all temporary files (*.pyc, ...) | |
30 | doc: Generate the documentation | |
31 | help: Display this help message | |
32 | endef | |
33 | ||
33234b2f RB |
34 | default: all |
35 | ||
36 | ||
37 | all: | |
38 | ||
39 | ||
a61373d3 RB |
40 | help: |
41 | @echo -n "" # Don't display extra lines. | |
42 | $(info $(help)) | |
43 | ||
44 | ||
45 | .PHONY: all default help | |
46 | ||
47 | ||
48 | # Running | |
49 | # ======= | |
50 | ||
33234b2f RB |
51 | run: |
52 | $(MANAGE_PY) runserver | |
53 | ||
4d594f44 AD |
54 | shell: |
55 | $(MANAGE_PY) shell | |
33234b2f | 56 | |
a61373d3 RB |
57 | |
58 | .PHONY: run shell | |
59 | ||
60 | # Development | |
61 | # =========== | |
62 | ||
63 | ||
33234b2f | 64 | test: |
75e78811 | 65 | $(MANAGE_PY) test $(APPS) |
d48fdabf RB |
66 | |
67 | resetdb: | |
68 | rm -f xnet/db.sqlite | |
69 | $(MANAGE_PY) syncdb --noinput | |
7c9fa49a | 70 | |
a61373d3 RB |
71 | .PHONY: resetdb test |
72 | ||
73 | # Misc | |
74 | # ==== | |
75 | ||
95fa5c13 RB |
76 | clean: |
77 | find . "(" -name "*.pyc" -or -name "*.pyo" -or -name "*.mo" ")" -delete | |
78 | find . -type d -empty -delete | |
7c9fa49a RB |
79 | |
80 | doc: | |
81 | $(MAKE) -C doc html | |
82 | ||
83 | ||
a61373d3 | 84 | .PHONY: clean doc |