git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: make install rewrites source files

From
HFHallvard 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
Previous: Junio C HamanoNext: Phillip Susi
Message 6 of 9 in “make install rewrites source files”
  1. Hallvard Breien FurusethJan 23, 2012
  2. Junio C HamanoJan 23, 2012
  3. Hallvard Breien FurusethJan 23, 2012
  4. Clemens BuchacherJan 26, 2012
  5. Junio C HamanoJan 27, 2012
  6. Hallvard Breien FurusethJan 27, 2012
  7. Phillip SusiJan 23, 2012
  8. Junio C HamanoJan 23, 2012
  9. Hallvard B FurusethJan 27, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.