From 31e98a1224e40043f14976ea580d10102ab372c2 Mon Sep 17 00:00:00 2001 From: "Thomas \"Cakeisalie5\" Touhey" Date: Wed, 21 Dec 2016 23:07:33 +0100 Subject: [PATCH] Corrected some targets. --- Makefile | 25 +++++++++++++++---------- Makefile.vars | 2 ++ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index a9e0685..66f081f 100755 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ clean: clean-bins clean-doc # Clean it entirely mrproper: clean $(call rmsg,Removing configuration.) - $(call rcmd,Makefile.cfg,$(RM) Makefile.cfg) + $(call qcmd,$(RM) Makefile.cfg) # Remake it all re: clean all @@ -111,12 +111,18 @@ $(eval $(call make-binary-rule,$(bin)))) $(call rmsg,Removing binaries.) $(call qcmd,$(RM) $(BINARIES:%=%*)) -# Install binaries - install-bins: all-bins - $(call imsg,Installing binaries.) +# Install a binary +define make-installbinary-rule + install-$1: $(CHECKCFG) $1$(if $(FOR_WINDOWS),.exe) + $(call imsg,Installing $$<.) $(call qcmd,$(INSTALL) -m 755 -d "$(IBINDIR)") - $(call qcmd,$(INSTALL) -m 755 -t "$(IBINDIR)" \ - $(BINARIES:%=%$(if $(FOR_WINDOWS),.exe))) + $(call qcmd,$(INSTALL) -m 755 -t "$(IBINDIR)" $$<) +endef +$(foreach bin,$(BINARIES),\ +$(eval $(call make-installbinary-rule,$(bin)))) + +# Install binaries + install-bins: $(BINARIES:%=install-%) # Uninstall binaries uninstall-bins: $(CHECKCFG) @@ -146,7 +152,7 @@ $(eval $(call make-manpage-rule,$(section)))) # Remove all manpages clean-doc: $(call rmsg,Removing manpages directory.) - $(call rcmd,$(MANDIR),$(RM) -r $(MANDIR)) + $(call qcmd,$(RM) -r $(MANDIR)) # Remake all manpages re-doc: clean-doc all-doc @@ -155,9 +161,8 @@ $(eval $(call make-manpage-rule,$(section)))) define make-installmansection-rule install-doc-$1: $(MAN_$1:%=$(MANDIR)/man$1/%.$1) $(call imsg,Installing manpages section $1.) - $(call qcmd,$(INST) -m 755 -d "$(IMANDIR)/man$1") - $(foreach i,$(MAN_$1),$(call icmd,man$1/$(i).$1)) - $(call qcmd,$(INST) -m 644 -t "$(IMANDIR)/man$1" \ + $(call qcmd,$(INSTALL) -m 755 -d "$(IMANDIR)/man$1") + $(call qcmd,$(INSTALL) -m 644 -t "$(IMANDIR)/man$1" \ $(MAN_$1:%=$(MANDIR)/man$1/%.$1)) $(call qcmd,$(GZIP) $(MAN_$1:%="$(IMANDIR)/man$1/%.$1")) endef diff --git a/Makefile.vars b/Makefile.vars index 207c9ee..f036253 100755 --- a/Makefile.vars +++ b/Makefile.vars @@ -84,6 +84,8 @@ INSTALL := install # Asciidoc A2X := a2x +# Gzipper + GZIP := gzip -f #******************************************************************************# # Binaries and sources #