* [PATCH] Makefile: Split INSTALL out into INSTALL_{PROGRAM,LIB,DATA,SCRIPT} @ 2018-01-04 3:49 kevans-HZy0K5TPuP5AfugRpC6u6w [not found] ` <20180104034923.2919-1-kevans-HZy0K5TPuP5AfugRpC6u6w@public.gmane.org> 0 siblings, 1 reply; 2+ messages in thread From: kevans-HZy0K5TPuP5AfugRpC6u6w @ 2018-01-04 3:49 UTC (permalink / raw) To: David Gibson, Jon Loeliger Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA, Kyle Evans For adoption into systems that may have additional arguments to be passed into install(1) upon install, split out INSTALL into the different types of files to be installed and use them appropriately. This allows, for instance, passing -s to strip binaries and libs while not botching directory installs or data/script installations. Signed-off-by: Kyle Evans <kevans-HZy0K5TPuP5AfugRpC6u6w@public.gmane.org> --- Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9ba8121..5f1c274 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,10 @@ SWIG = swig PKG_CONFIG ?= pkg-config INSTALL = /usr/bin/install +INSTALL_PROGRAM = $(INSTALL) +INSTALL_LIB = $(INSTALL) +INSTALL_DATA = $(INSTALL) -m 644 +INSTALL_SCRIPT = $(INSTALL) DESTDIR = PREFIX = $(HOME) BINDIR = $(PREFIX)/bin @@ -191,20 +195,21 @@ endif install-bin: all $(SCRIPTS) @$(VECHO) INSTALL-BIN $(INSTALL) -d $(DESTDIR)$(BINDIR) - $(INSTALL) $(BIN) $(SCRIPTS) $(DESTDIR)$(BINDIR) + $(INSTALL_PROGRAM) $(BIN) $(DESTDIR)$(BINDIR) + $(INSTALL_SCRIPT) $(SCRIPTS) $(DESTDIR)$(BINDIR) install-lib: all @$(VECHO) INSTALL-LIB $(INSTALL) -d $(DESTDIR)$(LIBDIR) - $(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR) + $(INSTALL_LIB) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR) ln -sf $(notdir $(LIBFDT_lib)) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname) ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/libfdt.$(SHAREDLIB_EXT) - $(INSTALL) -m 644 $(LIBFDT_archive) $(DESTDIR)$(LIBDIR) + $(INSTALL_DATA) $(LIBFDT_archive) $(DESTDIR)$(LIBDIR) install-includes: @$(VECHO) INSTALL-INC $(INSTALL) -d $(DESTDIR)$(INCLUDEDIR) - $(INSTALL) -m 644 $(LIBFDT_include) $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_DATA) $(LIBFDT_include) $(DESTDIR)$(INCLUDEDIR) install: install-bin install-lib install-includes -- 2.15.1 ^ permalink raw reply related [flat|nested] 2+ messages in thread
[parent not found: <20180104034923.2919-1-kevans-HZy0K5TPuP5AfugRpC6u6w@public.gmane.org>]
* Re: [PATCH] Makefile: Split INSTALL out into INSTALL_{PROGRAM,LIB,DATA,SCRIPT} [not found] ` <20180104034923.2919-1-kevans-HZy0K5TPuP5AfugRpC6u6w@public.gmane.org> @ 2018-01-04 7:25 ` David Gibson 0 siblings, 0 replies; 2+ messages in thread From: David Gibson @ 2018-01-04 7:25 UTC (permalink / raw) To: kevans-HZy0K5TPuP5AfugRpC6u6w Cc: Jon Loeliger, devicetree-compiler-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 2276 bytes --] On Wed, Jan 03, 2018 at 09:49:23PM -0600, kevans-HZy0K5TPuP5AfugRpC6u6w@public.gmane.org wrote: > For adoption into systems that may have additional arguments to be passed into > install(1) upon install, split out INSTALL into the different types of files to > be installed and use them appropriately. This allows, for instance, passing -s > to strip binaries and libs while not botching directory installs or data/script > installations. > > Signed-off-by: Kyle Evans <kevans-HZy0K5TPuP5AfugRpC6u6w@public.gmane.org> Applied, thanks. > --- > Makefile | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/Makefile b/Makefile > index 9ba8121..5f1c274 100644 > --- a/Makefile > +++ b/Makefile > @@ -26,6 +26,10 @@ SWIG = swig > PKG_CONFIG ?= pkg-config > > INSTALL = /usr/bin/install > +INSTALL_PROGRAM = $(INSTALL) > +INSTALL_LIB = $(INSTALL) > +INSTALL_DATA = $(INSTALL) -m 644 > +INSTALL_SCRIPT = $(INSTALL) > DESTDIR = > PREFIX = $(HOME) > BINDIR = $(PREFIX)/bin > @@ -191,20 +195,21 @@ endif > install-bin: all $(SCRIPTS) > @$(VECHO) INSTALL-BIN > $(INSTALL) -d $(DESTDIR)$(BINDIR) > - $(INSTALL) $(BIN) $(SCRIPTS) $(DESTDIR)$(BINDIR) > + $(INSTALL_PROGRAM) $(BIN) $(DESTDIR)$(BINDIR) > + $(INSTALL_SCRIPT) $(SCRIPTS) $(DESTDIR)$(BINDIR) > > install-lib: all > @$(VECHO) INSTALL-LIB > $(INSTALL) -d $(DESTDIR)$(LIBDIR) > - $(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR) > + $(INSTALL_LIB) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR) > ln -sf $(notdir $(LIBFDT_lib)) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname) > ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/libfdt.$(SHAREDLIB_EXT) > - $(INSTALL) -m 644 $(LIBFDT_archive) $(DESTDIR)$(LIBDIR) > + $(INSTALL_DATA) $(LIBFDT_archive) $(DESTDIR)$(LIBDIR) > > install-includes: > @$(VECHO) INSTALL-INC > $(INSTALL) -d $(DESTDIR)$(INCLUDEDIR) > - $(INSTALL) -m 644 $(LIBFDT_include) $(DESTDIR)$(INCLUDEDIR) > + $(INSTALL_DATA) $(LIBFDT_include) $(DESTDIR)$(INCLUDEDIR) > > install: install-bin install-lib install-includes > -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-04 7:25 UTC | newest] Thread overview: 2+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-01-04 3:49 [PATCH] Makefile: Split INSTALL out into INSTALL_{PROGRAM,LIB,DATA,SCRIPT} kevans-HZy0K5TPuP5AfugRpC6u6w [not found] ` <20180104034923.2919-1-kevans-HZy0K5TPuP5AfugRpC6u6w@public.gmane.org> 2018-01-04 7:25 ` David Gibson
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).