--- Makefile.in 2001/09/04 09:46:06 1.12
+++ Makefile.in 2001/09/05 09:10:28 1.13
@@ -46,11 +46,31 @@
HDRS = lmtp.h nntp.h sa.h argz.h shpat_match.h msg.h trace.h
OBJS = lmtp2nntp.o lmtp.o nntp.o sa.o argz.o shpat_match.o msg.o trace.o version.o
-all: lmtp2nntp lmtp2nntp.1
+SUBDIRS = @SUBDIR_STR@ @SUBDIR_L2@
+
+all: _SUBDIRS_all lmtp2nntp lmtp2nntp.1
.c.o:
$(CC) $(CFLAGS) -c $<
+# convinience rule for calling _SUBDIRS with various make targets
+_SUBDIRS_all _SUBDIRS_check _SUBDIRS_install _SUBDIRS_uninstall _SUBDIRS_clean _SUBDIRS_distclean _SUBDIRS_depend:
+ @$(MAKE) $(MFLAGS) \
+ _SUBDIRS_TARGET=`echo $@ | sed -e 's/^_SUBDIRS_//'` \
+ _SUBDIRS_STEPDOWN
+
+# the work horse rule which steps down to the subdirs in a loop
+_SUBDIRS_STEPDOWN:
+ @for subdir in $(SUBDIRS); do \
+ test ! -f "$$subdir/Makefile" && continue; \
+ echo "===> $(_SUBDIRS_DP)$$subdir ($(_SUBDIRS_TARGET))"; \
+ (cd $$subdir; \
+ $(MAKE) $(MFLAGS) \
+ _SUBDIRS_DP="$(_SUBDIRS_DP)$$subdir/" \
+ $(_SUBDIRS_TARGET) || exit 1) || exit 1; \
+ echo "<=== $(_SUBDIRS_DP)$$subdir"; \
+ done
+
$(PROG): Makefile $(OBJS) $(HDRS)
$(CC) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS)
@@ -67,16 +87,19 @@
$(SHTOOL) install -c -m 644 lmtp2nntp.1 $(DESTDIR)$(mandir)/man1/
clean:
+ @$(MAKE) $(MFLAGS) _SUBDIRS_clean
-rm -f *.core
-rm -f dmalloc.log test/dmalloc.log
-rm -f $(PROG)
-rm -f $(OBJS)
distclean: clean
+ @$(MAKE) $(MFLAGS) _SUBDIRS_distclean
-rm -f config.h config.status config.log config.cache
-rm -f Makefile
realclean: distclean
+ @$(MAKE) $(MFLAGS) _SUBDIRS_realclean
-rm -f lmtp2nntp.1
-rm -f config.h.in
-rm -f configure
@@ -89,7 +112,7 @@
@$(SHTOOL) fixperm -v .; \
V=`$(SHTOOL) version -lc -dshort version.c`; \
$(SHTOOL) tarball -o lmtp2nntp-$${V}.tar.gz -d lmtp2nntp-$${V} -u ossp -g ossp \
- -e 'CVS,\.cvsignore,\.[ao],^\.,autogen.sh,test,*.tar.gz' -c 'gzip --best' .
+ -e 'CVS,\.cvsignore,\.[ao],^\.,/\.,autogen.sh,test,*.tar.gz' -c 'gzip --best' .
check: lmtp2nntp
@cd test && ./run.sh
|