Re: make install rewrites source files
- From
- Hallvard Breien Furuseth <h.b.furuseth@usit.uio.no>
- Date
- Jan 27, 2012, 13:11 UTC
- Message-ID
- <hbf.20120127mhkz@bombur.uio.no>
- In-Reply-To
- <20120126225231.GA14753@ecki>
On Thu, 26 Jan 2012 23:52:31 +0100, Clemens Buchacher <drizzd@aon.at> wrote:
Show 12 quoted lines
> How about removing the profile-all target and making it a build option > instead? To enable it, do the usual: > (...) > ifdef PROFILE_BUILD > all: > $(MAKE) CFLAGS=... -fprofile-generate ... all-one > $(MAKE) CFLAGS=... -fprofile-use ... all-one > else > all: all-one > endif > > and each previous instance of 'all' replaced with 'all-one'.
Not quite. test: and install: should depend on 'all', otherwise making them without doing 'make all' first will test/install an unprofiled Git.
So 'all' with profiling should be today's profile-all, which should not throw away the build and start over. It can create some files to mark how far it has gotten instead. And profile-generate currently uses 'test' which would recurse, it needs another internal test target.
Not sure if it is worth it. Something like this, perhaps. Except I have not thought about how this interacts with the coverage targets.
# Final targets
ifdef PROFILE_BUILD all:: profile-all test: profile-test install: profile-install else all:: all-one test: test-one install: install-one endif
# Profiling # # Note: If profiling (the test phase) failed halfway through but you # still want to use the partial profile results to build Git, you can # touch p-gen.stamp # and then 'make all' again.
profile-all: p-use.stamp
profile-gen p-gen.stamp: $(MAKE) CFLAGS="$(PROFILE_GEN_CFLAGS)" all-one $(MAKE) CFLAGS="$(PROFILE_GEN_CFLAGS)" -j1 test-one touch p-gen.stamp
profile-use p-use.stamp: p-gen.stamp $(MAKE) CFLAGS="$(PROFILE_USE_CFLAGS)" all-one touch p-use.stamp
profile-test: p-use.stamp $(MAKE) CFLAGS="$(PROFILE_USE_CFLAGS)" test-one
profile-install: p-use.stamp $(MAKE) CFLAGS="$(PROFILE_USE_CFLAGS)" install-one
.PHONY: all-one test test-one install install-one .PHONY: profile-all profile-gen profile-test profile-install profile-clean
Also let 'clean' depend on 'profile-clean' which does $(RM) p-gen.stamp p-use.stamp.
-- Hallvard