3 ### Build and setup script
5 ### (c) 2013 Mark Wooding
8 ###----- Licensing notice ---------------------------------------------------
10 ### This file is part of Chopwood: a password-changing service.
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.
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.
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/>.
26 ## Basic naming stuff.
28 VERSION
= $(shell .
/get-version
)
30 ###--------------------------------------------------------------------------
31 ### The big list of source files.
33 ## The main source files.
42 SOURCES
+= httpauth.py
43 SOURCES
+= operation.py
46 SOURCES
+= subcommand.py
49 ## The command implementations.
50 SOURCES
+= cmd-admin.py
52 SOURCES
+= cmd-remote.py
53 SOURCES
+= cmd-user.py
55 ## Template HTML files.
56 SOURCES
+= about.fhtml
57 SOURCES
+= cookies.fhtml
58 SOURCES
+= error.fhtml
59 SOURCES
+= exception.fhtml
61 SOURCES
+= login.fhtml
62 SOURCES
+= operate.fhtml
63 SOURCES
+= wrapper.fhtml
65 ## Other static files.
69 ###--------------------------------------------------------------------------
77 ###--------------------------------------------------------------------------
78 ### The automatically-generated installation module.
80 TARGETS
+= auto.py auto-
$(VERSION
).py
82 auto-
$(VERSION
).py
: Makefile get-version
$(SOURCES
) $(wildcard RELEASE
)
83 { echo
"### -*-python-*-"; \
84 echo
"PACKAGE = '$(PACKAGE)'"; \
85 echo
"VERSION = '$(VERSION)'"; \
86 echo
"HOME = '$$(pwd)'"; \
90 auto.py
: auto-
$(VERSION
).py
91 rm -f auto.py.new
&& ln
-s
$^ auto.py.new
&& mv auto.py.new auto.py
92 for i in auto-
*.py
; do \
93 case
$$i in auto-
$(VERSION
).py
) ;; *) rm -f
$$i ;; esac
; \
96 ###--------------------------------------------------------------------------
97 ### Generate the static files.
99 TARGETS
+= static
/stamp
101 static
/stamp
: $(SOURCES
) auto.py
103 .
/chpwd static static.new
104 touch static.new
/stamp
105 rm -rf static
&& mv static.new static
107 clean::; rm -rf static
109 ###--------------------------------------------------------------------------
110 ### The standard rules.
114 CLEANFILES
+= $(TARGETS
)
115 clean::; rm -f
$(CLEANFILES
)
118 ###----- That's all, folks --------------------------------------------------