]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 'refs/heads/t/ONESHELL'
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 8 Sep 2019 09:07:45 +0000 (11:07 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 8 Sep 2019 09:09:02 +0000 (11:09 +0200)
A single patch which instructs the build system to run multi-line
statements in Makefiles in a single shell instance.

Cooking in next for nine months.

* refs/heads/t/ONESHELL:
  build: Use .ONESHELL.

Makefile.real
NEWS.md
m4/lls/makefile
t/makefile.test

index 5df27bad934a58f04b4b6407e868e8898ded4002..7d4eff4fe2eaecc99fb83627a154b9c1672118ca 100644 (file)
@@ -6,6 +6,8 @@ MAKEFLAGS += -Rr
 ifeq ("$(origin CC)", "default")
         CC := cc
 endif
+.ONESHELL:
+.SHELLFLAGS := -ec
 
 LOGLEVELS := LL_DEBUG,LL_INFO,LL_NOTICE,LL_WARNING,LL_ERROR,LL_CRIT,LL_EMERG
 vardir := /var/paraslash
@@ -102,7 +104,7 @@ endif
 
 $(object_dir) $(man_dir) $(dep_dir) $(m4depdir) $(lls_suite_dir) \
        $(yy_build_dir):
-       $(Q) $(MKDIR_P) $@
+       @$(MKDIR_P) $@
 
 CPPFLAGS += -DBINDIR='"$(bindir)"'
 CPPFLAGS += -DCOPYRIGHT_YEAR='"$(COPYRIGHT_YEAR)"'
@@ -148,9 +150,9 @@ STRICT_CFLAGS += $(call cc-option, -Wdiscarded-qualifiers)
 # To put more focus on warnings, be less verbose as default
 # Use 'make V=1' to see the full commands
 ifeq ("$(origin V)", "command line")
-       Q :=
+       SAY =
 else
-       Q := @
+       SAY = @echo '$(strip $(1))'
 endif
 
 audiod_commands := $(addprefix $(lls_suite_dir)/, \
@@ -177,9 +179,9 @@ $(man_dir)/para_write.1: all_commands := $(write_commands)
 
 $(man_dir)/para_%.1: $(lls_suite_dir)/%.lsg.man \
                $(lls_m4_dir)/copyright.m4 | $(man_dir)
-       @[ -z "$(Q)" ] || echo 'LLSMAN $<'
-       $(Q) cat $< $(all_commands) > $@
-       $(Q) $(M4) -D COPYRIGHT_YEAR=$(COPYRIGHT_YEAR) $(lls_m4_dir)/copyright.m4 >> $@
+       $(call SAY, LLSMAN $<)
+       cat $< $(all_commands) > $@
+       $(M4) -D COPYRIGHT_YEAR=$(COPYRIGHT_YEAR) $(lls_m4_dir)/copyright.m4 >> $@
 
 $(object_dir)/%.o: %.c | $(object_dir)
 
@@ -247,8 +249,8 @@ $(object_dir)/mm.o \
 $(object_dir)/compress_filter.o: CFLAGS += -O3
 
 $(object_dir)/%.o: %.c | $(object_dir) $(dep_dir) $(lsg_h) $(yy_h)
-       @[ -z "$(Q)" ] || echo 'CC $<'
-       $(Q) $(CC) -c -o $@ -MMD -MF $(dep_dir)/$(*F).d -MT $@ $(CPPFLAGS) \
+       $(call SAY, CC $<)
+       $(CC) -c -o $@ -MMD -MF $(dep_dir)/$(*F).d -MT $@ $(CPPFLAGS) \
                $(STRICT_CFLAGS) $(CFLAGS) $<
 
 para_recv para_afh para_play para_server: LDFLAGS += $(id3tag_ldflags)
@@ -313,24 +315,24 @@ para_afh para_recv para_server para_play: LDFLAGS += $(iconv_ldflags)
 
 $(foreach exe,$(executables),$(eval para_$(exe): $$($(exe)_objs)))
 $(prefixed_executables):
-       @[ -z "$(Q)" ] || echo 'LD $@'
-       $(Q) $(CC) $^ -o $@ $(LDFLAGS)
+       $(call SAY, LD $@)
+       $(CC) $^ -o $@ $(LDFLAGS)
 
 mostlyclean:
-       @[ -z "$(Q)" ] || echo 'MOSTLYCLEAN'
-       $(Q) rm -f para_*
-       $(Q) rm -rf $(object_dir)
+       $(call SAY, MOSTLYCLEAN)
+       rm -f para_*
+       rm -rf $(object_dir)
 clean: mostlyclean
-       @[ -z "$(Q)" ] || echo 'CLEAN'
-       $(Q) rm -rf $(build_dir)
+       $(call SAY, CLEAN)
+       rm -rf $(build_dir)
 distclean: clean
-       @[ -z "$(Q)" ] || echo 'DISTCLEAN'
-       $(Q) rm -f Makefile autoscan.log config.status config.log
-       $(Q) rm -f config.h configure config.h.in
+       $(call SAY, DISTCLEAN)
+       rm -f Makefile autoscan.log config.status config.log
+       rm -f config.h configure config.h.in
 maintainer-clean: distclean
-       @[ -z "$(Q)" ] || echo 'MAINTAINER-CLEAN'
-       $(Q) rm -f *.tar.bz2 *.tar.xz
-       $(Q) rm -f GPATH GRTAGS GSYMS GTAGS
+       $(call SAY, MAINTAINER-CLEAN)
+       rm -f *.tar.bz2 *.tar.xz
+       rm -f GPATH GRTAGS GSYMS GTAGS
 
 INSTALL ?= install
 INSTALL_PROGRAM ?= $(INSTALL)
@@ -346,14 +348,15 @@ install install-strip: all man
        $(MKDIR_P) $(DESTDIR)$(vardir) >/dev/null 2>&1 || true # not fatal, so don't complain
 
 $(tarball) dist tarball:
-       $(Q) rm -rf $(tarball) $(tarball_pfx)
-       $(Q) git archive --format=tar --prefix=$(tarball_pfx)/ HEAD \
-               | tar --delete $(tarball_delete) > $(tarball_pfx).tar
-       $(Q) $(MKDIR_P) $(tarball_pfx)
-       $(Q) ./GIT-VERSION-GEN > $(tarball_pfx)/VERSION
-       $(Q) cp $(autocrap) $(tarball_pfx)
-       $(Q) tar rf $(tarball_pfx).tar $(tarball_pfx)/*
-       $(Q) xz -9 $(tarball_pfx).tar
-       $(Q) ls -l $(tarball)
-       $(Q) ln -sf $(tarball) paraslash-git.tar.xz
-       $(Q) rm -rf $(tarball_pfx)
+       $(call SAY, DIST)
+       rm -rf $(tarball) $(tarball_pfx)
+       git archive --format=tar --prefix=$(tarball_pfx)/ HEAD \
+          | tar --delete $(tarball_delete) > $(tarball_pfx).tar
+       $(MKDIR_P) $(tarball_pfx)
+       ./GIT-VERSION-GEN > $(tarball_pfx)/VERSION
+       cp $(autocrap) $(tarball_pfx)
+       tar rf $(tarball_pfx).tar $(tarball_pfx)/*
+       xz -9 $(tarball_pfx).tar
+       ls -l $(tarball)
+       ln -sf $(tarball) paraslash-git.tar.xz
+       rm -rf $(tarball_pfx)
diff --git a/NEWS.md b/NEWS.md
index 7ed78027fc29cf5f681e0d4b00464397ff4e995b..bbe200102627b929907a78ff5a14792cdc45f720 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -16,6 +16,8 @@ NEWS
   reduce clipping. The meaning of --aggressiveness has changed, see the
   updated and extended documentation of the compress filter for details.
 - Cleanup of the audio format handler code.
+- We now build the tree using the .ONESHELL feature of GNU make,
+  which results in a significant speedup.
 
 --------------------------------------
 0.6.2 (2018-06-30) "elastic diversity"
index dd86b51def8cfbeff487def5d883e3a88e0f9078..daf6de92525d334d3c1791e4d0b53907ddd7fb7f 100644 (file)
@@ -2,29 +2,29 @@
 lls_m4_include_dir := $(lls_m4_dir)/include
 
 $(lls_suite_dir)/%.m4d: $(lls_m4_dir)/%.suite.m4 | $(lls_suite_dir)
-       @[ -z "$(Q)" ] || echo 'M4D $<'
-       $(Q) $(M4) -Pg -I $(lls_m4_include_dir) -s $< \
+       $(call SAY, M4D $<)
+       $(M4) -Pg -I $(lls_m4_include_dir) -s $< \
        | awk '{if ($$1 ~ /#line/) {gsub(/"/, "", $$3); if ($$3 != "$<") \
        print "$(lls_suite_dir)/$(*F).suite: " $$3}}' | sort | uniq > $@
 
 $(lls_suite_dir)/%.suite: $(lls_m4_dir)/%.suite.m4 | $(lls_suite_dir)
-       @[ -z "$(Q)" ] || echo 'M4 $<'
-       $(Q) $(M4) -Pg -I $(lls_m4_include_dir) -D GIT_VERSION=$(GIT_VERSION) \
+       $(call SAY, M4 $<)
+       $(M4) -Pg -I $(lls_m4_include_dir) -D GIT_VERSION=$(GIT_VERSION) \
                -D COPYRIGHT_YEAR=$(COPYRIGHT_YEAR) -D LOGLEVELS=$(LOGLEVELS) \
                $< > $@
 
 $(lls_suite_dir)/%.lsg.c: $(lls_suite_dir)/%.suite
-       @[ -z "$(Q)" ] || echo 'LSGC $<'
-       $(Q) $(LOPSUBGEN) --gen-c --output-dir $(lls_suite_dir) < $<
+       $(call SAY, LSGC $<)
+       $(LOPSUBGEN) --gen-c --output-dir $(lls_suite_dir) < $<
 
 $(lls_suite_dir)/%.lsg.h: $(lls_suite_dir)/%.suite
-       @[ -z "$(Q)" ] || echo 'LSGH $<'
-       $(Q) $(LOPSUBGEN) --gen-header --output-dir $(lls_suite_dir) < $<
+       $(call SAY, LSGH $<)
+       $(LOPSUBGEN) --gen-header --output-dir $(lls_suite_dir) < $<
 
 $(lls_suite_dir)/%.lsg.man: $(lls_suite_dir)/%.suite
-       @[ -z "$(Q)" ] || echo 'LSGM $<'
-       $(Q) $(LOPSUBGEN) --gen-man --output-dir $(lls_suite_dir) < $<
+       $(call SAY, LSGM $<)
+       $(LOPSUBGEN) --gen-man --output-dir $(lls_suite_dir) < $<
 
 $(object_dir)/%.o: $(lls_suite_dir)/%.c | $(object_dir)
-       @[ -z "$(Q)" ] || echo 'CC $<'
-       $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(STRICT_CFLAGS) $<
+       $(call SAY, CC $<)
+       $(CC) -c -o $@ $(CPPFLAGS) $(STRICT_CFLAGS) $<
index a71963c9bbda192f047f144e970d92dcfd764a77..904c779353bbd5e08dfab8e449e607dead8a622c 100644 (file)
@@ -22,10 +22,11 @@ check: $(tests)
 test: $(tests)
 
 $(tests): all
-       $(Q) $@ $(test_options)
+       $(call SAY, $(@))
+       $@ $(test_options)
 
 test-help:
-       $(Q) for t in $(tests); do $$t $(test_options) -h; done
+       @for t in $(tests); do $$t $(test_options) -h; done
 
 test-clean:
        $(RM) -r $(results_dir)