From: Hallvard Breien Furuseth Date: Mon, 23 Jan 2012 14:18:18 GMT Subject: make install rewrites source files Message-ID: INSTALL says we can install a profiled Git with $ make profile-all # make install prefix=... This does not work: 'make install' notices that the build flags has changed and rebuilds Git - presumably without using the profile info. The patch below fixes this. However, make install should not write to the source directory in any case. That fails as root if root lacks write access there, due to NFS mounts that map root to nobody etc. At least git-instaweb and GIT-BUILD-OPTIONS are rewritten. You can simulate this with su nobody -s /bin/bash -c 'make -k install' after configuring with prefix=. Index: INSTALL --- INSTALL~ +++ INSTALL @@ -29,6 +29,6 @@ If you're willing to trade off (much) lo faster git you can also do a profile feedback build with - $ make profile-all - # make prefix=... install + $ make profile-all prefix=... + # make profile-install prefix=... This will run the complete test suite as training workload and then Index: Makefile --- Makefile~ 2012-01-19 01:36:02.000000000 +0100 +++ Makefile 2012-01-23 14:44:56.554980323 +0100 @@ -2695,5 +2695,5 @@ cover_db_html: cover_db ### profile feedback build # -.PHONY: profile-all profile-clean +.PHONY: profile-all profile-clean profile-install PROFILE_GEN_CFLAGS := $(CFLAGS) -fprofile-generate -DNO_NORETURN=1 @@ -2708,2 +2708,5 @@ profile-all: profile-clean $(MAKE) CFLAGS="$(PROFILE_GEN_CFLAGS)" -j1 test $(MAKE) CFLAGS="$(PROFILE_USE_CFLAGS)" all + +profile-install: + $(MAKE) CFLAGS="$(PROFILE_USE_CFLAGS)" install