diff Makefile.in.in @ 3062:21d92abaac3a

[xemacs-hg @ 2005-11-13 10:39:28 by ben] fix up clean targets to delete .elc's as necessary dynodump/Makefile.in.in: Add targets distclean-noconfig, realclean-noconfig, extraclean-noconfig. Do some refactoring for cleanliness. Makefile.in.in: Add targets distclean-noconfig, realclean-noconfig, extraclean-noconfig. *-noconfig targets are like the base targets they're based off of, but don't delete Makefiles and certain other files needed to rebuild the Makefiles as necessary. Refactor things to be more consistent. Top-level `elcclean' is an alias for `realclean-noconfig' and is used by target `beta'. `realclean-noconfig' (and, by extension, `realclean' and `extraclean') remove the .elc files. Makefile.in.in: Add targets distclean-noconfig, realclean-noconfig, extraclean-noconfig. Do some refactoring for cleanliness. Makefile.in.in: Add targets distclean-noconfig, realclean-noconfig, extraclean-noconfig. Do some refactoring for cleanliness. Makefile.in.in: Add targets distclean-noconfig, realclean-noconfig, extraclean-noconfig. Do some refactoring for cleanliness. Makefile.in.in: Add targets distclean-noconfig, realclean-noconfig, extraclean-noconfig. Do some refactoring for cleanliness. Makefile: Add targets distclean-noconfig, realclean-noconfig, extraclean-noconfig. Do some refactoring for cleanliness. common/Makefile.common: Add targets distclean-noconfig, realclean-noconfig, extraclean-noconfig. Do some refactoring for cleanliness. Put in some magic cookies in comments so this file gets read as a make file by XEmacs.
author ben
date Sun, 13 Nov 2005 10:39:41 +0000
parents 414a64af46c9
children 0f411920c8db
line wrap: on
line diff
--- a/Makefile.in.in	Sun Nov 13 07:39:29 2005 +0000
+++ b/Makefile.in.in	Sun Nov 13 10:39:41 2005 +0000
@@ -1,4 +1,4 @@
-## Copyright (C) 2003 Ben Wing.
+## Copyright (C) 2003, 2005 Ben Wing.
 
 ## DIST: This is the distribution Makefile for XEmacs.  configure can
 ## DIST: make most of the changes to this file you might want, so try
@@ -217,9 +217,9 @@
 
 ## ============================= Targets ==============================
 
-## Subdirectories to make recursively.  `lisp' is not included
-## because the compiled lisp files are part of the distribution
-## and you cannot remake them without installing XEmacs first.
+## Subdirectories to make recursively.  `lisp' is not included currently;
+## rebuilding the compiled lisp files is done in the `src' make and requires
+## building XEmacs first.
 MAKE_SUBDIR = @MAKE_SUBDIR@
 
 ## Subdirectories that can be made recursively.
@@ -252,7 +252,7 @@
 .PHONY: ${SUBDIR} all beta
 
 ## Convenience target for XEmacs beta testers
-beta: clean all
+beta: elcclean all
 
 ## Convenience target for XEmacs maintainers
 ## This would run `make-xemacsdist' if I were really confident that everything
@@ -515,20 +515,26 @@
 ## Some makes seem to remember that they've built something called FRC,
 ## so you can only use a given FRC once per makefile.
 FRC FRC.src.paths.h FRC.mkdir FRC.dump-elcs FRC.info:
-FRC.mostlyclean FRC.clean FRC.distclean FRC.realclean FRC.tags:
+FRC.mostlyclean FRC.clean FRC.distclean FRC.realclean FRC.extraclean FRC.tags:
+FRC.distclean-noconfig FRC.realclean-noconfig FRC.extraclean-noconfig:
 
 ## ==================== Cleaning up and miscellanea ====================
 
-.PHONY: mostlyclean clean distclean realclean extraclean
+.PHONY: mostlyclean clean distclean realclean extraclean elcclean
+.PHONY: distclean-noconfig realclean-noconfig extraclean-noconfig
+.PHONY: top-mostlyclean top-clean top-distclean top-realclean top-extraclean
+.PHONY: top-distclean-noconfig top-realclean-noconfig top-extraclean-noconfig
 
 ## `mostlyclean'
 ##      Like `clean', but may refrain from deleting a few files that people
 ##      normally don't want to recompile.  For example, the `mostlyclean'
 ##      target for GCC does not delete `libgcc.a', because recompiling it
 ##      is rarely necessary and takes a lot of time.
-mostlyclean: FRC.mostlyclean
+top-mostlyclean: FRC.mostlyclean
+	$(RM) core
+
+mostlyclean: top-mostlyclean
 	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
-	$(RM) core
 
 ## `clean'
 ##      Delete all files from the current directory that are normally
@@ -542,27 +548,49 @@
 ##      Remove the generated load files here; they cause lots of problems
 ##      when they don't work right.  (beta can't depend on distclean, which
 ##      removes necessary files generated by configure.)
-clean: FRC.clean
-	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
+top-clean: FRC.clean
 	$(RM) core lisp/auto-autoloads.el* lisp/custom-load.el*
 	$(RM) lisp/mule/auto-autoloads.el* lisp/mule/custom-load.el*
 	$(RM) modules/auto-autoloads.el* modules/custom-load.el*
 
+clean: top-mostlyclean top-clean
+	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
+
+## `distclean-noconfig'
+##      Like `distclean' but don't delete files created by `configure'.
+top-distclean-noconfig: FRC.distclean-noconfig
+	$(RM) TAGS .sbinit lock/* lisp/finder-inf.el*
+	$(RM) -r site-packages xemacs-packages mule-packages site-lisp
+
+distclean-noconfig: top-mostlyclean top-clean top-distclean-noconfig
+	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
+
 ## `distclean'
 ##      Delete all files from the current directory that are created by
 ##      configuring or building the program.  If you have unpacked the
 ##      source and built the program without creating any other files,
 ##      `make distclean' should leave only the files that were in the
 ##      distribution.
-top_distclean=\
-	$(RM) config.status config.log confdefs.h config-tmp-* build-install Installation ; \
-	$(RM) TAGS .sbinit lock/* GNUmakefile Makefile Makefile.in ; \
-	$(RM) lisp/finder-inf.el* Installation.el Installation.elc ; \
-	$(RM) -r site-packages xemacs-packages mule-packages site-lisp
+top-distclean: FRC.distclean
+	$(RM) config.status config.log confdefs.h config-tmp-* build-install Installation
+	$(RM) GNUmakefile Makefile Makefile.in
+	$(RM) Installation.el Installation.elc
+
+distclean: top-mostlyclean top-clean top-distclean-noconfig top-distclean
+	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
 
-distclean: FRC.distclean
+## `realclean-noconfig'
+##      Delete everything that can be reconstructed by `make'.  Don't delete
+##	anything requiring reconfiguration.
+top-realclean-noconfig: FRC.realclean-noconfig
+	$(RM) *.elc lisp/*.elc lisp/mule/*.elc lisp/term/*.elc modules/*.elc
+
+realclean-noconfig: top-mostlyclean top-clean top-distclean-noconfig top-realclean-noconfig
 	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
-	-${top_distclean}
+
+top-realclean: FRC.realclean
+
+elcclean: realclean-noconfig
 
 ## `realclean'
 ##      Delete everything from the current directory that can be
@@ -575,19 +603,25 @@
 ##      Makefile.  More generally, `make realclean' should not delete
 ##      anything that needs to exist in order to run `configure' and then
 ##      begin to build the program.
-realclean: FRC.realclean
+realclean: top-mostlyclean top-clean top-distclean-noconfig top-distclean top-realclean-noconfig top-realclean
 	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
-	-${top_distclean}
-	$(RM) TAGS
+
+## `extraclean-noconfig'
+##      Like `extraclean' but don't delete anything requiring reconfiguration.
+top-extraclean-noconfig: FRC.extraclean-noconfig
+	$(RM) *~ \#*
+
+extraclean-noconfig: top-mostlyclean top-clean top-distclean-noconfig top-realclean-noconfig top-extraclean-noconfig
+	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
 
 ## This doesn't actually appear in the coding standards, but Karl
 ## says GCC supports it, and that's where the configuration part of
 ## the coding standards seem to come from.  It's like distclean, but
 ## it deletes backup and autosave files too.
-extraclean:
+top-extraclean: FRC.extraclean
+
+extraclean: top-mostlyclean top-clean top-distclean-noconfig top-distclean top-realclean-noconfig top-realclean top-extraclean-noconfig top-extraclean
 	for d in $(SUBDIR); do (cd ./$$d && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@); done
-	$(RM) *~ \#*
-	-${top_distclean}
 
 ## Unlocking and relocking.  The idea of these productions is to reduce
 ## hassles when installing an incremental tar of XEmacs.  Do `make unlock'