]> www.ginac.de Git - cln.git/commitdiff
Change "make alls" and "make allo" to recurse into subdirectories.
authorBruno Haible <bruno@clisp.org>
Sat, 23 Feb 2008 18:06:32 +0000 (18:06 +0000)
committerBruno Haible <bruno@clisp.org>
Sat, 23 Feb 2008 18:06:32 +0000 (18:06 +0000)
* src/Makefile.in (alls-local): Renamed from alls.
(allo-local): Renamed from allo.
(SUBDIRS_TARGET_ALL): Renamed from SUBDIRS_TARGET.
(alls, allo): New rules.
(SUBDIRS_TARGET_ALLS, SUBDIRS_TARGET_ALLO): New variables.

ChangeLog
src/Makefile.in

index a2c46e11268b433d6db0966808800d1b43b2febb..223f0c50c697b7cba03703f351a33070caa679b4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-02-23  Bruno Haible  <bruno@clisp.org>
+
+       Change "make alls" and "make allo" to recurse into subdirectories.
+       * src/Makefile.in (alls-local): Renamed from alls.
+       (allo-local): Renamed from allo.
+       (SUBDIRS_TARGET_ALL): Renamed from SUBDIRS_TARGET.
+       (alls, allo): New rules.
+       (SUBDIRS_TARGET_ALLS, SUBDIRS_TARGET_ALLO): New variables.
+
 2007-02-22  Richard B. Kreckel  <kreckel@ginac.de>
 
        * include/cln/integer_io.h (read_integer): Make index args uintC.
index 51fa16756da1ed1088dcdd0eb720f5f1591b4e0f..741bff508bd179391b1f09ffd9da3df82adb84b4 100644 (file)
@@ -103,9 +103,25 @@ SUBDIRS := $(patsubst ${srcdir}/%/.,%,$(wildcard ${srcdir}/${SUBDIR}/*/.))
 #   ii_files/ is created during "make" by SGI C++.
 SUBDIRS := $(filter-out old ./old private ./private CVS %/CVS RCS %/RCS SCCS %/SCCS ii_files ./ii_files,${SUBDIRS})
 
-SUBDIRS_TARGET := $(patsubst %,%.target,${SUBDIRS})
+
+# Rule 'all' must be the first in the file.
+all : _all_
+
+
+# Recurse into subdirectories
+
 SUBDIRS_DIRDEP := $(patsubst %,%.dirdep,${SUBDIRS})
 
+${SUBDIRS_DIRDEP} : %.dirdep :
+
+
+# Target 'all' creates all necessary files for $(SUBDIR) and its subdirectories.
+
+SUBDIRS_TARGET_ALL := $(patsubst %,%.target_all,${SUBDIRS})
+
+${SUBDIRS_TARGET_ALL} : %.target_all : %.dirdep
+       ${MAKE} SUBDIR=$* all
+
 ifeq (${SUBDIR},.)
 ALLFILES_CC := $(notdir $(wildcard ${srcdir}/*.cc) $(foreach subdir,${SUBDIRS}, $(wildcard ${srcdir}/${subdir}/*.cc) $(wildcard ${srcdir}/${subdir}/*/*.cc) $(wildcard ${srcdir}/${subdir}/*/*/*.cc)))
 ALLFILES_CC := $(filter-out %.i.cc, ${ALLFILES_CC})
@@ -115,14 +131,34 @@ ALLFILES_LO := $(patsubst %.cc,%.lo,${ALLFILES_CC})
 ALLASMFILES_LO := $(patsubst %.cc,%.lo,${ALLASMFILES_CC})
 ALLOBJECTS_LO = ${ALLFILES_LO} ${ALLASMFILES_LO}
 
-all : ${OBJECTS_LO} ${SUBDIRS_TARGET} libcln.la
+_all_ : allo-local ${SUBDIRS_TARGET_ALL} libcln.la
 else
-all : ${OBJECTS_LO} ${SUBDIRS_TARGET}
+_all_ : allo-local ${SUBDIRS_TARGET_ALL}
 endif
 
-alls : ${FILES_S} ${ASMFILES_S}
 
-allo : ${FILES_LO} ${ASMFILES_LO}
+# Target 'alls' creates all .s files for $(SUBDIR) and its subdirectories.
+
+SUBDIRS_TARGET_ALLS := $(patsubst %,%.target_alls,${SUBDIRS})
+
+${SUBDIRS_TARGET_ALLS} : %.target_alls : %.dirdep
+       ${MAKE} SUBDIR=$* alls
+
+alls : alls-local ${SUBDIRS_TARGET_ALLS}
+
+alls-local : ${FILES_S} ${ASMFILES_S}
+
+
+# Target 'allo' creates all .lo files for $(SUBDIR) and its subdirectories.
+SUBDIRS_TARGET_ALLO := $(patsubst %,%.target_allo,${SUBDIRS})
+
+${SUBDIRS_TARGET_ALLO} : %.target_allo : %.dirdep
+       ${MAKE} SUBDIR=$* allo
+
+allo : allo-local ${SUBDIRS_TARGET_ALLO}
+
+allo-local : ${FILES_LO} ${ASMFILES_LO}
+
 
 ASMFLAGS := @ASMFLAGS@
 ifeq (@AS_UNDERSCORE@,true)
@@ -193,13 +229,6 @@ endif
 endif
 
 
-# Recurse into subdirectories
-${SUBDIRS_TARGET} : %.target : %.dirdep
-       ${MAKE} SUBDIR=$*
-
-${SUBDIRS_DIRDEP} : %.dirdep :
-
-
 ifeq (${SUBDIR},.)
 
 ${ALLOBJECTS_LO} : ${SUBDIRS_TARGET}