Merge pull request #822 from carlosmn/asp-pc
[mono.git] / mcs / build / library.make
index 768149e9d1066b1ba99eab7e122d86dfef6181d7..fdd94d023f316a4b56d93dc229d2641a7e75a2cd 100644 (file)
@@ -17,11 +17,24 @@ PROFILE_excludes = $(wildcard $(PROFILE)_$(LIBRARY).exclude.sources)
 sourcefile = $(depsdir)/$(PROFILE)_$(LIBRARY).sources
 library_CLEAN_FILES += $(sourcefile)
 
+ifdef EXTENSION_MODULE
+EXTENSION_include = $(wildcard $(topdir)/../../mono-extensions/mcs/$(thisdir)/$(PROFILE)_$(LIBRARY).sources)
+else
+EXTENSION_include = $(wildcard $(PROFILE)_opt_$(LIBRARY).sources)
+endif
+
+
+ifdef EXTENSION_MODULE
+EXTENSION_exclude = $(wildcard $(topdir)/../../mono-extensions/mcs/$(thisdir)/$(PROFILE)_$(LIBRARY).exclude.sources)
+else
+EXTENSION_exclude = $(wildcard $(PROFILE)_opt_$(LIBRARY).exclude.sources)
+endif
+
 # Note, gensources.sh can create a $(sourcefile).makefrag if it sees any '#include's
 # We don't include it in the dependencies since it isn't always created
-$(sourcefile): $(PROFILE_sources) $(PROFILE_excludes) $(topdir)/build/gensources.sh
+$(sourcefile): $(PROFILE_sources) $(PROFILE_excludes) $(topdir)/build/gensources.sh $(EXTENSION_include)
        @echo Creating the per profile list $@ ...
-       $(SHELL) $(topdir)/build/gensources.sh $@ $(PROFILE_sources) $(PROFILE_excludes)
+       $(SHELL) $(topdir)/build/gensources.sh $@ '$(PROFILE_sources)' '$(PROFILE_excludes)' '$(EXTENSION_include)' '$(EXTENSION_exclude)'
 endif
 
 PLATFORM_excludes := $(wildcard $(LIBRARY).$(PLATFORM)-excludes)
@@ -47,7 +60,11 @@ else
 lib_dir = lib
 endif
 
+ifdef LIBRARY_SUBDIR
+the_libdir = $(topdir)/class/$(lib_dir)/$(PROFILE)/$(LIBRARY_SUBDIR)/
+else
 the_libdir = $(topdir)/class/$(lib_dir)/$(PROFILE)/
+endif
 ifdef LIBRARY_NEEDS_POSTPROCESSING
 build_libdir = fixup/$(PROFILE)/
 else
@@ -93,16 +110,19 @@ endif
 
 csproj-local: csproj-library csproj-test
 
+# to overcome the issues with circular dependencies, we'll create csprojs with a counter increment. 
+# This is more amenable for use in VS solutions to reference projects rather than transient dll files in the build process.
 csproj-library:
        config_file=`basename $(LIBRARY) .dll`-$(PROFILE).input; \
+       for counter in 1 2 3 4 5 ; do if test -f $(topdir)/../msvc/scripts/inputs/$$config_file ; then config_file=`basename $(LIBRARY) .dll`-$(PROFILE)-$$counter.input; fi ; done ;\
        echo $(thisdir):$$config_file >> $(topdir)/../msvc/scripts/order; \
        (echo $(is_boot); \
-       echo $(MCS);    \
        echo $(USE_MCS_FLAGS) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS); \
        echo $(LIBRARY_NAME); \
        echo $(BUILT_SOURCES_cmdline); \
        echo $(build_lib); \
        echo $(FRAMEWORK_VERSION); \
+       echo $(PROFILE); \
        echo $(response)) > $(topdir)/../msvc/scripts/inputs/$$config_file
 
 csproj-test:
@@ -188,12 +208,12 @@ csproj-test:
        config_file=`basename $(LIBRARY) .dll`-tests-$(PROFILE).input; \
        echo $(thisdir):$$config_file >> $(topdir)/../msvc/scripts/order; \
        (echo false; \
-       echo $(MCS);    \
        echo $(USE_MCS_FLAGS) -r:$(the_assembly) $(TEST_MCS_FLAGS); \
        echo $(test_lib); \
        echo $(BUILT_SOURCES_cmdline); \
        echo $(test_lib); \
        echo $(FRAMEWORK_VERSION); \
+       echo $(PROFILE); \
        echo $(test_response)) > $(topdir)/../msvc/scripts/inputs/$$config_file
 
 endif