From 53f48ca221dd5ee65297fdce42ff52aecdc03cde Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 20 Dec 2007 13:16:21 +0000 Subject: Fix some build system error handling. Signed-off-by: Ian Jackson --- buildconfigs/mk.linux-2.6-common | 2 +- buildconfigs/src.hg-clone | 2 +- docs/Makefile | 2 +- tools/examples/Makefile | 13 ++++++------- tools/firmware/rombios/32bit/Makefile | 2 +- tools/ioemu/Makefile | 8 ++++---- tools/ioemu/tests/Makefile | 2 +- tools/libaio/Makefile | 4 ++-- tools/libxen/Makefile | 2 +- tools/libxen/Makefile.dist | 2 +- tools/python/Makefile | 6 +++--- tools/security/Makefile | 4 ++-- tools/vtpm/Makefile | 14 +++++++------- tools/xm-test/ramdisk/Makefile.am | 8 ++++---- xen/Makefile | 4 ++-- xen/include/Makefile | 2 +- 16 files changed, 38 insertions(+), 39 deletions(-) diff --git a/buildconfigs/mk.linux-2.6-common b/buildconfigs/mk.linux-2.6-common index 2fa7052b2b..35150591b5 100644 --- a/buildconfigs/mk.linux-2.6-common +++ b/buildconfigs/mk.linux-2.6-common @@ -103,7 +103,7 @@ ifneq ($(EXTRAVERSION),) echo "$(EXTRAVERSION)" >$(LINUX_DIR)/localversion-xen endif $(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) oldconfig O=$$(/bin/pwd)/$(LINUX_DIR) - @if [ ! -f $(LINUX_DIR)/Makefile ] ; then \ + @set -e ; if [ ! -f $(LINUX_DIR)/Makefile ] ; then \ echo "***********************************"; \ echo "oldconfig did not create a Makefile"; \ echo "Generating $(LINUX_DIR)/Makefile "; \ diff --git a/buildconfigs/src.hg-clone b/buildconfigs/src.hg-clone index fa7f247e7e..0586bc8ed6 100644 --- a/buildconfigs/src.hg-clone +++ b/buildconfigs/src.hg-clone @@ -25,7 +25,7 @@ $(LINUX_SRCDIR)/.valid-src: $(__XEN_LINUX_UPDATE) echo "Pulling changes from $${__parent} into $(LINUX_SRCDIR)." ; \ $(HG) -R $(LINUX_SRCDIR) pull $${__parent} ; \ fi - if [ -n "$(XEN_LINUX_HGREV)" ] ; then \ + set -e ; if [ -n "$(XEN_LINUX_HGREV)" ] ; then \ echo "Updating $(LINUX_SRCDIR) to revision $(XEN_LINUX_HGREV)." ; \ ( cd $(LINUX_SRCDIR) && $(HG) update $(XEN_LINUX_HGREV) ); \ fi diff --git a/docs/Makefile b/docs/Makefile index bc80193dd0..b412008125 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -44,7 +44,7 @@ html: .PHONY: python-dev-docs python-dev-docs: @mkdir -v -p api/tools/python - @if which $(DOXYGEN) 1>/dev/null 2>/dev/null; then \ + @set -e ; if which $(DOXYGEN) 1>/dev/null 2>/dev/null; then \ echo "Running doxygen to generate Python tools APIs ... "; \ $(DOXYGEN) Doxyfile; \ $(MAKE) -C api/tools/python/latex ; else \ diff --git a/tools/examples/Makefile b/tools/examples/Makefile index af4a179fdc..328b3b2946 100644 --- a/tools/examples/Makefile +++ b/tools/examples/Makefile @@ -76,7 +76,7 @@ install-configs: $(XEN_CONFIGS) $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR) [ -d $(DESTDIR)$(XEN_CONFIG_DIR)/auto ] || \ $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)/auto - for i in $(XEN_CONFIGS); \ + set -e; for i in $(XEN_CONFIGS); \ do [ -e $(DESTDIR)$(XEN_CONFIG_DIR)/$$i ] || \ $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \ done @@ -85,11 +85,11 @@ install-configs: $(XEN_CONFIGS) install-scripts: [ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \ $(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR) - for i in $(XEN_SCRIPTS); \ + set -e; for i in $(XEN_SCRIPTS); \ do \ $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \ done - for i in $(XEN_SCRIPT_DATA); \ + set -e; for i in $(XEN_SCRIPT_DATA); \ do \ $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \ done @@ -98,7 +98,7 @@ install-scripts: install-hotplug: [ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \ $(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR) - for i in $(XEN_HOTPLUG_SCRIPTS); \ + set -e; for i in $(XEN_HOTPLUG_SCRIPTS); \ do \ $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \ done @@ -107,11 +107,10 @@ install-hotplug: install-udev: [ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \ $(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d - for i in $(UDEV_RULES); \ + set -e; for i in $(UDEV_RULES); \ do \ $(INSTALL_DATA) $$i $(DESTDIR)$(UDEV_RULES_DIR); \ - ( cd $(DESTDIR)$(UDEV_RULES_DIR)/rules.d ; \ - ln -sf ../$$i . ) \ + ln -sf ../$$i $(DESTDIR)$(UDEV_RULES_DIR)/rules.d; \ done .PHONY: clean diff --git a/tools/firmware/rombios/32bit/Makefile b/tools/firmware/rombios/32bit/Makefile index 1cafa8aa1d..dc8c32b420 100644 --- a/tools/firmware/rombios/32bit/Makefile +++ b/tools/firmware/rombios/32bit/Makefile @@ -19,7 +19,7 @@ MODULES = tcgbios/tcgbiosext.o .PHONY: all subdirs clean subdirs: - @for subdir in $(SUBDIRS); do \ + @set -e; for subdir in $(SUBDIRS); do \ $(MAKE) -C $$subdir all; \ done; diff --git a/tools/ioemu/Makefile b/tools/ioemu/Makefile index c676052e3c..76f6f9af99 100644 --- a/tools/ioemu/Makefile +++ b/tools/ioemu/Makefile @@ -89,7 +89,7 @@ install: all $(if $(BUILD_DOCS),install-doc) # done ifndef CONFIG_WIN32 mkdir -p "$(DESTDIR)$(datadir)/keymaps" - for x in $(KEYMAPS); do \ + set -e; for x in $(KEYMAPS); do \ $(INSTALL_DATA) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \ done endif @@ -140,12 +140,12 @@ FILE = qemu-$(VERSION) tar: rm -rf /tmp/$(FILE) cp -r . /tmp/$(FILE) - ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS ) + cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS rm -rf /tmp/$(FILE) # generate a binary distribution tarbin: - ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \ + cd / && tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \ $(bindir)/qemu \ $(bindir)/qemu-system-ppc \ $(bindir)/qemu-system-sparc \ @@ -173,7 +173,7 @@ tarbin: $(datadir)/pxe-pcnet.bin \ $(docdir)/qemu-doc.html \ $(docdir)/qemu-tech.html \ - $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 ) + $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 ifneq ($(wildcard .depend),) include .depend diff --git a/tools/ioemu/tests/Makefile b/tools/ioemu/tests/Makefile index 79a3d55b5d..1f67ac5d21 100644 --- a/tools/ioemu/tests/Makefile +++ b/tools/ioemu/tests/Makefile @@ -91,7 +91,7 @@ hello-mipsel: hello-mips.c # XXX: find a way to compile easily a test for each arch test2: - @for arch in i386 arm armeb sparc ppc mips mipsel; do \ + @set -e; for arch in i386 arm armeb sparc ppc mips mipsel; do \ ../$${arch}-linux-user/qemu-$${arch} $${arch}/ls -l linux-test.c ; \ done diff --git a/tools/libaio/Makefile b/tools/libaio/Makefile index 06d8775e33..7f5c344b49 100644 --- a/tools/libaio/Makefile +++ b/tools/libaio/Makefile @@ -25,9 +25,9 @@ tag-archive: create-archive: tag-archive @rm -rf /tmp/$(NAME) - @cd /tmp; cvs -Q -d $(CVSROOT) export -r$(CVSTAG) $(NAME) || echo GRRRrrrrr -- ignore [export aborted] + @cd /tmp && cvs -Q -d $(CVSROOT) export -r$(CVSTAG) $(NAME) || echo GRRRrrrrr -- ignore [export aborted] @mv /tmp/$(NAME) /tmp/$(NAME)-$(VERSION) - @cd /tmp; tar czSpf $(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION) + @cd /tmp && tar czSpf $(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION) @rm -rf /tmp/$(NAME)-$(VERSION) @cp /tmp/$(NAME)-$(VERSION).tar.gz . @rm -f /tmp/$(NAME)-$(VERSION).tar.gz diff --git a/tools/libxen/Makefile b/tools/libxen/Makefile index 00d729dc3e..db7be23348 100644 --- a/tools/libxen/Makefile +++ b/tools/libxen/Makefile @@ -61,7 +61,7 @@ install: all ln -sf libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so.$(MAJOR) ln -sf libxenapi.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so $(INSTALL_DATA) libxenapi.a $(DESTDIR)/usr/$(LIBDIR) - for i in $(LIBXENAPI_HDRS); do \ + set -e; for i in $(LIBXENAPI_HDRS); do \ $(INSTALL_DATA) $$i $(DESTDIR)/usr/include/xen/api; \ done diff --git a/tools/libxen/Makefile.dist b/tools/libxen/Makefile.dist index f811c5899f..0f4a8dbd75 100644 --- a/tools/libxen/Makefile.dist +++ b/tools/libxen/Makefile.dist @@ -71,7 +71,7 @@ install: all ln -sf libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so.$(MAJOR) ln -sf libxenapi.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so $(INSTALL_DATA) libxenapi.a $(DESTDIR)/usr/$(LIBDIR) - for i in $(LIBXENAPI_HDRS); do \ + set -e; for i in $(LIBXENAPI_HDRS); do \ $(INSTALL_DATA) $$i $(DESTDIR)/usr/include/xen/api; \ done diff --git a/tools/python/Makefile b/tools/python/Makefile index 21be26b99b..76603f4880 100644 --- a/tools/python/Makefile +++ b/tools/python/Makefile @@ -40,7 +40,7 @@ refresh-pot: $(I18NSRCFILES) $(I18NSRCFILES) sed -f remove-potcdate.sed < $(POTFILE) > $(POTFILE)-1 sed -f remove-potcdate.sed < $(POTFILE)-tmp > $(POTFILE)-2 - if cmp -s $(POTFILE)-1 $(POTFILE)-2; then \ + set -e; if cmp -s $(POTFILE)-1 $(POTFILE)-2; then \ rm -f $(POTFILE)-tmp $(POTFILE)-1 $(POTFILE)-2; \ else \ mv $(POTFILE)-tmp $(POTFILE); \ @@ -48,7 +48,7 @@ refresh-pot: $(I18NSRCFILES) fi refresh-po: $(POTFILE) - for l in $(LINGUAS); do \ + set -e; for l in $(LINGUAS); do \ if $(MSGMERGE) $(PODIR)/$$l.po $(POTFILE) > $(PODIR)/$$l-tmp ; then \ mv -f $(PODIR)/$$l-tmp $(PODIR)/$$l.po ; \ echo "$(MSGMERGE) of $$l.po succeeded" ; \ @@ -88,7 +88,7 @@ install-dtd: all $(INSTALL_DATA) xen/xm/create.dtd $(DESTDIR)/usr/share/xen install-messages: all - if which $(MSGFMT) >/dev/null ; then \ + set -e; if which $(MSGFMT) >/dev/null ; then \ mkdir -p $(DESTDIR)$(NLSDIR); \ for l in $(LINGUAS); do \ $(INSTALL_DIR) $(DESTDIR)$(NLSDIR)/$$l; \ diff --git a/tools/security/Makefile b/tools/security/Makefile index 975115189f..4ba944bb8b 100644 --- a/tools/security/Makefile +++ b/tools/security/Makefile @@ -51,10 +51,10 @@ install: all $(ACM_CONFIG_FILE) $(INSTALL_DIR) $(DESTDIR)$(ACM_POLICY_DIR) $(INSTALL_DATA) policies/$(ACM_SCHEMA) $(DESTDIR)$(ACM_POLICY_DIR) $(INSTALL_DIR) $(DESTDIR)$(ACM_POLICY_DIR)/example - for i in $(ACM_EXAMPLES); do \ + set -e; for i in $(ACM_EXAMPLES); do \ $(INSTALL_DATA) policies/example/$$i-$(ACM_POLICY_SUFFIX) $(DESTDIR)$(ACM_POLICY_DIR)/example/; \ done - for i in $(ACM_DEF_POLICIES); do \ + set -e; for i in $(ACM_DEF_POLICIES); do \ $(INSTALL_DATA) policies/$$i-$(ACM_POLICY_SUFFIX) $(DESTDIR)$(ACM_POLICY_DIR); \ done $(INSTALL_DIR) $(DESTDIR)$(ACM_SCRIPT_DIR) diff --git a/tools/vtpm/Makefile b/tools/vtpm/Makefile index 25063c2844..691a608030 100644 --- a/tools/vtpm/Makefile +++ b/tools/vtpm/Makefile @@ -49,7 +49,7 @@ $(TPM_EMULATOR_TARFILE): # Create vtpm and TPM emulator dirs # apply patches for 1) used as dom0 tpm driver 2) used as vtpm device instance $(TPM_EMULATOR_DIR): $(TPM_EMULATOR_TARFILE) tpm_emulator.patch - if [ "$(BUILD_EMULATOR)" = "y" ]; then \ + set -e; if [ "$(BUILD_EMULATOR)" = "y" ]; then \ rm -rf $(TPM_EMULATOR_DIR); \ tar -xzf $(TPM_EMULATOR_TARFILE); \ mv $(TPM_EMULATOR_NAME) $(TPM_EMULATOR_DIR); \ @@ -59,20 +59,20 @@ $(TPM_EMULATOR_DIR): $(TPM_EMULATOR_TARFILE) tpm_emulator.patch $(VTPM_DIR): $(TPM_EMULATOR_TARFILE) vtpm.patch rm -rf $(VTPM_DIR) - tar -xzf $(TPM_EMULATOR_TARFILE); - mv $(TPM_EMULATOR_NAME) $(VTPM_DIR); + tar -xzf $(TPM_EMULATOR_TARFILE) + mv $(TPM_EMULATOR_NAME) $(VTPM_DIR) - cd $(VTPM_DIR); \ + set -e; cd $(VTPM_DIR); \ patch -p1 < ../tpm_emulator.patch; \ patch -p1 < ../vtpm.patch orig: $(TPM_EMULATOR_TARFILE) mkdir $(ORIG_DIR); - cd $(ORIG_DIR); \ + set -e; cd $(ORIG_DIR); \ tar -xzf ../$(TPM_EMULATOR_TARFILE); updatepatches: clean orig - if [ "$(BUILD_EMULATOR)" = "y" ]; then \ + set -e; if [ "$(BUILD_EMULATOR)" = "y" ]; then \ find $(TPM_EMULATOR_DIR) -name "*.orig" -print | xargs rm -f; \ mv tpm_emulator.patch tpm_emulator.patch.old; \ diff -uprN orig/$(TPM_EMULATOR_NAME) $(TPM_EMULATOR_DIR) > tpm_emulator.patch || true; \ @@ -83,7 +83,7 @@ updatepatches: clean orig .PHONY: build_sub build_sub: - @if [ -e $(GMP_HEADER) ]; then \ + set -e; @if [ -e $(GMP_HEADER) ]; then \ $(MAKE) -C $(VTPM_DIR); \ if [ "$(BUILD_EMULATOR)" = "y" ]; then \ $(MAKE) -C $(TPM_EMULATOR_DIR); \ diff --git a/tools/xm-test/ramdisk/Makefile.am b/tools/xm-test/ramdisk/Makefile.am index a59e0be21a..944a07146e 100644 --- a/tools/xm-test/ramdisk/Makefile.am +++ b/tools/xm-test/ramdisk/Makefile.am @@ -59,8 +59,8 @@ $(BR_IMG): $(BR_SRC) cp configs/buildroot-$(BR_ARCH) $(BR_SRC)/.config cp configs/busybox $(BR_SRC)/package/busybox/busybox.config cp configs/uClibc $(BR_SRC)/toolchain/uClibc/uClibc.config - (for i in patches/buildroot/*.patch; do \ - cd $(BR_SRC) && patch -p1 <../$$i && cd ..; done ) + set -e; for i in patches/buildroot/*.patch; do \ + cd $(BR_SRC) && patch -p1 <../$$i && cd ..; done cd $(BR_SRC) && make oldconfig && make $(XMTEST_VER_IMG): $(BR_IMG) @@ -69,8 +69,8 @@ $(XMTEST_VER_IMG): $(BR_IMG) -[ -e "$(BLKDRV)" ] && cp $(BLKDRV) skel/modules -[ -e "$(NETDRV)" ] && cp $(NETDRV) skel/modules -[ -e "$(PKTDRV)" ] && cp $(PKTDRV) skel/modules - (cd skel; tar cf - .) \ - | (cd $(BR_SRC)/$(BR_ROOT); tar xvf -) + (cd skel && tar cf - .) \ + | (cd $(BR_SRC)/$(BR_ROOT) && tar xvf -) cd $(BR_SRC) && make cp $(BR_IMG) $(XMTEST_VER_IMG) diff --git a/xen/Makefile b/xen/Makefile index b89893357f..625f082603 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -141,13 +141,13 @@ endef .PHONY: _TAGS _TAGS: - rm -f TAGS; \ + set -e; rm -f TAGS; \ $(call set_exuberant_flags,etags); \ $(all_sources) | xargs etags $$exuberant_flags -a .PHONY: _tags _tags: - rm -f tags; \ + set -e; rm -f tags; \ $(call set_exuberant_flags,ctags); \ $(all_sources) | xargs ctags $$exuberant_flags -a diff --git a/xen/include/Makefile b/xen/include/Makefile index 64c87f6722..64f72865ae 100644 --- a/xen/include/Makefile +++ b/xen/include/Makefile @@ -37,7 +37,7 @@ endif all: $(headers-y) compat/%.h: compat/%.i Makefile - id=_$$(echo $@ | tr '[:lower:]-/.' '[:upper:]___'); \ + set -e; id=_$$(echo $@ | tr '[:lower:]-/.' '[:upper:]___'); \ echo "#ifndef $$id" >$@.new; \ echo "#define $$id" >>$@.new; \ echo "#include " >>$@.new; \ -- cgit v1.2.3