Skip to content

Commit

Permalink
build: Allow make check to be parallel
Browse files Browse the repository at this point in the history
Remove the limitation of running the lib checks
in serial by writing each set of checks to it's
own file (before merging) and choosing which checks
to run using a make, rather than shell, loop.

This allows e.g. make -j 4 check (interleave both
compilation and tests) and make -j 4 ; make -j 4 check
(do the build in parallel, then the checks in parallel
but don't mix them up).
  • Loading branch information
andreww committed Jul 17, 2009
1 parent 1168cdd commit 536a67a
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 28 deletions.
82 changes: 59 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,57 @@ dom_lib: objsdir sax_lib wxml_lib
(cd dom; $(MAKE) VPATH=$(VPATH)/dom)
dom_lib_clean:
if test -d dom; then (cd dom; $(MAKE) VPATH=$(VPATH)/dom clean) fi
dom_lib_check: sax_lib_check wxml_lib_check
(cd dom; $(MAKE) VPATH=$(VPATH)/dom check)
touch dom_lib_check
dom_lib_check: dom_lib
if test -d examples && ! grep DUMMYLIB arch.make > /dev/null ; \
then \
rm -f dom_lib_check ; \
rm -f dom_lib_check.out ; \
(cd dom; $(MAKE) VPATH=$(VPATH)/dom check) ; \
touch dom_lib_check ; \
touch dom_lib_check.out ; \
fi
#
sax_lib: objsdir common_lib utils_lib fsys_lib
(cd sax; $(MAKE) VPATH=$(VPATH)/sax)
sax_lib_clean:
if test -d sax; then (cd sax; $(MAKE) VPATH=$(VPATH)/sax clean) fi
sax_lib_check: common_lib_check
(cd sax; $(MAKE) VPATH=$(VPATH)/sax check)
touch sax_lib_check
sax_lib_check: sax_lib
if test -d examples && ! grep DUMMYLIB arch.make > /dev/null ; \
then \
rm -f sax_lib_check ; \
rm -f sax_lib_check.out ; \
(cd sax; $(MAKE) VPATH=$(VPATH)/sax check) ; \
touch sax_lib_check ; \
touch sax_lib_check.out ; \
fi
#
wxml_lib: objsdir common_lib fsys_lib
(cd wxml; $(MAKE) VPATH=$(VPATH)/wxml)
wxml_lib_clean:
if test -d wxml; then (cd wxml; $(MAKE) VPATH=$(VPATH)/wxml clean) fi
wxml_lib_check: common_lib_check
(cd wxml; $(MAKE) VPATH=$(VPATH)/wxml check)
touch wxml_lib_check
wxml_lib_check: wxml_lib
if test -d examples && ! grep DUMMYLIB arch.make > /dev/null ; \
then \
rm -f wxml_lib_check ; \
rm -f wxml_lib_check.out ; \
(cd wxml; $(MAKE) VPATH=$(VPATH)/wxml check) ; \
touch wxml_lib_check ; \
touch wxml_lib_check.out ; \
fi
#
wcml_lib: objsdir utils_lib wxml_lib
(cd wcml; $(MAKE) VPATH=$(VPATH)/wcml)
wcml_lib_clean:
if test -d wcml; then (cd wcml; $(MAKE) VPATH=$(VPATH)/wcml clean) fi
wcml_lib_check: wxml_lib_check
(cd wcml; $(MAKE) VPATH=$(VPATH)/wcml check)
touch wcml_lib_check
wcml_lib_check: wcml_lib
if test -d examples && ! grep DUMMYLIB arch.make > /dev/null ; \
then \
rm -f wcml_lib_check ; \
rm -f wcml_lib_check.out ; \
(cd wcml; $(MAKE) VPATH=$(VPATH)/wcml check) ; \
touch wcml_lib_check ; \
touch wcml_lib_check.out ; \
fi
#
#wkml_lib: objsdir utils_lib wxml_lib
# (cd wkml; $(MAKE) VPATH=$(VPATH)/wkml)
Expand All @@ -65,30 +89,42 @@ common_lib: objsdir fsys_lib utils_lib
(cd common; $(MAKE) VPATH=$(VPATH)/common)
common_lib_clean:
if test -d common; then (cd common; $(MAKE) VPATH=$(VPATH)/common clean) fi
common_lib_check: utils_lib_check
(cd common; $(MAKE) VPATH=$(VPATH)/common check)
touch common_lib_check
common_lib_check: common_lib
if test -d examples && ! grep DUMMYLIB arch.make > /dev/null ; \
then \
rm -f common_lib_check ; \
rm -f common_lib_check.out ; \
(cd common; $(MAKE) VPATH=$(VPATH)/common check) ; \
touch common_lib_check ; \
touch common_lib_check.out ; \
fi
#
utils_lib: objsdir fsys_lib
(cd utils; $(MAKE) VPATH=$(VPATH)/utils)
utils_lib_clean:
if test -d utils; then (cd utils; $(MAKE) VPATH=$(VPATH)/utils clean) fi
utils_lib_check:
(cd utils; $(MAKE) VPATH=$(VPATH)/utils check)
touch utils_lib_check
utils_lib_check: utils_lib
if test -d examples && ! grep DUMMYLIB arch.make > /dev/null ; \
then \
rm -f utils_lib_check ; \
rm -f utils_lib_check.out ; \
(cd utils; $(MAKE) VPATH=$(VPATH)/utils check) ; \
touch utils_lib_check ; \
touch utils_lib_check.out ; \
fi
#
fsys_lib: objsdir
(cd fsys; $(MAKE) VPATH=$(VPATH)/fsys)
fsys_lib_clean:
if test -d fsys; then (cd fsys; $(MAKE) VPATH=$(VPATH)/fsys clean) fi
#
check: default
check: $(foreach target,$(BUILD_TARGETS) common_lib utils_lib,$(target)_check)
@if ! test -d examples; then echo "You need to download the full version of FoX to run the testsuite"; \
elif grep DUMMYLIB arch.make > /dev/null; then echo "You cannot run the testsuite on the dummy library"; \
else \
rm -f check.out *_check; \
else \
rm -f check.out; \
touch check.out; \
for i in $(BUILD_TARGETS); do $(MAKE) $$i''_check; done; \
for i in $(BUILD_TARGETS) common_lib utils_lib; do cat $$i''_check.out >> check.out ; rm -f $$i''_check.out ; done; \
grep RESULT check.out; \
fi
#
Expand Down Expand Up @@ -122,7 +158,7 @@ cutdown-dom: cutdown
clean: wxml_lib_clean wcml_lib_clean common_lib_clean fsys_lib_clean sax_lib_clean dom_lib_clean utils_lib_clean
#clean: wkml_lib_clean wxml_lib_clean wcml_lib_clean common_lib_clean fsys_lib_clean sax_lib_clean dom_lib_clean utils_lib_clean
if test -d examples; then (cd examples; $(MAKE) VPATH=$(VPATH)/examples clean) fi
rm -rf objs .FoX check.out *_check
rm -rf objs .FoX check.out *_check *_check.out
#
distclean: clean
rm -f FoX-config arch.make config.log config.status .config check.out
Expand Down
2 changes: 1 addition & 1 deletion common/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ install: $(OBJFILES)
$(CP) $$i $(MOD_DIR); done
#
check:
(cd test; make) | tee -a ../check.out
(cd test; make) | tee -a ../common_lib_check.out
#
clean:
rm -f *.$(OBJEXT) *.$(MOD_EXT) $(LIBRARY)
Expand Down
2 changes: 1 addition & 1 deletion sax/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ install: $(OBJFILES)
$(CP) $$i $(MOD_DIR);done
#
check:
(cd test; make) | tee -a ../check.out
(cd test; make) | tee -a ../sax_lib_check.out
#
clean:
rm -f *.$(OBJEXT) *.$(MOD_EXT) $(LIBRARY)
Expand Down
2 changes: 1 addition & 1 deletion utils/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ clean:
rm -f *.$(OBJEXT) *.$(MOD_EXT) $(LIBRARY)
#
check:
(cd test; make) | tee -a ../check.out
(cd test; make) | tee -a ../utils_lib_check.out
# DO NOT DELETE THIS LINE - used by make depend
FoX_utils.$(OBJEXT): fox_m_utils_uuid.$(OBJEXT) fox_m_utils_uri.$(OBJEXT)
fox_m_utils_uuid.$(OBJEXT): fox_m_utils_mtprng.$(OBJEXT)
2 changes: 1 addition & 1 deletion wcml/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ install: $(OBJFILES)
$(CP) $$i $(MOD_DIR); done
#
check:
(cd test; make) | tee -a ../check.out
(cd test; make) | tee -a ../wcml_lib_check.out
#
clean:
rm -f *.$(OBJEXT) *.$(MOD_EXT) $(LIBRARY)
Expand Down
2 changes: 1 addition & 1 deletion wxml/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ install: $(OBJFILES)
$(CP) $$i $(MOD_DIR); done
#
check:
(cd test; make) | tee -a ../check.out
(cd test; make) | tee -a ../wxml_lib_check.out
#
clean:
rm -f *.$(OBJEXT) *.$(MOD_EXT) $(LIBRARY)
Expand Down

0 comments on commit 536a67a

Please sign in to comment.