Fix parallel-build issues with LIBRARY_USE_INTERMEDIATE_FILE
authorRaja R Harinath <harinath@hurrynot.org>
Sun, 26 Jul 2009 16:56:02 +0000 (16:56 -0000)
committerRaja R Harinath <harinath@hurrynot.org>
Sun, 26 Jul 2009 16:56:02 +0000 (16:56 -0000)
* library.make (build_lib): Define to a profile dependent
temporary location for LIBRARY_USE_INTERMEDIATE_FILE.
(DO_AOT): New.  Extracted from ...
($(build_lib)): ... here.  Simplify.  Extract code handling
LIBRARY_USE_INTERMEDIATE_FILE into ...
($(the_lib)) [LIBRARY_USE_INTERMEDIATE_FILE]: ... here, a new rule
that takes care of copying the library from its temporary location
to the final location.

svn path=/trunk/mcs/; revision=138691

mcs/build/ChangeLog
mcs/build/library.make

index b7e5d6ad6e1d7cdc8f35ea1fce209961c2dc23d4..3ccc2048b3e606f3d787f7ad5bb72e548132fc3d 100644 (file)
@@ -1,3 +1,15 @@
+2009-07-26  Raja R Harinath  <harinath@hurrynot.org>
+
+       Fix parallel-build issues with LIBRARY_USE_INTERMEDIATE_FILE
+       * library.make (build_lib): Define to a profile dependent
+       temporary location for LIBRARY_USE_INTERMEDIATE_FILE.
+       (DO_AOT): New.  Extracted from ...
+       ($(build_lib)): ... here.  Simplify.  Extract code handling
+       LIBRARY_USE_INTERMEDIATE_FILE into ...
+       ($(the_lib)) [LIBRARY_USE_INTERMEDIATE_FILE]: ... here, a new rule
+       that takes care of copying the library from its temporary location
+       to the final location.
+
 2009-07-20  Jb Evain  <jbevain@novell.com>
 
        * profiles/monotouch.make: add monotouch profile.
index c7cb676e824d3abf49fc7c262feb909a7f8854b6..ea234e42ac9bb3db80ae66817ae928651e85f179 100644 (file)
@@ -53,12 +53,17 @@ library_CLEAN_FILES += $(makefrag) $(the_lib) $(the_lib).so $(the_pdb) $(the_mdb
 
 ifdef LIBRARY_NEEDS_POSTPROCESSING
 build_libdir = fixup/$(PROFILE)/
-build_lib = $(build_libdir)$(LIBRARY_NAME)
-library_CLEAN_FILES += $(build_lib) $(build_lib:.dll=.pdb)
 else
-build_lib = $(the_lib)
+ifdef LIBRARY_USE_INTERMEDIATE_FILE
+build_libdir = $(the_libdir)tmp/
+else
+build_libdir = $(the_libdir)
+endif
 endif
 
+build_lib = $(build_libdir)$(LIBRARY_NAME)
+library_CLEAN_FILES += $(build_lib) $(build_lib:.dll=.pdb)
+
 ifdef NO_SIGN_ASSEMBLY
 SN = :
 else
@@ -216,27 +221,33 @@ endif
 
 Q_AOT=$(if $(V),,@echo "AOT [$(PROFILE)] $(notdir $(@))";)
 
+ifdef ENABLE_AOT
+ifneq (,$(filter $(AOT_IN_PROFILES), $(PROFILE)))
+
+DO_AOT := $(Q_AOT) MONO_PATH='$(build_libdir):$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version
+
+endif
+endif
+
+ifndef DO_AOT
+DO_AOT = @:
+endif
+
 # The library
 
 $(the_lib): $(the_libdir)/.stamp
 
 $(build_lib): $(response) $(sn) $(BUILT_SOURCES) $(build_libdir:=/.stamp)
-ifdef LIBRARY_USE_INTERMEDIATE_FILE
-       $(LIBRARY_COMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) -target:library -out:$(LIBRARY_NAME) $(BUILT_SOURCES_cmdline) @$(response)
-       $(SN) $(SNFLAGS) $(LIBRARY_NAME) $(LIBRARY_SNK)
-       $(Q) mv $(LIBRARY_NAME) $@
-       $(Q) test ! -f $(LIBRARY_NAME).mdb || mv $(LIBRARY_NAME).mdb $@.mdb
-       $(Q) test ! -f $(LIBRARY_NAME:.dll=.pdb) || mv $(LIBRARY_NAME:.dll=.pdb) $(dir $@)$(LIBRARY_NAME:.dll=.pdb)
-else
        $(LIBRARY_COMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) -target:library -out:$@ $(BUILT_SOURCES_cmdline) @$(response)
        $(SN) $(SNFLAGS) $@ $(LIBRARY_SNK)
-endif
-
+       $(DO_AOT) $@
 
-ifdef ENABLE_AOT
-ifneq (,$(filter $(AOT_IN_PROFILES), $(PROFILE)))
-       $(Q_AOT) MONO_PATH=$(the_libdir) $(RUNTIME) --aot=bind-to-runtime-version $@ > $(PROFILE)_aot.log 2>&1
-endif
+ifdef LIBRARY_USE_INTERMEDIATE_FILE
+$(the_lib): $(build_lib)
+       $(Q) cp $(build_lib) $@
+       $(Q) test ! -f $(build_lib).mdb || mv $(build_lib).mdb $@.mdb
+       $(Q) test ! -f $(build_lib).so || mv $(build_lib).so $@.so
+       $(Q) test ! -f $(build_lib:.dll=.pdb) || mv $(build_lib:.dll=.pdb) $(the_lib:.dll=.pdb)
 endif
 
 $(makefrag): $(sourcefile)