chiark / gitweb /
cgi.py: Export the template cache to the templates.
[chopwood] / Makefile
CommitLineData
a2916c06
MW
1### -*-makefile-*-
2###
3### Build and setup script
4###
5### (c) 2013 Mark Wooding
6###
7
8###----- Licensing notice ---------------------------------------------------
9###
10### This file is part of Chopwood: a password-changing service.
11###
12### Chopwood is free software; you can redistribute it and/or modify
13### it under the terms of the GNU Affero General Public License as
14### published by the Free Software Foundation; either version 3 of the
15### License, or (at your option) any later version.
16###
17### Chopwood is distributed in the hope that it will be useful,
18### but WITHOUT ANY WARRANTY; without even the implied warranty of
19### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20### GNU Affero General Public License for more details.
21###
22### You should have received a copy of the GNU Affero General Public
23### License along with Chopwood; if not, see
24### <http://www.gnu.org/licenses/>.
25
26## Basic naming stuff.
27PACKAGE = chopwood
28VERSION = $(shell ./get-version)
29
30###--------------------------------------------------------------------------
31### The big list of source files.
32
33## The main source files.
34SOURCES += chpwd
35SOURCES += backend.py
36SOURCES += cgi.py
37SOURCES += cmdutil.py
38SOURCES += config.py
39SOURCES += crypto.py
40SOURCES += dbmaint.py
41SOURCES += format.py
42SOURCES += httpauth.py
43SOURCES += operation.py
44SOURCES += output.py
45SOURCES += service.py
46SOURCES += subcommand.py
47SOURCES += util.py
48
49## The command implementations.
50SOURCES += cmd-admin.py
51SOURCES += cmd-cgi.py
52SOURCES += cmd-remote.py
53SOURCES += cmd-user.py
54
55## Template HTML files.
56SOURCES += about.fhtml
57SOURCES += cookies.fhtml
58SOURCES += error.fhtml
59SOURCES += exception.fhtml
60SOURCES += list.fhtml
61SOURCES += login.fhtml
62SOURCES += operate.fhtml
63SOURCES += wrapper.fhtml
64
65## Other static files.
66SOURCES += chpwd.css
67SOURCES += chpwd.js
68
69###--------------------------------------------------------------------------
70### Default rules.
71
72all::
73.PHONY: all
74
75CLEANFILES = *.pyc
76
77###--------------------------------------------------------------------------
78### The automatically-generated installation module.
79
80TARGETS += auto.py auto-$(VERSION).py
81
ffd791da 82auto-$(VERSION).py: Makefile get-version $(SOURCES) $(wildcard RELEASE)
a2916c06
MW
83 { echo "### -*-python-*-"; \
84 echo "PACKAGE = '$(PACKAGE)'"; \
85 echo "VERSION = '$(VERSION)'"; \
86 echo "HOME = '$$(pwd)'"; \
87 } >$@.new
88 mv $@.new $@
a2916c06
MW
89
90auto.py: auto-$(VERSION).py
ffd791da 91 rm -f auto.py.new && ln -s $^ auto.py.new && mv auto.py.new auto.py
a2916c06
MW
92 for i in auto-*.py; do \
93 case $$i in auto-$(VERSION).py) ;; *) rm -f $$i ;; esac; \
94 done
95
96###--------------------------------------------------------------------------
97### Generate the static files.
98
99TARGETS += static/stamp
100
101static/stamp: $(SOURCES) auto.py
102 rm -rf static.new
103 ./chpwd static static.new
104 touch static.new/stamp
105 rm -rf static && mv static.new static
106
107clean::; rm -rf static
108
109###--------------------------------------------------------------------------
110### The standard rules.
111
112all:: $(TARGETS)
113
114CLEANFILES += $(TARGETS)
115clean::; rm -f $(CLEANFILES)
116.PHONY: clean
117
118###----- That's all, folks --------------------------------------------------