# HG changeset patch # User "Yann E. MORIN" # Date 1313787228 -7200 # Node ID d9c5b3b758648efed6bd761bac1b019ba64e45cc # Parent 628192dbf847e7ac04d637bcfce2d6d981a3e5fa Makefile: introduce PROG_NAME to contain the 'ct-ng' executable name With the upcomming --program-{prefix,suffix,transform-name} options, we'll have a need to centralise the actual executable name, that is now no longer be a constant. Rather than spread the prefix/suffix through-out the code, just centralise the name setting in one place. Beside, transform-name would not be possible without setting the name at a single location. Signed-off-by: "Yann E. MORIN" diff -r 628192dbf847 -r d9c5b3b75864 Makefile.in --- a/Makefile.in Wed Aug 17 22:23:21 2011 +0200 +++ b/Makefile.in Fri Aug 19 22:53:48 2011 +0200 @@ -66,6 +66,8 @@ MAN_SECTION := 1 MAN_SUBDIR := /man$(MAN_SECTION) +PROG_NAME := ct-ng + ############################################################################### # Sanity checks @@ -126,16 +128,16 @@ #-------------------------------------- # Build rules -build-bin: ct-ng scripts/crosstool-NG.sh scripts/saveSample.sh scripts/showTuple.sh +build-bin: $(PROG_NAME) scripts/crosstool-NG.sh scripts/saveSample.sh scripts/showTuple.sh @chmod 755 $^ build-lib: paths.mk config/configure.in build-doc: -build-man: docs/ct-ng.1.gz +build-man: docs/$(PROG_NAME).1.gz -docs/ct-ng.1.gz: docs/ct-ng.1 +docs/$(PROG_NAME).1.gz: docs/$(PROG_NAME).1 @echo " GZIP '$@'" @gzip -c9 $< >$@ @@ -190,8 +192,8 @@ # Clean rules clean-bin: - @echo " RM 'ct-ng'" - @rm -f ct-ng + @echo " RM '$(PROG_NAME)'" + @rm -f $(PROG_NAME) @echo " RM 'scripts/crosstool-NG.sh'" @rm -f scripts/crosstool-NG.sh @echo " RM 'scripts/saveSample.sh'" @@ -208,10 +210,10 @@ clean-doc: clean-man: - @echo " RM 'docs/ct-ng.1'" - @rm -f docs/ct-ng.1 - @echo " RM 'docs/ct-ng.1.gz'" - @rm -f docs/ct-ng.1.gz + @echo " RM 'docs/$(PROG_NAME).1'" + @rm -f docs/$(PROG_NAME).1 + @echo " RM 'docs/$(PROG_NAME).1.gz'" + @rm -f docs/$(PROG_NAME).1.gz #-------------------------------------- # Check for --local setup @@ -232,8 +234,8 @@ real-install: $(patsubst %,install-%,$(TARGETS)) install-post install-bin: $(DESTDIR)$(BINDIR) - @echo " INST 'ct-ng'" - @$(install) -m 755 ct-ng "$(DESTDIR)$(BINDIR)/ct-ng" + @echo " INST '$(PROG_NAME)'" + @$(install) -m 755 $(PROG_NAME) "$(DESTDIR)$(BINDIR)/$(PROG_NAME)" # If one is hacking crosstool-NG, the patch set might change between any two # installations of the same VERSION, thus the patches must be removed prior @@ -289,8 +291,8 @@ done install-man: $(DESTDIR)$(MANDIR)$(MAN_SUBDIR) - @echo " INST 'ct-ng.1.gz'" - @$(install) -m 644 docs/ct-ng.1.gz "$(DESTDIR)$(MANDIR)$(MAN_SUBDIR)" + @echo " INST '$(PROG_NAME).1.gz'" + @$(install) -m 644 docs/$(PROG_NAME).1.gz "$(DESTDIR)$(MANDIR)$(MAN_SUBDIR)" $(sort $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(DOCDIR) $(DESTDIR)$(MANDIR)$(MAN_SUBDIR)): @echo " MKDIR '$@/'" @@ -298,7 +300,7 @@ install-post: @echo - @echo "For auto-completion, do not forget to install 'ct-ng.comp' into" + @echo "For auto-completion, do not forget to install '$(PROG_NAME).comp' into" @echo "your bash completion directory (usually /etc/bash_completion.d)" #-------------------------------------- @@ -307,8 +309,8 @@ real-uninstall: $(patsubst %,uninstall-%,$(TARGETS)) uninstall-bin: - @echo " RM '$(DESTDIR)$(BINDIR)/ct-ng'" - @rm -f "$(DESTDIR)$(BINDIR)/ct-ng" + @echo " RM '$(DESTDIR)$(BINDIR)/$(PROG_NAME)'" + @rm -f "$(DESTDIR)$(BINDIR)/$(PROG_NAME)" uninstall-lib: @echo " RMDIR '$(DESTDIR)$(LIBDIR)/'" @@ -319,8 +321,8 @@ @rm -rf "$(DESTDIR)$(DOCDIR)" uninstall-man: - @echo " RM '$(DESTDIR)$(MANDIR)$(MAN_SUBDIR)/ct-ng.1.gz'" - @rm -f "$(DESTDIR)$(MANDIR)$(MAN_SUBDIR)/ct-ng.1"{,.gz} + @echo " RM '$(DESTDIR)$(MANDIR)$(MAN_SUBDIR)/$(PROG_NAME).1.gz'" + @rm -f "$(DESTDIR)$(MANDIR)$(MAN_SUBDIR)/$(PROG_NAME).1"{,.gz} endif # Not --local