chiark / gitweb /
Makefile: Bring up to code.
[chopwood] / Makefile
index 3ccd4e592be2bb2087ce7e1d4b5937768f3e521f..745d2776ac09d4fe16718c1394f01d2acf0e3097 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -76,22 +76,34 @@ 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
 
@@ -101,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