All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: git@vger.kernel.org, "Đoàn Trần Công Danh" <congdanhqx@gmail.com>,
	felipe.contreras@gmail.com,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH RESEND v2] make: add install-stripped target
Date: Wed, 01 Sep 2021 10:15:14 -0700	[thread overview]
Message-ID: <xmqqo89cqkt9.fsf@gitster.g> (raw)
In-Reply-To: <96e4b388-d924-e5a9-b23f-07cc0007c328@gmail.com> (Bagas Sanjaya's message of "Wed, 1 Sep 2021 18:31:26 +0700")

Bagas Sanjaya <bagasdotme@gmail.com> writes:

> If we make $(INSTALL_OPTS) applies to both compiled executables and
> scripts, we have problem that $(INSTALL) -s only works for the former.

Then don't make it apply to both ;-)

Isn't that what your patch did for early part of the install target?
$(PROGRAMS) are installed with $(INSTALL_OPTS) while the invocation
of $(INSTALL) for $(SCRIPTS) lack $(INSTALL_OPTS).

If we were to pursue this further, it probably is a good idea to
rename the $(INSTALL_OPTS) to $(INSTALL_STRIP) to avoid complaints
by confused users.

Something like this squashed into your patch, perhaps.

 Makefile | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git c/Makefile w/Makefile
index 28d1e9bfae..ebef4da50c 100644
--- c/Makefile
+++ w/Makefile
@@ -465,6 +465,9 @@ all::
 # the global variable _wpgmptr containing the absolute path of the current
 # executable (this is the case on Windows).
 #
+# INSTALL_STRIP can be set to "-s" to strip binaries during installation,
+# if your $(INSTALL) command supports the option.
+#
 # Define GENERATE_COMPILATION_DATABASE to "yes" to generate JSON compilation
 # database entries during compilation if your compiler supports it, using the
 # `-MJ` flag. The JSON entries will be placed in the `compile_commands/`
@@ -3014,19 +3017,15 @@ profile-install: profile
 profile-fast-install: profile-fast
 	$(MAKE) install
 
-INSTALL_OPTS =
-
-.PHONY: install-stripped
-
-install-stripped: INSTALL_OPTS = -s --strip-program=$(STRIP)
+INSTALL_STRIP =
 
-install-stripped install: all
+install: all
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
-	$(INSTALL) $(INSTALL_OPTS) $(PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
+	$(INSTALL) $(INSTALL_STRIP) $(PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
 	$(INSTALL) $(SCRIPTS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
 	$(INSTALL) -m 644 $(SCRIPT_LIB) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
-	$(INSTALL) $(INSTALL_OPTS) $(install_bindir_xprograms) '$(DESTDIR_SQ)$(bindir_SQ)'
+	$(INSTALL) $(INSTALL_STRIP) $(install_bindir_xprograms) '$(DESTDIR_SQ)$(bindir_SQ)'
 	$(INSTALL) $(BINDIR_PROGRAMS_NO_X) '$(DESTDIR_SQ)$(bindir_SQ)'
 
 ifdef MSVC


      reply	other threads:[~2021-09-01 17:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31  1:32 [PATCH RESEND v2] make: add install-stripped target Bagas Sanjaya
2021-08-31 17:06 ` Junio C Hamano
2021-09-01 11:31   ` Bagas Sanjaya
2021-09-01 17:15     ` Junio C Hamano [this message]

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=xmqqo89cqkt9.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=bagasdotme@gmail.com \
    --cc=congdanhqx@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sunshine@sunshineco.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.