wrapper.fhtml: Add `license' relationship to the AGPL link.
[chopwood] / Makefile
index a19c846..745d277 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,7 @@ VERSION                        = $(shell ./get-version)
 
 ## The main source files.
 SOURCES                        += chpwd
+SOURCES                        += agpl.py
 SOURCES                        += backend.py
 SOURCES                        += cgi.py
 SOURCES                        += cmdutil.py
@@ -39,6 +40,7 @@ SOURCES                       += config.py
 SOURCES                        += crypto.py
 SOURCES                        += dbmaint.py
 SOURCES                        += format.py
+SOURCES                        += hash.py
 SOURCES                        += httpauth.py
 SOURCES                        += operation.py
 SOURCES                        += output.py
@@ -75,21 +77,33 @@ all::
 CLEANFILES              = *.pyc
 
 ###--------------------------------------------------------------------------
+### Additional machinery.
+
+V                       = 0
+
+V_AT                    = $(V_AT_$V)
+V_AT_0                  = @
+
+v_tag                   = $(call v_tag_$V,$1)
+v_tag_0                         = @printf "  %-8s %s\n" '$1' '$@';
+
+###--------------------------------------------------------------------------
 ### The automatically-generated installation module.
 
 TARGETS                        += auto.py auto-$(VERSION).py
 
 auto-$(VERSION).py: Makefile get-version $(SOURCES) $(wildcard RELEASE)
+       $(call v_tag,GEN)\
        { echo "### -*-python-*-"; \
          echo "PACKAGE = '$(PACKAGE)'"; \
          echo "VERSION = '$(VERSION)'"; \
          echo "HOME = '$$(pwd)'"; \
-       } >$@.new
-       mv $@.new $@
+       } >$@.new && mv $@.new $@
 
 auto.py: auto-$(VERSION).py
+       $(call v_tag,SYMLINK)\
        rm -f auto.py.new && ln -s $^ auto.py.new && mv auto.py.new auto.py
-       for i in auto-*.py; do \
+       $(V_AT)for i in auto-*.py; do \
          case $$i in auto-$(VERSION).py) ;; *) rm -f $$i ;; esac; \
        done
 
@@ -99,10 +113,10 @@ auto.py: auto-$(VERSION).py
 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
+       $(V_AT)rm -rf static.new
+       $(call v_tag,GEN)./chpwd static static.new
+       $(V_AT)touch static.new/stamp
+       $(V_AT)rm -rf static && mv static.new static
 
 clean::; rm -rf static
 
@@ -115,4 +129,23 @@ CLEANFILES += $(TARGETS)
 clean::; rm -f $(CLEANFILES)
 .PHONY: clean
 
+###--------------------------------------------------------------------------
+### Distributions.
+
+distdir                         = $(PACKAGE)-$(VERSION)
+
+DISTFILES               = $(SOURCES)
+DISTFILES              += AGPLv3
+DISTFILES              += Makefile get-version
+DISTFILES              += userv.rc
+
+dist:
+       rm -rf $(distdir)
+       mkdir $(distdir)
+       cp $(DISTFILES) $(distdir)
+       echo $(VERSION) >$(distdir)/RELEASE
+       tar cvfz $(distdir).tar.gz $(distdir)
+       rm -rf $(distdir)
+.PHONY: dist
+
 ###----- That's all, folks --------------------------------------------------