Add support for alternate source files to be used on extension-less builds.
[mono.git] / mcs / build / library.make
index ad8d8e04604bde9c718863270f1e4a8d798c279c..fea9b5307717d130872d674c2247b934d7889322 100644 (file)
@@ -17,11 +17,17 @@ PROFILE_excludes = $(wildcard $(PROFILE)_$(LIBRARY).exclude.sources)
 sourcefile = $(depsdir)/$(PROFILE)_$(LIBRARY).sources
 library_CLEAN_FILES += $(sourcefile)
 
+ifdef EXTENSION_MODULE
+EXTENSION_include=$(topdir)/../../mono-extensions/mcs/$(thisdir)/$(PROFILE)_$(LIBRARY).sources
+else
+EXTENSION_include=$(PROFILE)_opt_$(LIBRARY).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
        @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)'
 endif
 
 PLATFORM_excludes := $(wildcard $(LIBRARY).$(PLATFORM)-excludes)
@@ -93,8 +99,11 @@ 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);    \
@@ -103,6 +112,7 @@ csproj-library:
        echo $(BUILT_SOURCES_cmdline); \
        echo $(build_lib); \
        echo $(FRAMEWORK_VERSION); \
+       echo $(PROFILE); \
        echo $(response)) > $(topdir)/../msvc/scripts/inputs/$$config_file
 
 csproj-test:
@@ -310,7 +320,7 @@ $(makefrag) $(test_response) $(test_makefrag) $(btest_response) $(btest_makefrag
 Q_MDOC_UP=$(if $(V),,@echo "MDOC-UP [$(PROFILE)] $(notdir $(@))";)
 # net_2_0 is needed because monodoc is only compiled in that profile
 MDOC_UP  =$(Q_MDOC_UP) \
-               MONO_PATH="$(topdir)/class/lib/$(DEFAULT_PROFILE)$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(topdir)/tools/mdoc/mdoc.exe \
+               MONO_PATH="$(topdir)/class/lib/$(DEFAULT_PROFILE)$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(topdir)/class/lib/$(DEFAULT_PROFILE)/mdoc.exe \
                update --delete -o Documentation/en $(the_lib)
 
 doc-update-local: $(the_libdir)/.doc-stamp