From 5596f891fd6bf8d01bbad447cc5228c626e68ee9 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Fri, 13 Nov 2015 14:56:03 +0100 Subject: [PATCH] Makefiles: stop build process at the error set -e is no longer necessary since we pass it to SHELL directly. Signed-off-by: Tobias Ulmer --- Makefile | 22 +++++++++++----------- doc/Makefile | 18 +++++++++--------- doc/developer/Makefile | 18 +++++++++--------- doc/ldoc/Makefile | 16 ++++++++-------- doc/man/Makefile | 4 ++-- extensions/Makefile | 25 ++++++++++++++----------- generic/Makefile | 4 ++-- global/Makefile | 12 ++++++------ local/Makefile | 10 +++++----- lua/Makefile | 2 +- make.vars | 4 ++++ plugins/Makefile | 2 +- 12 files changed, 72 insertions(+), 65 deletions(-) diff --git a/Makefile b/Makefile index b523e8f..2e6fa18 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ # SUBDIRS = lua generic global local plugins doc templates extensions -TOPLEVEL = . +TOPLEVEL = . include $(TOPLEVEL)/make.vars @@ -59,17 +59,17 @@ buildconfig.lua: Makefile make.vars echo 'buildconfig.VERSION="$(VERSION)"' >>$@ echo 'buildconfig.VERSIONSTRING="$(VERSIONSTRING)"' >>$@ echo 'buildconfig.GLOBAL_INTERFACE_VERSION={' >>$@ - set -e; for x in $(GLOBAL_INTERFACE_VERSION) ; do \ + for x in $(GLOBAL_INTERFACE_VERSION) ; do \ echo " \"$$x\"," ; done >>$@ echo '}' >>$@ echo 'buildconfig.SYNTAX={' >>$@ - set -e; for x in $(SYNTAX) ; do echo " \"$$x\"," ; done >>$@ + for x in $(SYNTAX) ; do echo " \"$$x\"," ; done >>$@ echo '}' >>$@ echo 'return strict.lock(buildconfig)' >>$@ all: buildconfig.lua - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done #$(MAKE) -C lua @@ -82,7 +82,7 @@ all: buildconfig.lua install: all install -d $(DESTDIR)$(LIBDIR) install -m 644 buildconfig.lua $(DESTDIR)$(LIBDIR) - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done #$(MAKE) -C global install @@ -94,7 +94,7 @@ install: all #$(MAKE) -C extensions install uninstall: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done rm -f $(DESTDIR)$(LIBDIR)/buildconfig.lua @@ -108,7 +108,7 @@ uninstall: #rmdir -p $(DESTDIR)$(BINDIR) >/dev/null 2>&1 || : local: buildconfig.lua - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done @@ -129,25 +129,25 @@ install-local: local #$(MAKE) -C doc install-local install -d $(LOCALLIBDIR) install -m 644 buildconfig.lua $(LOCALLIBDIR) - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done doc: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done install-doc: install -d -m 755 $(DESTDIR)$(DOCDIR) install -m 644 Changelog $(DESTDIR)$(DOCDIR)/ - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done clean: rm -f $(CLEAN_FILES) - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done diff --git a/doc/Makefile b/doc/Makefile index c981c18..71b0864 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -26,7 +26,7 @@ # SUBDIRS = ldoc developer man -TOPLEVEL = .. +TOPLEVEL = .. include $(TOPLEVEL)/make.vars @@ -36,32 +36,32 @@ CLEAN_FILES = documentation.tar.gz doc all: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done install: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done uninstall: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done local: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done install-local: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done doc: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done $(MAKE) documentation.tar.gz @@ -76,12 +76,12 @@ documentation.tar.gz: developer/e2factory.tar.gz \ tar -czf documentation.tar.gz documentation install-doc: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done clean: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done rm -fr documentation diff --git a/doc/developer/Makefile b/doc/developer/Makefile index bfdf9e8..e30b262 100644 --- a/doc/developer/Makefile +++ b/doc/developer/Makefile @@ -26,7 +26,7 @@ # SUBDIRS = -TOPLEVEL = ../.. +TOPLEVEL = ../.. LDOC = $(TOPLEVEL)/doc/ldoc/ldoc @@ -38,42 +38,42 @@ CLEAN_FILES = e2factory.tar.gz doc all: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done install: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done uninstall: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done local: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done install-local: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done doc: gen-doc - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done install-doc: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done clean: clean-doc - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done rm -f $(CLEAN_FILES) diff --git a/doc/ldoc/Makefile b/doc/ldoc/Makefile index a5b3209..c0c6378 100644 --- a/doc/ldoc/Makefile +++ b/doc/ldoc/Makefile @@ -8,42 +8,42 @@ CLEAN_FILES = ldoc .PHONY: all install install-local clean local uninstall doc install-doc all: ldoc - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done install: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done uninstall: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done local: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done install-local: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done doc: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done install-doc: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done clean: clean-lua-5.1.3 clean-luafilesystem-1.6.2 - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done rm -f $(CLEAN_FILES) diff --git a/doc/man/Makefile b/doc/man/Makefile index fa399b5..e9846d3 100644 --- a/doc/man/Makefile +++ b/doc/man/Makefile @@ -70,9 +70,9 @@ install: $(MANPAGES) install -m644 $(MANPAGES5) $(DESTDIR)$(MANDIR)/man5 uninstall: - set -e; for x in $(MANPAGES1) ; \ + for x in $(MANPAGES1) ; \ do rm -f $(DESTDIR)$(MANDIR)/man1/$$x ; done - set -e; for x in $(MANPAGES5) ; \ + for x in $(MANPAGES5) ; \ do rm -f $(DESTDIR)$(MANDIR)/man5/$$x ; done rmdir $(DESTDIR)$(MANDIR)/man1 || : rmdir $(DESTDIR)$(MANDIR)/man5 || : diff --git a/extensions/Makefile b/extensions/Makefile index d64d1e5..1714e55 100644 --- a/extensions/Makefile +++ b/extensions/Makefile @@ -25,37 +25,40 @@ # along with this program. If not, see . # -SUBDIRS = $(shell ls | grep -v Makefile) -TOPLEVEL = .. +SUBDIRS = $(shell find . -mindepth 1 -maxdepth 1 -type d) +TOPLEVEL = $(shell pwd)/.. + +# extensions need a way to locate the source +export TOPLEVEL include $(TOPLEVEL)/make.vars -export SRC = $(shell pwd)/$(TOPLEVEL) CLEAN_FILES = *~ all: - set -e; for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done + for s in $(SUBDIRS); do $(MAKE) -C $$s $@; done install: - set -e; for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done + for s in $(SUBDIRS); do $(MAKE) -C $$s $@; done uninstall: - set -e; for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done + for s in $(SUBDIRS); do $(MAKE) -C $$s $@; done local: - set -e; for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done + for s in $(SUBDIRS); do $(MAKE) -C $$s $@; done install-local: - set -e; for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done + for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@; done doc: - set -e; for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done + for s in $(SUBDIRS); do $(MAKE) -C $$s $@; done install-doc: - set -e; for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done + for s in $(SUBDIRS); do $(MAKE) -C $$s $@; done clean: - set -e; for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done + for s in $(SUBDIRS); do $(MAKE) -C $$s $@; done rm -f $(CLEAN_FILES) .PHONY: all install local install-local doc install-doc clean + diff --git a/generic/Makefile b/generic/Makefile index cfcdd39..8d69a04 100644 --- a/generic/Makefile +++ b/generic/Makefile @@ -53,7 +53,7 @@ install: all install -m 644 $(SO_LIBS) $(DESTDIR)$(LIBDIR) uninstall: - set -e; for f in $(LUA_LIBS) $(SO_LIBS); do \ + for f in $(LUA_LIBS) $(SO_LIBS); do \ rm -f "$(DESTDIR)$(LIBDIR)/$$f"; \ done rmdir -p $(DESTDIR)$(LIBDIR) || true @@ -66,7 +66,7 @@ install-local: local install -m 644 $(SO_LIBS) $(LOCALLIBDIR) uninstall-local: - set -e; for f in $(LUA_LIBS) $(SO_LIBS); do \ + for f in $(LUA_LIBS) $(SO_LIBS); do \ rm -f "$(LOCALLIBDIR)/$$f"; \ done rmdir -p $(LOCALLIBDIR) || true diff --git a/global/Makefile b/global/Makefile index c1b3aea..9cb9f9d 100644 --- a/global/Makefile +++ b/global/Makefile @@ -54,11 +54,11 @@ install-dirs: install: all install-dirs - set -e; for i in $(GLOBALLUATOOLS) ; do \ + for i in $(GLOBALLUATOOLS) ; do \ install -m 755 $$i.lua $(DESTDIR)$(TOOLDIR)/$$i ; \ ln -sf e2 $(DESTDIR)$(BINDIR)/$$i ; \ done - set -e; for i in $(GLOBALSHTOOLS) ; do \ + for i in $(GLOBALSHTOOLS) ; do \ install -m 755 $$i.sh $(DESTDIR)$(BINDIR)/$$i ; \ done install -m 755 e2 $(DESTDIR)$(BINDIR)/ @@ -70,11 +70,11 @@ install: all install-dirs $(DESTDIR)$(BINDIR)/ uninstall: - set -e; for i in $(GLOBALLUATOOLS) ; do \ + for i in $(GLOBALLUATOOLS) ; do \ rm -f $(DESTDIR)$(TOOLDIR)/$$i ; \ rm -f $(DESTDIR)$(BINDIR)/$$i ; \ done - set -e; for i in $(GLOBALSHTOOLS) ; do \ + for i in $(GLOBALSHTOOLS) ; do \ rm -f $(DESTDIR)$(BINDIR)/$$i ; \ done rm -f $(DESTDIR)$(BINDIR)/e2-su-2.2 @@ -91,12 +91,12 @@ uninstall-local: rmdir -p $(LOCALMAKDIR) || true doc: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done install-doc: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done diff --git a/local/Makefile b/local/Makefile index cd0363c..629fdb8 100644 --- a/local/Makefile +++ b/local/Makefile @@ -50,7 +50,7 @@ LOCALTOOLS = $(LOCALLUATOOLS) all: install: - set -e; for i in $(LOCALTOOLS); do \ + for i in $(LOCALTOOLS); do \ ln -sf e2 $(DESTDIR)$(BINDIR)/$$i ; \ done @@ -63,7 +63,7 @@ install-local: local install -d $(LOCALMAKDIR) install -d $(LOCALLIBDIR) install -m 644 $(LOCALLUALIBS) $(LOCALLIBDIR) - set -e; for i in $(LOCALLUATOOLS); do \ + for i in $(LOCALLUATOOLS); do \ install -m 755 $$i.lua $(LOCALBINDIR)/$$i; \ done install -m755 linux32 $(LOCALBINDIR)/e2-linux32; \ @@ -72,17 +72,17 @@ install-local: local $(MAKE) -C make install-local doc: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done install-doc: - set -e; for s in $(SUBDIRS) ; do \ + for s in $(SUBDIRS) ; do \ $(MAKE) -C $$s $@ ;\ done uninstall: - set -e; for i in $(LOCALTOOLS); do \ + for i in $(LOCALTOOLS); do \ rm -f $(DESTDIR)$(BINDIR)/e2-$$i ; \ done diff --git a/lua/Makefile b/lua/Makefile index 6575440..2b318b2 100644 --- a/lua/Makefile +++ b/lua/Makefile @@ -57,7 +57,7 @@ uninstall: rm -f $(DESTDIR)$(LIBEXECDIR)/e2-lua-5.1.3 rm -f $(DESTDIR)$(LIBEXECDIR)/e2-luac-5.1.3 rmdir -p $(DESTDIR)$(LIBEXECDIR)/lua-5.1.3 || true - set -e; for x in $(LUA_HEADER) ; do \ + for x in $(LUA_HEADER) ; do \ rm -f $(DESTDIR)$(INCDIR)/lua-5.1.3/$$x ; \ done rmdir -p $(DESTDIR)$(INCDIR)/lua-5.1.3 || true diff --git a/make.vars b/make.vars index aa295ef..9d06011 100644 --- a/make.vars +++ b/make.vars @@ -1,5 +1,9 @@ # make.vars -*- makefile -*- +# Older (3.81) GNU Make versions don't support .POSIX or .SHELLFLAGS +# Without this, recursive make will not "trickle down" errors. +SHELL = /bin/sh -e + # version string NAME = e2factory MAJOR = 2 diff --git a/plugins/Makefile b/plugins/Makefile index 1810c92..a635e8e 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -43,7 +43,7 @@ install: install-local: install -m 755 -d $(LOCALPLUGINDIR) - set -e; for p in $(LOCALPLUGINS) ; do \ + for p in $(LOCALPLUGINS) ; do \ install -m 644 $$p $(LOCALPLUGINDIR)/$$p; \ done -- 2.39.5