From a97f6d888fcb34b416a64724e67b7d7e77df6f68 Mon Sep 17 00:00:00 2001 From: Helmut Eller Date: Mon, 15 Sep 2025 05:55:19 +0200 Subject: [PATCH] Better support for parallel make * mps/code/comm.gmk (LIB_TARGETS, TEST_TARGETS, EVENT_TARGETS) (TEST_SUITES, testmmqa): If VARIETY is not defined, then disable parallism with .NOTPARALLEL. Otherwise, avoid the recursive make with a static pattern rule. (clean-testansi, clean-testpollnone): New. * mps/Makefile.in (build-via-make): Invoke submake explicit VARIETY argument to allow more parallelism. (test-make-build): Use clean-testansi and clean-testpollnone. --- mps/Makefile.in | 7 ++++--- mps/code/comm.gmk | 11 +++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/mps/Makefile.in b/mps/Makefile.in index 7c3230bc341..15b16a2c74e 100644 --- a/mps/Makefile.in +++ b/mps/Makefile.in @@ -34,7 +34,8 @@ XCODEBUILD=xcrun xcodebuild -project code/mps.xcodeproj all: @BUILD_TARGET@ build-via-make: - $(MAKE) $(TARGET_OPTS) + $(MAKE) $(TARGET_OPTS) VARIETY=cool + $(MAKE) $(TARGET_OPTS) VARIETY=hot clean-make-build: $(MAKE) $(TARGET_OPTS) clean @@ -84,12 +85,12 @@ test-make-build: $(MAKE) -C code -f anan$(MPS_BUILD_NAME).gmk VARIETY=cool \ CC='$(CC)' \ CFLAGSCOMPILERSTRICT='$(CFLAGSCOMPILERSTRICT)' \ - clean testansi + clean-testansi $(MAKE) -C code -f anan$(MPS_BUILD_NAME).gmk VARIETY=cool \ CC='$(CC)' \ CFLAGS="-DCONFIG_POLL_NONE" \ CFLAGSCOMPILERSTRICT='$(CFLAGSCOMPILERSTRICT)' \ - clean testpollnone + clean-testpollnone test-xcode-build: $(XCODEBUILD) -config Debug -target testci diff --git a/mps/code/comm.gmk b/mps/code/comm.gmk index 05c73fb411a..cac85c4ee6a 100644 --- a/mps/code/comm.gmk +++ b/mps/code/comm.gmk @@ -363,13 +363,18 @@ testscheme: phony # These convenience targets allow one to type "make foo" to build target # foo in selected varieties (or none, for the latter rule). -$(LIB_TARGETS) $(TEST_TARGETS) $(EVENT_TARGETS) $(TEST_SUITES) testmmqa: phony ifdef VARIETY - $(MAKE) -f $(PFM).gmk TARGET=$@ variety +$(LIB_TARGETS) $(TEST_TARGETS) $(EVENT_TARGETS) $(TEST_SUITES) testmmqa: \ + %: $(PFM)/$(VARIETY)/% ; else +$(LIB_TARGETS) $(TEST_TARGETS) $(EVENT_TARGETS) $(TEST_SUITES) testmmqa: $(MAKE) -f $(PFM).gmk TARGET=$@ target +.NOTPARALLEL: endif +# Targets for toplevel make +clean-testansi: clean .WAIT testansi +clean-testpollnone: clean .WAIT testpollnone # "clean" removes the directory containing the build results for the # platform. @@ -611,14 +616,12 @@ endif define run-cc-strict $(ECHO) "$(PFM): $@" -mkdir -p $(PFM) mkdir -p $(PFM)/$(VARIETY) $(CC) $(CFLAGSSTRICT) -c -o $@ $< endef define run-cc-lax $(ECHO) "$(PFM): $@ - compiling with lax flags." -mkdir -p $(PFM) mkdir -p $(PFM)/$(VARIETY) $(CC) $(CFLAGSLAX) -c -o $@ $< endef