From 8d469d0ecbd06a993426de11b8feec551378525b Mon Sep 17 00:00:00 2001 From: Max Maischein Date: Mon, 28 Dec 2020 13:00:49 +0100 Subject: WIP: Run `makedepend` in parallel by using `make` This moves the per-file loop body of `makedepend` into a separate file named `makedepend_file` and then uses `make` to launch the `makedepend_file` processes for each target potentially in parallel. This reduces the time for time sh ./makedepend MAKE=make cflags from 5 seconds to 2 seconds with MAKEFLAGS=-j8 --- Makefile.SH | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Makefile.SH') diff --git a/Makefile.SH b/Makefile.SH index 7e75d47365..ecbe8c136b 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -1376,6 +1376,7 @@ veryclean: _verycleaner _mopup _clobber _mopup: rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c perlmini.c generate_uudmap$(EXE_EXT) $(generated_headers) -rmdir .depending + -rm *.depends -@test -f extra.pods && rm -f `cat extra.pods` -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod -rm -f perl.exp ext.libs $(generated_pods) uni.data opmini.o perlmini.o pod/roffitall @@ -1499,7 +1500,7 @@ cscope.out cscope: $(c) $(h) # The README below ensures that the dependency list is never empty and # that when MAKEDEPEND is empty $(FIRSTMAKEFILE) doesn't need rebuilding. -MAKEDEPEND = Makefile makedepend +MAKEDEPEND = Makefile makedepend_file makedepend $(FIRSTMAKEFILE): README $(MAKEDEPEND) $(MAKE) depend MAKEDEPEND= @@ -1520,6 +1521,9 @@ $spitshell >>$Makefile <<'!NO!SUBS!' depend: makedepend $(DTRACE_H) $(generated_headers) sh ./makedepend MAKE="$(MAKE)" cflags +%.c.depends: %.c + sh ./makedepend_file $< $@ cflags + .PHONY: test check test_prep test_prep_nodll test_prep_pre \ test_prep_reonly test_tty test-tty test_notty test-notty \ test_harness test_harness_notty minitest test-reonly _test -- cgit v1.2.1