Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- Makefile | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index f0f7a5b69..a418bf897 100644 --- a/Makefile +++ b/Makefile @@ -167,31 +167,11 @@ QUIET_LINK = $(Q:@=@echo ' LINK '$@;) QUIET_INST_SH = $(Q:@=echo -n ' INSTALL ';) QUIET_INST = $(Q:@=@echo -n ' INSTALL ';) -define INSTALL_EXEC - $(QUIET_INST)install -v $1 $(DESTDIR)$2/$1 || exit 1; - -endef - -define INSTALL_FILE - $(QUIET_INST)install -v -m 644 $1 $(DESTDIR)$2/$1 || exit 1; - -endef - +compile_OBJS := compile-i386.o all: $(PROGRAMS) -all-installable: $(INST_PROGRAMS) - -install: all-installable - $(Q)install -d $(DESTDIR)$(BINDIR) - $(Q)install -d $(DESTDIR)$(MAN1DIR) - $(foreach f,$(INST_PROGRAMS),$(call INSTALL_EXEC,$f,$(BINDIR))) - $(foreach f,$(INST_MAN1),$(call INSTALL_FILE,$f,$(MAN1DIR))) - - -compile_OBJS := compile-i386.o - ldflags += $($(@)_LDFLAGS) $(LDFLAGS) ldlibs += $($(@)_LDLIBS) $(LDLIBS) $(foreach p,$(PROGRAMS),$(eval $(p): $($(p)_OBJS))) @@ -237,4 +217,17 @@ clean: FORCE @echo ' CLEAN' @git clean -q -d -x -e .sparse.mk -e '*.[ch]' + +install: $(INST_PROGRAMS) $(INST_MAN1) install-dirs install-bin install-man +install-dirs: + $(Q)install -d $(DESTDIR)$(BINDIR) + $(Q)install -d $(DESTDIR)$(MAN1DIR) +install-bin: $(INST_PROGRAMS:%=$(DESTDIR)$(BINDIR)/%) +install-man: $(INST_MAN1:%=$(DESTDIR)$(MAN1DIR)/%) + +$(DESTDIR)$(BINDIR)/%: % + $(QUIET_INST)install -v $< $@ || exit 1; +$(DESTDIR)$(MAN1DIR)/%: % + $(QUIET_INST)install -v -m 644 $< $@ || exit 1; + .PHONY: FORCE -- 2.14.0 -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html