From 4fa058c293bcb6694eb2bdaeb4472ed22176039c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 23 Feb 2008 18:06:32 +0000 Subject: [PATCH] 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. --- ChangeLog | 9 +++++++++ src/Makefile.in | 53 ++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 50 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index a2c46e1..223f0c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-02-23 Bruno Haible + + 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 * include/cln/integer_io.h (read_integer): Make index args uintC. diff --git a/src/Makefile.in b/src/Makefile.in index 51fa167..741bff5 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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}