From c2d127b3ed13be71dcd710bd8d4ae27ee8ed7fcd Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 10 Oct 1999 01:04:39 +0000 Subject: [PATCH] Clean up and add 'clean' target which removes standard targets recursively --- build.mk | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/build.mk b/build.mk index e65cbb50e4..22cb9a46c7 100644 --- a/build.mk +++ b/build.mk @@ -20,30 +20,38 @@ SUBDIRS = libzend TSRM makefile_am_files = $(shell find . -name Makefile.am) makefile_in_files = $(makefile_am_files:.am=.in) makefile_files = $(makefile_am_files:e.am=e) + +config_h_in = php_config.h.in config_h_files = \ - $(shell echo ext/*/config.h.stub) \ - $(shell echo sapi/*/config.h.stub) - + $(shell echo ext/*/config.h.stub sapi/*/config.h.stub) + config_m4_files = \ - $(shell echo ext/*/config.m4) \ - $(shell echo sapi/*/config.m4) + $(shell echo ext/*/config.m4 sapi/*/config.m4) acconfig_h_SOURCES = acconfig.h.in $(config_h_files) -all: $(makefile_in_files) $(LT_TARGETS) configure php_config.h.in +targets = $(makefile_in_files) $(LT_TARGETS) configure $(config_h_in) + +all: $(targets) @for i in $(SUBDIRS); do \ test -d $$i || (test -d ../$$i && ln -s ../$$i $$i); \ (cd $$i && $(MAKE) -f build.mk AMFLAGS=$(AMFLAGS)); \ done dist: - find -type l -exec rm {} \; - for i in $(SUBDIRS); do \ + @rm -f $(SUBDIRS) 2>/dev/null || true + @for i in $(SUBDIRS); do \ test -d $$i || (test -d ../$$i && cp -rp ../$$i $$i); \ done - $(MAKE) AMFLAGS=--copy -f build.mk all + @find . -type l -exec rm {} \; + $(MAKE) AMFLAGS=--copy -f build.mk +clean: + rm -f $(targets) + @for i in $(SUBDIRS); do \ + (cd $$i && $(MAKE) -f build.mk clean); \ + done acconfig.h: $(acconfig_h_SOURCES) @echo rebuilding $@ @@ -63,7 +71,7 @@ $(makefile_in_files): $(makefile_am_files) aclocal.m4: configure.in acinclude.m4 aclocal -php_config.h.in: configure.in acconfig.h +$(config_h_in): configure.in acconfig.h # explicitly remove target since autoheader does not seem to work # correctly otherwise (timestamps are not updated) @rm -f $@ -- 2.40.0