From 29e68b75843aa889a15ca8dcfff1cd30fea9e963 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 26 Jul 1999 21:26:44 +0000 Subject: Patch from Ralf Corsepius : This patch is an addition to "The big-patch" CHANGES: * FIX: c/Makefile.am: bogus comment which changed the behavior of c/Makefile.am removed * FIX: make/custom/ts_i386ex.cfg did not set HAS_NETWORKING correctly (Me thinks it might have been me who added this bogus setting :-). * NEW: removing make targets get, protos, debug_install, profile_install * NEW: replacing clobber with distclean * NEW: Reimplement distclean and clean as reverse depth first make targets (adaptation to automake's behavior) * NEW: removing RCS_CLEAN from make distclean (tools/build/rcs_clean is still in - remove it?) * NEW: "$(RM) Makefile" added to make distclean (adaptation to automake's behavior) * NEW: "$(RM) config.cache config.log" to CLOBBER_ADDITIONS in [lib|exec|tests]/Makefile.in (adaptation to automake's behavior) * NEW: "$(CLEAN_PROTOS)" removed (Not used anywhere) * NEW: binpatch.c moved from i386 bsp tools to tools/build (AFAIS, binpatch is not specific to the pc386 BSP at all) * NEW: AC_EXEEXT added to all configure scripts which contain AC_PROG_CC (Cygwin support) * NEW/Experimental: An experimental implementation of temporary installation tree support in libbsp/i386/pc386/tools/Makefile.am, based on dependency tracking with make, instead of applying INSTALL_CHANGE. REMARK: * This patch is small in size, but changes the behavior of "make clean|distclean|clobber" basically. * This patch does not alter building/compiling RTEMS, ie. there should be no need to rerun all "make all" building tests. KNOWN BUGS: * make RTEMS_BSP="..." distclean in c/ runs "make distclean" in BSPs subdirectories passed through RTEMS_BSP and in "c/." only, but does not descend into other BSP subdirectories previously configured with different settings of make RTEMS_BSP="...". => Workaround: always use the same setting of RTEMS_BSP when working inside the build-tree. * "make [distclean|clean]" do not clean subdirectories, which have been configured at configuration time, but which are not used due to make-time configuration (e.g. macros/networking/rdgb subdirectories). This will problem will vanish by itself when migrating from make-time to configuration-time configuration APPLYING THE PATCH mv c/src/lib/libbsp/i386/pc386/tools/binpatch.c tools/build patch -p1 < rtems-rc-19990709-2.diff autogen --- c/src/make/Makefile.in | 26 +------------------------- c/src/make/README | 9 +++------ c/src/make/Templates/Makefile.in | 12 ------------ c/src/make/compilers/Makefile.in | 12 ------------ c/src/make/custom/Makefile.in | 12 ------------ c/src/make/directory.cfg | 35 +++++++++++++++++++++++++++++++++++ c/src/make/main.cfg.in | 17 +++++++++++++---- 7 files changed, 52 insertions(+), 71 deletions(-) (limited to 'c/src/make') diff --git a/c/src/make/Makefile.in b/c/src/make/Makefile.in index 4b777d98ad..5a7281b61c 100644 --- a/c/src/make/Makefile.in +++ b/c/src/make/Makefile.in @@ -460,12 +460,9 @@ maintainer-clean-generic clean mostlyclean distclean maintainer-clean @MAINTAINER_MODE_TRUE@ cp $< $@ depend-recursive \ -clobber-recursive \ preinstall-recursive \ debug-recursive \ -debug_install-recursive \ -profile-recursive \ -profile_install-recursive: +profile-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ @@ -487,21 +484,12 @@ profile_install-recursive: debug: debug-recursive .PHONY: debug-recursive -debug_install: debug_install-recursive -.PHONY: debug_install-recursive - profile: profile-recursive .PHONY: profile-recursive -profile_install: profile_install-recursive -.PHONY: profile-recursive - preinstall: preinstall-recursive .PHONY: preinstall-recursive -clobber: clobber-recursive -.PHONY: clobber-recursive - depend: depend-recursive .PHONY: depend-recursive @@ -509,26 +497,14 @@ debug-am: debug: debug-am .PHONY: debug debug-am -debug_install-am: -debug_install: debug_install-am -.PHONY: debug_install debug_install-am - profile-am: profile: profile-am .PHONY: profile profile-am -profile_install-am: -profile_install: profile_install-am -.PHONY: profile_install profile_install-am - preinstall-am: preinstall: preinstall-am .PHONY: preinstall preinstall-am -clobber-am: -clobber: clobber-am -.PHONY: clobber clobber-am - depend-am: depend: depend-am .PHONY: depend depend-am diff --git a/c/src/make/README b/c/src/make/README index 6cdc4b2c6e..fbc4ba5cca 100644 --- a/c/src/make/README +++ b/c/src/make/README @@ -116,17 +116,14 @@ CFLAGS and/or LDFLAGS are modified as per the compiler config file for debug and profile support. - Targets debug_install and profile_install are equivalent to 'make - install' except that debug (or profile) variants are built and - installed. - - The targets debug, profile, debug_install, profile_install, etc., can be + The targets debug, profile, etc., can be invoked recursively at the directory make level. So from the top of a tree, one could install a debug version of everything under that point by: $ cd src/lib - $ gmake debug_install + $ gmake debug + $ gmake install When building a command that is linked with a generated library, the appropriate version of the library will be linked in. diff --git a/c/src/make/Templates/Makefile.in b/c/src/make/Templates/Makefile.in index b620949339..ec4947ac00 100644 --- a/c/src/make/Templates/Makefile.in +++ b/c/src/make/Templates/Makefile.in @@ -257,26 +257,14 @@ debug-am: debug: debug-am .PHONY: debug debug-am -debug_install-am: -debug_install: debug_install-am -.PHONY: debug_install debug_install-am - profile-am: profile: profile-am .PHONY: profile profile-am -profile_install-am: -profile_install: profile_install-am -.PHONY: profile_install profile_install-am - preinstall-am: preinstall: preinstall-am .PHONY: preinstall preinstall-am -clobber-am: -clobber: clobber-am -.PHONY: clobber clobber-am - depend-am: depend: depend-am .PHONY: depend depend-am diff --git a/c/src/make/compilers/Makefile.in b/c/src/make/compilers/Makefile.in index e802f333c9..013dcb26fe 100644 --- a/c/src/make/compilers/Makefile.in +++ b/c/src/make/compilers/Makefile.in @@ -264,26 +264,14 @@ debug-am: debug: debug-am .PHONY: debug debug-am -debug_install-am: -debug_install: debug_install-am -.PHONY: debug_install debug_install-am - profile-am: profile: profile-am .PHONY: profile profile-am -profile_install-am: -profile_install: profile_install-am -.PHONY: profile_install profile_install-am - preinstall-am: preinstall: preinstall-am .PHONY: preinstall preinstall-am -clobber-am: -clobber: clobber-am -.PHONY: clobber clobber-am - depend-am: depend: depend-am .PHONY: depend depend-am diff --git a/c/src/make/custom/Makefile.in b/c/src/make/custom/Makefile.in index ce9154d19c..b005b3bd51 100644 --- a/c/src/make/custom/Makefile.in +++ b/c/src/make/custom/Makefile.in @@ -262,26 +262,14 @@ debug-am: debug: debug-am .PHONY: debug debug-am -debug_install-am: -debug_install: debug_install-am -.PHONY: debug_install debug_install-am - profile-am: profile: profile-am .PHONY: profile profile-am -profile_install-am: -profile_install: profile_install-am -.PHONY: profile_install profile_install-am - preinstall-am: preinstall: preinstall-am .PHONY: preinstall preinstall-am -clobber-am: -clobber: clobber-am -.PHONY: clobber clobber-am - depend-am: depend: depend-am .PHONY: depend depend-am diff --git a/c/src/make/directory.cfg b/c/src/make/directory.cfg index 056e9fa55e..c3efc38bf0 100644 --- a/c/src/make/directory.cfg +++ b/c/src/make/directory.cfg @@ -21,5 +21,40 @@ $(RECURSE_TARGETS): || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" + +# mostlyclean-recursive maintainer-clean-recursive: +clean-recursive \ +distclean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUB_DIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" + +clean-am: clean-generic +distclean-am: distclean-generic clean-am + preinstall: preinstall-recursive .PHONY: preinstall preinstall-am preinstall-recursive + +distclean: distclean-recursive + -$(RM) config.status + +.PHONY: distclean distclean-am distclean-recursive + +clean: clean-recursive +.PHONY: clean clean-am clean-recursive + diff --git a/c/src/make/main.cfg.in b/c/src/make/main.cfg.in index e0af9ab95a..7a1082fb13 100644 --- a/c/src/make/main.cfg.in +++ b/c/src/make/main.cfg.in @@ -57,17 +57,26 @@ VARIANTS=${TARGET_ARCH} ${TARGET_VARIANTS:%=${TARGET_ARCH}-%} # List of "recursion-able" targets for directory Makefiles # -RECURSE_TARGETS=all clean protos get clobber depend install \ +RECURSE_TARGETS=all depend install \ preinstall-recursive \ -$(TARGET_VARIANTS) $(TARGET_VARIANTS:%=%_install) +$(TARGET_VARIANTS) ${ARCH}: test -d ${ARCH} || mkdir ${ARCH} - # general purpose forcing dependency; try to use .PHONY instead FORCEIT: FORCE: -.PHONY: $(RECURSE_TARGETS) +distclean-generic: + -$(RM) Makefile .#* $(CONFIG_CLEAN_FILES) + -$(RM) -r $(CLOBBER_ADDITIONS) + +clean-generic: + -$(RM) a.out core mon.out gmon.out + -$(RM) -r $(CLEAN_ADDITIONS) + +.PHONY: $(RECURSE_TARGETS) +.PHONY: clean-generic +.PHONY: distclean-generic -- cgit v1.2.3