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 23, 2012, 20:57 UTC
Message-ID
<hbf.20120123j61g@bombur.uio.no>
In-Reply-To
<7vhazm89bo.fsf@alter.siamese.dyndns.org>
On Mon, 23 Jan 2012 12:15:07 -0800, Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Hallvard Breien Furuseth <h.b.furuseth@usit.uio.no> writes:
> 
>> INSTALL says we can install a profiled Git with
>> 	   $ make profile-all
>> 	   # make install prefix=...
>> This does not work...
> 
> We should just drop prefix=... from that line, as the "prefix=value must
> be the same while building and installing" is not only about the "profile"
> build but applies to any other build.
Either add or remove a prefix so they match, yes.  Fine by me either way.
Show 7 quoted lines
> I however wonder why you would need a separate profile-install target,
> though.  Shouldn't 
> 
>	$ make foo-build && make install
> 
> install a funky 'foo' variant of the build for any supported value of
> 'foo'?
'profile-all' makes 'all' with different CFLAGS from those in
Makefile.  'install' makes 'all' which notices CFLAGS has changed
since last build, so it rebuilds:
    $ make install
    * new build flags or prefix
    ...
That's also how the 2nd '$(MAKE) ... all' in profile-all can tell
that it should do anything.  Thus my new 'profile-install:' target
with the same flags as the final $(MAKE) in profile-all.

This looks way too clever to me. 'make' can detect that flags have changed, but should then fail (optionally?) instead of rebuilding. That'd likely solve my issue with other files rewritten as root too. But I'm not volunteering to rewrite your build system.

BTW, it'd be useful to split up 'profile-all' so it is possible to ignore 'make test' failure and compilete the build anyway:

.PHONY: profile-all profile-clean profile-gen profile-use profile-install
profile-all: profile-clean profile-gen profile-use
profile-gen:
	$(MAKE) CFLAGS="$(PROFILE_GEN_CFLAGS)" all
	$(MAKE) CFLAGS="$(PROFILE_GEN_CFLAGS)" -j1 test
profile-use:
	$(MAKE) CFLAGS="$(PROFILE_USE_CFLAGS)" all
-- 
Hallvard
Previous: Junio C HamanoNext: Clemens Buchacher
Message 3 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.