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

Re: [PATCH] make: add INSTALL_STRIP variable

From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Date
Aug 21, 2021, 02:13 UTC
Message-ID
<YSBhPdK8jYIQUNhP@danh.dev>
In-Reply-To
<xmqqwnogt20q.fsf@gitster.g>
On 2021-08-20 11:16:37-0700, Junio C Hamano <gitster@pobox.com> wrote:
Show 46 quoted lines
> Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:
> 
> >>  install: all
> >> +ifdef INSTALL_STRIP
> >> +	$(MAKE) strip
> >> +endif
> >
> > I believe it's better to write like this:
> >
> > ----- 8< ------
> > ifdef INSTALL_STRIP
> > install: strip
> > endif
> >
> > install: all
> > 	....
> > ---- >8-------
> >
> > IOW, install depends on strip, not install invoke strip.
> > I think it would work better for:
> >
> > 	make install strip
> 
> I think you meant "it would work better than 'make install strip'",
> and if so, I tend to agree.  With
> 
> 	echo INSTALL_STRIP=YesPlease >>config.mak
> 
> either Bagas's or your "before installing, make sure we strip"
> change lets
> 
> 	make install
> 
> just work without "strip" given on the command line.
> 
> If users with such a config.mak type "make install strip", it will
> make the recipe for "install" wait until "strip" is done, which is
> what we want, but "strip" on the command line for them is redundant,
> and there is no way for them to install unstripped binaries, which
> may be a bit of downside.
> 
> But for those who do not always want to use INSTALL_STRIP, as Dscho
> said after I mentioned the "make variable" thing, we probably a
> wrong thing when they say "make -j strip install", as there is
> nothing to make recipe for "install" to wait for "strip", so it is
> not a fully satisfactory solution.

In that case, we can use this construct (since we depends on GNU Make, anyway).

---- 8< ------ ifneq ($(filter install,$(MAKECMDGOALS)),) ifneq ($(filter strip,$(MAKECMDGOALS)),) install: strip endif endif ---- >8 -----

MAKECMDGOALS is available from at least GNU Make 3.75.1 in 1997.

Anyway, maybe it's only me, but I think people may want to install first, then strip later for debug mapping.

Show 24 quoted lines
> 
> I think we want two things:
> 
>  (1) if a user says "make [-j] strip install", make sure "install"
>      won't start before "strip" finishes;
> 
>  (2) if a user wants to always install stripped binary, allow some
>      make variable in config.mak so that "make install" would do
>      that without an explicit "strip".
> 
> Of course, if a user does not have (2) configured, "make install"
> should install unstripped binaries, but that goes without saying.
> 
> And after thinking it like this, perhaps a new "install-stripped"
> target that runs "strip" and then "install" as originally proposed
> in the thread that triggered this discussion may be the simplest
> approach.  We can control the optional dependency between "strip"
> and "install", those who want to install stripped binary can use
> "install-stripped" instead of "install", and they can on-demand
> choose to install unstripped binary (which was a potential downside
> of the "make variable" approach under discussion here).
> 
> Thanks.
> 
-- 
Danh
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 10 in “make: add INSTALL_STRIP variable”
  1. make: add INSTALL_STRIP variableBagas Sanjaya, Aug 20, 2021
  2. Đoàn Trần Công DanhAug 20, 2021
  3. Junio C HamanoAug 20, 2021
  4. Đoàn Trần Công DanhAug 21, 2021
  5. Junio C HamanoAug 23, 2021
  6. Bagas SanjayaAug 24, 2021
  7. Johannes SchindelinAug 24, 2021
  8. Junio C HamanoAug 24, 2021
  9. Bagas SanjayaAug 21, 2021
  10. Đoàn Trần Công DanhAug 21, 2021

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.