### -*-makefile-*- ### ### Build and setup script ### ### (c) 2013 Mark Wooding ### ###----- Licensing notice --------------------------------------------------- ### ### This file is part of Chopwood: a password-changing service. ### ### Chopwood is free software; you can redistribute it and/or modify ### it under the terms of the GNU Affero General Public License as ### published by the Free Software Foundation; either version 3 of the ### License, or (at your option) any later version. ### ### Chopwood is distributed in the hope that it will be useful, ### but WITHOUT ANY WARRANTY; without even the implied warranty of ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ### GNU Affero General Public License for more details. ### ### You should have received a copy of the GNU Affero General Public ### License along with Chopwood; if not, see ### . ## Basic naming stuff. PACKAGE = chopwood VERSION = $(shell ./get-version) ###-------------------------------------------------------------------------- ### The big list of source files. ## The main source files. SOURCES += chpwd SOURCES += agpl.py SOURCES += backend.py SOURCES += cgi.py SOURCES += cmdutil.py SOURCES += config.py SOURCES += crypto.py SOURCES += dbmaint.py SOURCES += format.py SOURCES += hash.py SOURCES += httpauth.py SOURCES += operation.py SOURCES += output.py SOURCES += service.py SOURCES += subcommand.py SOURCES += util.py ## The command implementations. SOURCES += cmd-admin.py SOURCES += cmd-cgi.py SOURCES += cmd-remote.py SOURCES += cmd-user.py ## Template HTML files. SOURCES += about.fhtml SOURCES += cookies.fhtml SOURCES += error.fhtml SOURCES += exception.fhtml SOURCES += list.fhtml SOURCES += login.fhtml SOURCES += operate.fhtml SOURCES += wrapper.fhtml ## Other static files. SOURCES += chpwd.css SOURCES += chpwd.js ###-------------------------------------------------------------------------- ### Default rules. all:: .PHONY: all CLEANFILES = *.pyc ###-------------------------------------------------------------------------- ### The automatically-generated installation module. TARGETS += auto.py auto-$(VERSION).py auto-$(VERSION).py: Makefile get-version $(SOURCES) $(wildcard RELEASE) { echo "### -*-python-*-"; \ echo "PACKAGE = '$(PACKAGE)'"; \ echo "VERSION = '$(VERSION)'"; \ echo "HOME = '$$(pwd)'"; \ } >$@.new mv $@.new $@ auto.py: auto-$(VERSION).py rm -f auto.py.new && ln -s $^ auto.py.new && mv auto.py.new auto.py for i in auto-*.py; do \ case $$i in auto-$(VERSION).py) ;; *) rm -f $$i ;; esac; \ done ###-------------------------------------------------------------------------- ### Generate the static files. TARGETS += static/stamp static/stamp: $(SOURCES) auto.py rm -rf static.new ./chpwd static static.new touch static.new/stamp rm -rf static && mv static.new static clean::; rm -rf static ###-------------------------------------------------------------------------- ### The standard rules. all:: $(TARGETS) CLEANFILES += $(TARGETS) clean::; rm -f $(CLEANFILES) .PHONY: clean ###----- That's all, folks --------------------------------------------------