From: Hallvard Breien Furuseth <h.b.furuseth@usit.uio.no>
To: Clemens Buchacher <drizzd@aon.at>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: make install rewrites source files
Date: Fri, 27 Jan 2012 14:11:46 +0100 (CET) [thread overview]
Message-ID: <hbf.20120127mhkz@bombur.uio.no> (raw)
In-Reply-To: <20120126225231.GA14753@ecki>
On Thu, 26 Jan 2012 23:52:31 +0100, Clemens Buchacher <drizzd@aon.at> wrote:
> 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
next prev parent reply other threads:[~2012-01-27 13:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-23 14:18 make install rewrites source files Hallvard Breien Furuseth
2012-01-23 20:15 ` Junio C Hamano
2012-01-23 20:57 ` Hallvard Breien Furuseth
2012-01-26 22:52 ` Clemens Buchacher
2012-01-27 0:49 ` Junio C Hamano
2012-01-27 13:11 ` Hallvard Breien Furuseth [this message]
2012-01-23 20:28 ` Phillip Susi
2012-01-23 20:52 ` Junio C Hamano
2012-01-27 9:46 ` Hallvard B Furuseth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=hbf.20120127mhkz@bombur.uio.no \
--to=h.b.furuseth@usit.uio.no \
--cc=drizzd@aon.at \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).