Subject: Re: [PATCH] make: add INSTALL_STRIP variable

From: Junio C Hamano <[email-masked]>
Date: Mon, 23 Aug 2021 08:55:47 -0700

Đoàn Trần Công Danh  <[email-masked]> writes:

> 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.

Or the "|" thing Dscho floated earlier?

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

Perhaps.  One bad thing with the current "strip" arrangement is that
it is done in the built directory, and because "make install" would
blindly install whatever in the built directory, if you truly care
that you install unstripped binaries, you need to see if they are
stripped and rebuild them as needed, because "make strip" may or may
not have been done.  From that point of view, getting rid of the
current "make strip" and introducing either "make strip-installed"
("we've installed things earlier---go strip them") or "make
install-stripped" ("we've built (or if we haven't please build them
first), now install them and strip them in the installed directory")
may make more sense.  And for that, any idea that came up in this
discussion that relies on the current "strip" target would not help.

Thanks.