Re-instate a functionnal --local test.

Introduce a TARGETS make variable that contains sub-parts to {build,install,clean,uninstall}
Small fix to directories creation.

 /trunk/Makefile.in |   28    19     9     0 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)
This commit is contained in:
Yann E. MORIN" 2008-06-11 22:18:06 +00:00
parent 62df5c3fed
commit d4dae52465

View File

@ -25,17 +25,19 @@ MAKE := $(shell which $(MAKE) || type -p $(MAKE) || echo /usr/bin/make)
############################################################################### ###############################################################################
# Global make rules # Global make rules
build: build-bin build-lib build-man TARGETS := bin lib doc man
install: build install-bin install-lib install-doc install-man build: $(patsubst %,build-%,$(TARGETS))
clean: clean-bin clean-lib clean-doc install: local-test build $(patsubst %,install-%,$(TARGETS))
clean: $(patsubst %,clean-%,$(TARGETS))
distclean: clean distclean: clean
@echo " RM 'Makefile'" @echo " RM 'Makefile'"
@rm -f Makefile @rm -f Makefile
uninstall: uninstall-bin uninstall-lib uninstall-doc uninstall-man uninstall: local-test $(patsubst %,uninstall-%,$(TARGETS))
############################################################################### ###############################################################################
# Specific make rules # Specific make rules
@ -49,6 +51,8 @@ build-bin: ct-ng
build-lib: build-lib:
build-doc:
build-man: docs/ct-ng.1.gz build-man: docs/ct-ng.1.gz
docs/ct-ng.1.gz: docs/ct-ng.1 docs/ct-ng.1.gz: docs/ct-ng.1
@ -76,6 +80,8 @@ clean-bin:
clean-lib: clean-lib:
clean-doc: clean-doc:
clean-man:
@echo " RM 'docs/ct-ng.1'" @echo " RM 'docs/ct-ng.1'"
@rm -f docs/ct-ng.1 @rm -f docs/ct-ng.1
@echo " RM 'docs/ct-ng.1.gz'" @echo " RM 'docs/ct-ng.1.gz'"
@ -94,12 +100,14 @@ local-test:
#-------------------------------------- #--------------------------------------
# Install rules # Install rules
install-%: local-test
install-bin: $(BINDIR) install-bin: $(BINDIR)
@echo " INST 'ct-ng'" @echo " INST 'ct-ng'"
@install -m 755 ct-ng "$(BINDIR)/ct-ng" @install -m 755 ct-ng "$(BINDIR)/ct-ng"
# 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
# to being installed. It is simpler to remove the whole lib/ directory, as it
# is the goal of the install-lib rule to install the lib/ directory...
install-lib: uninstall-lib $(LIBDIR) install-lib-main install-lib-samples install-lib: uninstall-lib $(LIBDIR) install-lib-main install-lib-samples
install-lib-main: $(LIBDIR) install-lib-main: $(LIBDIR)
@ -130,7 +138,7 @@ install-man: $(MANDIR)
@echo " INST 'ct-ng.1.gz'" @echo " INST 'ct-ng.1.gz'"
@install -m 644 docs/ct-ng.1.gz "$(MANDIR)" @install -m 644 docs/ct-ng.1.gz "$(MANDIR)"
$(BINDIR) $(LIBDIR) $(DOCDIR) $(MANDIR):: $(BINDIR) $(LIBDIR) $(DOCDIR) $(MANDIR):
@echo " MKDIR '$@'" @echo " MKDIR '$@'"
@install -m 755 -d "$@" @install -m 755 -d "$@"
@ -138,16 +146,18 @@ $(BINDIR) $(LIBDIR) $(DOCDIR) $(MANDIR)::
#-------------------------------------- #--------------------------------------
# Uninstall rules # Uninstall rules
uninstall-%: local-test
uninstall-bin: uninstall-bin:
@echo " RM '$(BINDIR)/ct-ng'"
@rm -f "$(BINDIR)/ct-ng" @rm -f "$(BINDIR)/ct-ng"
uninstall-lib: uninstall-lib:
@echo " RM '$(LIBDIR)/'"
@rm -rf "$(LIBDIR)" @rm -rf "$(LIBDIR)"
uninstall-doc: uninstall-doc:
@echo " RM '$(DOCDIR)/'"
@rm -rf "$(DOCDIR)" @rm -rf "$(DOCDIR)"
uninstall-man: uninstall-man:
@echo " RM '$(MANDIR)/ct-ng.1.gz'"
@rm -f "$(MANDIR)/ct-ng.1"{,.gz} @rm -f "$(MANDIR)/ct-ng.1"{,.gz}