]> git.tuebingen.mpg.de Git - dss.git/commitdiff
Make the build quiet by default.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 28 Apr 2024 01:25:28 +0000 (03:25 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 20 May 2024 18:20:04 +0000 (20:20 +0200)
This teaches make(1) to give all lines of the recipe to a single
shell invocation, speeding up the build and facilitating the simple
SAY function to quiten the build. The old verbose output can still
be obtained by running make V=1.

Makefile

index d1c1866350af17463fcefd24776fc3de00c90718..40f40e497befc45593cd23b6201330081f4318a2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -30,24 +30,37 @@ DSS_CFLAGS += -Wunused-parameter
 DSS_CFLAGS += -Wbad-function-cast
 DSS_CFLAGS += -Wshadow
 
+.ONESHELL:
+.SHELLFLAGS := -ec
+ifeq ("$(origin V)", "command line")
+       SAY =
+else
+       SAY = @printf '%s\n' '$(strip $(1))'
+endif
 version.c:
+       $(call SAY, VG $@)
        ./version-gen.sh dss version.c > /dev/null
 dss: $(objs)
+       $(call SAY, LD $@)
        $(CC) -o $@ $(objs) $(LDFLAGS) -llopsub
 %.o: %.c
+       $(call SAY, CC $<)
        $(CC) -c -o $@ $(DSS_CPPFLAGS) $(CPPFLAGS) $(DSS_CFLAGS) $(CFLAGS) \
                -MMD -MF $(*F).d -MT $@ $<
 %.lsg.h: %.suite
+       $(call SAY, LSGH $<)
        lopsubgen --gen-h=$@ < $<
 %.lsg.c: %.suite
+       $(call SAY, LSGC $<)
        lopsubgen --gen-c=$@ < $<
 %.1: %.suite
+       $(call SAY, LSGM $<)
        lopsubgen --gen-man=$@ --version-string=$(VERSION) < $<
-
 %.1.html: %.1
+       $(call SAY, GROFF $<)
        groff -m man -Thtml -P -l -P -r $< | sed -e '1,/^<body>/d; /^<\/body>/,$$d' > $@
-
 clean:
+       $(call SAY, CLEAN)
        rm -f *.[od] dss dss.1 *.html dss.lsg.[ch] version.c
 
 ifneq ($(findstring strip, $(MAKECMDGOALS)),)