- use -p with INSTALL to reduce rebuilds
PATCH 1/1 - use -p with INSTALL to reduce rebuilds
I do a fair number of builds, and also build other, user applications based upon libraries and .h files. The attached patch adds the -p option to install to retain the source file times. This prevents unnecessary rebuilds. Additionally, a few errant INSTALL and install lines are cleaned up.
An optional approach would be to modify the base INSTALL definition, but I chose to use the more specific approach in the patch. FUD is a powerful force.
Signature · 5 lines
------------------------------------------------------------------------ Ben Thomas Virtual Iron Software [email protected] Tower 1, Floor 2 978-849-1214 900 Chelmsford Street Lowell, MA 01851
This patch addresses three related issues:
- convert raw "install" command to use $(INSTALL)
- convert some $(INSTALL) to $(INSTALL_DATA) as appropriate
- finally, modify the specific $(INSTALL) definitions to use -p. This modification preserves dates. It has been observed that a number of unnecessary rebuilds take place due to install modifying the destination date. Preserving the source date information (-p) prevents these rebuilds.
config/StdGNU.mk +3 -3
@@ -12,9 +12,9 @@ MSGFMT = msgfmt MSGFMT = msgfmt INSTALL = install -INSTALL_DIR = $(INSTALL) -d -m0755 -INSTALL_DATA = $(INSTALL) -m0644 -INSTALL_PROG = $(INSTALL) -m0755 +INSTALL_DIR = $(INSTALL) -d -m0755 -p +INSTALL_DATA = $(INSTALL) -m0644 -p +INSTALL_PROG = $(INSTALL) -m0755 -p LIB64DIR = lib64
tools/guest-headers/Makefile +1 -1
@@ -13,7 +13,7 @@ check: install-Linux: mkdir -p $(DESTDIR)/usr/include/xen/linux - install -m0644 $(linuxsparsetree)/include/xen/public/*.h $(DESTDIR)/usr/include/xen/linux + $(INSTALL_DATA) $(linuxsparsetree)/include/xen/public/*.h $(DESTDIR)/usr/include/xen/linux install-SunOS:
tools/ioemu/Makefile +4 -4
@@ -65,10 +65,10 @@ common de-ch es fo fr-ca hu install-doc: $(DOCS) mkdir -p "$(DESTDIR)$(docdir)" - $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)" + $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)" ifndef CONFIG_WIN32 mkdir -p "$(DESTDIR)$(mandir)/man1" - $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1" + $(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1" endif install: all $(if $(BUILD_DOCS),install-doc)
@@ -77,12 +77,12 @@ install: all $(if $(BUILD_DOCS),install- # mkdir -p "$(DESTDIR)$(datadir)" # for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \ # video.x openbios-sparc32 linux_boot.bin; do \ -# $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \ +# $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \ # done ifndef CONFIG_WIN32 mkdir -p "$(DESTDIR)$(datadir)/keymaps" for x in $(KEYMAPS); do \ - $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \ + $(INSTALL_DATA) $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \ done endif for d in $(TARGET_DIRS); do \
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 5 lines · Ben Thomas
- finally, modify the specific $(INSTALL) definitions to use -p. This modification preserves dates. It has been observed that a number of unnecessary rebuilds take place due to install modifying the destination date. Preserving the source date information (-p) prevents these rebuilds.
If we have build rules depending on the install target, rather than source, that should probably be fixed in preference.
-- Keir