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

Re: [PATCH] make: add install-strip target

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 18, 2021, 10:25 UTC
Message-ID
<nycvar.QRO.7.76.6.2108181222120.55@tvgsbejvaqbjf.bet>
In-Reply-To
<CAPig+cT5nPJ7NKFKXRQJwTzL13oEwzMBBpAa+P+XoZxO9SEKKQ@mail.gmail.com>
Hi Eric,
On Tue, 17 Aug 2021, Eric Sunshine wrote:
Show 14 quoted lines
> On Tue, Aug 17, 2021 at 5:29 PM Johannes Schindelin
> <Johannes.Schindelin@gmx.de> wrote:
> > On Tue, 17 Aug 2021, Bagas Sanjaya wrote:
> > > diff --git a/Makefile b/Makefile
> > > @@ -3093,6 +3093,9 @@ endif
> > > +install-strip: all strip
> >
> > Would those `all` and `strip` targets interfere with one another if `make
> > -j2` was called? If not, wouldn't it be sufficient to let `install-strip`
> > depend on `strip` alone?
>
> A more pertinent question, perhaps, is why would we need
> `install-strip` at all? What benefit does it provide over simply
> typing `make strip install`?

That would require an order-only prerequisite (see https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html) for `make -j2 strip install` to work correctly, i.e. something like this:

-- snip --
diff --git a/Makefile b/Makefile
index 2d5c822f7a8..9987f3b2c13 100644
--- a/Makefile
+++ b/Makefile
@@ -2990,7 +2990,7 @@ profile-install: profile
 profile-fast-install: profile-fast
 	$(MAKE) install

-install: all
+install: all | strip
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
 	$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
-- snap --

I am not quite certain that this is compatible with other `make`
implementations we still might support (if there are any, I remember that
we often have to rely on `gmake` because the native `make` does not
understand our `Makefile`?), so that might need to be conditional on GNU
Make.

Ciao,
Dscho
Previous: Eric SunshineNext: Junio C Hamano
Message 4 of 9 in “make: add install-strip target”
  1. make: add install-strip targetBagas Sanjaya, Aug 17, 2021
  2. Johannes SchindelinAug 17, 2021
  3. Eric SunshineAug 17, 2021
  4. Johannes SchindelinAug 18, 2021
  5. Junio C HamanoAug 19, 2021
  6. Johannes SchindelinAug 24, 2021
  7. Junio C HamanoAug 17, 2021
  8. Johannes SchindelinAug 18, 2021
  9. Junio C HamanoAug 19, 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.