diff options
author | Sascha Schumann <sas@php.net> | 1999-12-30 07:15:43 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 1999-12-30 07:15:43 +0000 |
commit | b92aadb6eef4c953549144a9ef8faba2df325192 (patch) | |
tree | 83ee055eb017cfe7c6ea358fc6a4baa18ba54eb1 /build/rules.mk | |
parent | 163f5f49936e54ef3ab020c904a0d73dd50e341b (diff) | |
download | php-git-b92aadb6eef4c953549144a9ef8faba2df325192.tar.gz |
Proper protection for GNU make's parallel build
Diffstat (limited to 'build/rules.mk')
-rw-r--r-- | build/rules.mk | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/build/rules.mk b/build/rules.mk index ece21ce9d5..bb2a444a7b 100644 --- a/build/rules.mk +++ b/build/rules.mk @@ -73,17 +73,29 @@ top_builddir = $(DEPTH) $(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@ -all: all-recursive $(targets) +all: all-recursive +install: install-recursive distclean-recursive depend-recursive clean-recursive all-recursive install-recursive: - @target=`echo $@|sed s/-recursive//`; \ - if test '$(NO_RECURSION)' != "$$target"; then \ + @otarget=`echo $@|sed s/-recursive//`; \ + if test '$(NO_RECURSION)' != "$$otarget"; then \ list='$(SUBDIRS)'; for i in $$list; do \ + target="$$otarget"; \ echo "Making $$target in $$i"; \ - test "$$i" = "." || (cd $$i && $(MAKE) $$target) || exit 1; \ + if test "$$i" = "."; then \ + ok=yes; \ + target="$$target-p"; \ + fi; \ + (cd $$i && $(MAKE) $$target) || exit 1; \ done; \ + test "$otarget" = "all" && test -z '$(targets)' && ok=yes; \ + test "$ok" = "yes" || $(MAKE) "$$otarget-p" || exit 1; \ fi; +all-p: $(targets) +install-p: $(targets) $(install_targets) +distclean-p depend-p clean-p: + depend: depend-recursive test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) *.c > .deps @@ -96,8 +108,6 @@ clean-x: distclean: distclean-recursive clean-x rm -f config.cache config.log config.status config_vars.mk libtool \ php_config.h stamp-h Makefile build-defs.h php4.spec libphp4.module - -install: install-recursive $(targets) $(install_targets) install-modules: @test -d modules && \ @@ -110,4 +120,5 @@ include $(srcdir)/.deps .PHONY: all-recursive clean-recursive install-recursive \ $(install_targets) install all clean depend depend-recursive shared \ -distclean-recursive distclean clean-x +distclean-recursive distclean clean-x all-p install-p distclean-p \ +depend-p clean-p |