[mobile_static] Use make parallelism to aot compile .dlls in parallel
authorAlexander Kyte <alexmkyte@fastmail.com>
Wed, 15 Jun 2016 22:33:58 +0000 (18:33 -0400)
committerAlexander Kyte <alexmkyte@gmail.com>
Sun, 3 Jul 2016 01:33:08 +0000 (21:33 -0400)
mcs/build/rules.make

index 5e90cf8ddac60c76169f749959fabe51e0fe4484..54a86f6e3b3143754669b85c93e8e374a3e2587c 100644 (file)
@@ -202,16 +202,21 @@ STD_TARGETS = test run-test run-test-ondotnet clean install uninstall doc-update
 $(STD_TARGETS): %: do-%
 
 ifdef PLATFORM_AOT_SUFFIX
-Q_AOT=$(if $(V),,@echo "AOT     [$(PROFILE)] AOT All Assemblies";)
-LIST_ALL_PROFILE_ASSEMBLIES = find . | grep -E '(dll|exe)$$' | grep -v -E 'bare|plaincore|secxml|Facades'
-COMPILE_ALL_PROFILE_ASSEMBLIES = $(LIST_ALL_PROFILE_ASSEMBLIES) | MONO_PATH="./" xargs -I '{}' $(RUNTIME) $(RUNTIME_FLAGS) $(AOT_BUILD_FLAGS) '{}'
+AOT_PROFILE_ASSEMBLIES = $(shell cd $(topdir)/class/lib/$(PROFILE)/ && find . | grep -E '(dll|exe)$$' | grep -v -E 'bare|plaincore|secxml|Facades' | sed 's:\./::g' | tr '\n' ' ')
 
 do-all-aot:
        $(MAKE) do-all TOP_LEVEL_DO=do-all
        $(MAKE) aot-all-profile
 
-aot-all-profile:
-       $(Q_AOT) cd $(topdir)/class/lib/$(PROFILE)/ && $(COMPILE_ALL_PROFILE_ASSEMBLIES) &> $(PROFILE)-aot.log
+# This can run in parallel
+.PHONY: aot-all-profile
+aot-all-profile: $(patsubst %,$(topdir)/class/lib/$(PROFILE)/%$(PLATFORM_AOT_SUFFIX),$(AOT_PROFILE_ASSEMBLIES))
+
+$(topdir)/class/lib/$(PROFILE)/%$(PLATFORM_AOT_SUFFIX): $(topdir)/class/lib/$(PROFILE)/%
+       @ mkdir -p $(topdir)/class/lib/$(PROFILE)/$*_bitcode_tmp
+       @echo "AOT     [$(PROFILE)] AOT $* " && cd $(topdir)/class/lib/$(PROFILE)/ && MONO_PATH="." $(RUNTIME) $(RUNTIME_FLAGS) $(AOT_BUILD_FLAGS),temp-path=$*_bitcode $* >> $(PROFILE)-aot.log
+       @ rm -rf $(topdir)/class/lib/$(PROFILE)/$*_bitcode_tmp
+
 endif
 
 do-run-test: