-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
93 lines (62 loc) · 1.73 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
MANAGE_PY = python manage.py
ROOT_DIR = fkzauth
MANAGE_OPTIONS = --noinput --traceback
RUN_OPTIONS = --traceback
# Please, keep the help message up to date concerning new commands
define helpmsg
Makefile command help
The following commands are available
- Running:
run: Start a development server on http://127.0.0.1:8000
shell: Start a development python shell on the current database
- Preparation & compilation
makemsg: Update all .po files (to be manually updated)
compilemsg: Rebuild .mo files
static: Collect static files
prepare: Perform all required preparation steps
- Database:
resetdb: Reinitialize the database
migratedb: Migrates the database (using South)
- Misc:
clean: Cleanup all temporary files (*.pyc, ...)
help: Display this helpmessage
endef
default: help
all: prepare
help:
@echo -n "" #Don't display extra lines
$(info $(helpmsg))
.PHONY: all default help
# Running
# =======
run: static compilemsg
$(MANAGE_PY) runserver $(RUN_OPTIONS) 8000
shell:
$(MANAGE_PY) shell
.PHONY: run shell
# Preparation & compilation
# =========================
static:
$(MANAGE_PY) collectstatic $(MANAGE_OPTIONS) --verbosity=0
makemsg:
cd $(ROOT_DIR) && django-admin.py makemessages --all --no-wrap
PO_FILES = $(shell find $(ROOT_DIR) -name '*.po')
MO_FILES = $(PO_FILES:.po=.mo)
compilemsg: $(MO_FILES)
%.mo: %.po
msgfmt --check-format -o $@ $<
prepare: compilemsg static
.PHONY: compilemsg makemsg prepare static
# Database
# ========
resetdb:
rm -f db.sqlite3
$(MANAGE_PY) syncdb $(MANAGE_OPTIONS) --migrate
migratedb:
$(MANAGE_PY) migrate $(MANAGE_OPTIONS) --merge
.PHONY: resetdb migratedb
# Misc
# ====
clean:
find . "(" -name "*.pyc" -or -name "*.pyo" -or -name "*.mo" ")" -delete
.PHONY: clean