Consts.cs.in: Removed RuntimeVersion as it should be the same as FxFileVersion. Use...
[mono.git] / mcs / build / library.make
index a486b230d31feeb2e514afba47e4494cca4b5e43..30e8804cb4c64820168def4b6c0a15a0e42051e1 100644 (file)
@@ -9,6 +9,18 @@
 # munge in the library name to keep the files from clashing.
 
 sourcefile = $(LIBRARY).sources
+
+# If the directory contains the per profile include file, generate list file.
+PROFILE_sources = $(PROFILE)_$(LIBRARY).sources
+ifeq ($(wildcard $(PROFILE_sources)), $(PROFILE_sources))
+PROFILE_excludes = $(wildcard $(PROFILE)_$(LIBRARY).exclude.sources)
+COMMON_sourcefile := $(sourcefile)
+sourcefile = $(depsdir)/$(PROFILE)_$(LIBRARY).sources
+$(sourcefile): $(PROFILE_sources) $(PROFILE_excludes) $(COMMON_sourcefile)
+       @echo Creating the per profile list $@ ...
+       $(topdir)/tools/gensources.sh $(PROFILE_sources) $(PROFILE_excludes) > $@
+endif
+
 PLATFORM_excludes := $(wildcard $(LIBRARY).$(PLATFORM)-excludes)
 
 ifndef PLATFORM_excludes
@@ -26,8 +38,14 @@ ifndef LIBRARY_NAME
 LIBRARY_NAME = $(LIBRARY)
 endif
 
+ifdef LIBRARY_COMPAT
+lib_dir = compat
+else
+lib_dir = lib
+endif
+
 makefrag = $(depsdir)/$(PROFILE)_$(LIBRARY).makefrag
-the_lib = $(topdir)/class/lib/$(PROFILE)/$(LIBRARY_NAME)
+the_lib = $(topdir)/class/$(lib_dir)/$(PROFILE)/$(LIBRARY_NAME)
 the_pdb = $(the_lib:.dll=.pdb)
 the_mdb = $(the_lib).mdb
 library_CLEAN_FILES += $(makefrag) $(the_lib) $(the_pdb) $(the_mdb)
@@ -45,33 +63,20 @@ test_nunit_dep = $(test_nunit_lib:%=$(topdir)/class/lib/$(PROFILE)/%)
 test_nunit_ref = $(test_nunit_dep:%=-r:%)
 library_CLEAN_FILES += TestResult*.xml
 
-ifndef test_against
-test_against = $(the_lib)
-test_dep = $(the_lib)
-endif
-
-ifndef test_lib
 test_lib = $(LIBRARY:.dll=_test_$(PROFILE).dll)
 test_sourcefile = $(LIBRARY:.dll=_test.dll.sources)
-else
-test_sourcefile = $(test_lib).sources
-endif
 test_pdb = $(test_lib:.dll=.pdb)
 test_response = $(depsdir)/$(test_lib).response
 test_makefrag = $(depsdir)/$(test_lib).makefrag
-test_flags = -r:$(test_against) $(test_nunit_ref) $(TEST_MCS_FLAGS)
+test_flags = -r:$(the_lib) $(test_nunit_ref) $(TEST_MCS_FLAGS)
 library_CLEAN_FILES += $(LIBRARY:.dll=_test*.dll) $(LIBRARY:.dll=_test*.pdb) $(test_response) $(test_makefrag)
 
-ifndef btest_lib
 btest_lib = $(LIBRARY:.dll=_btest_$(PROFILE).dll)
 btest_sourcefile = $(LIBRARY:.dll=_btest.dll.sources)
-else
-btest_sourcefile = $(btest_lib).sources
-endif
 btest_pdb = $(btest_lib:.dll=.pdb)
 btest_response = $(depsdir)/$(btest_lib).response
 btest_makefrag = $(depsdir)/$(btest_lib).makefrag
-btest_flags = -r:$(test_against) $(test_nunit_ref) $(TEST_MBAS_FLAGS)
+btest_flags = -r:$(the_lib) $(test_nunit_ref) $(TEST_MBAS_FLAGS)
 library_CLEAN_FILES += $(LIBRARY:.dll=_btest*.dll) $(LIBRARY:.dll=_btest*.pdb) $(btest_response) $(btest_makefrag)
 
 ifndef HAVE_CS_TESTS
@@ -143,11 +148,19 @@ ifndef RUNTIME_HAS_CONSISTENT_GACDIR
 gacdir_flag = /gacdir $(GACDIR)
 endif
 
+ifndef LIBRARY_PACKAGE
+ifdef LIBRARY_COMPAT
+LIBRARY_PACKAGE = compat-$(FRAMEWORK_VERSION)
+else
+LIBRARY_PACKAGE = $(FRAMEWORK_VERSION)
+endif
+endif
+
 install-local: $(gacutil)
-       $(GACUTIL) /i $(the_lib) /f $(gacdir_flag) /root $(GACROOT) /package $(FRAMEWORK_VERSION)
+       $(GACUTIL) /i $(the_lib) /f $(gacdir_flag) /root $(GACROOT) /package $(LIBRARY_PACKAGE)
 
 uninstall-local: $(gacutil)
-       -$(GACUTIL) /u $(LIBRARY_NAME:.dll=) $(gacdir_flag) /root $(GACROOT) /package $(FRAMEWORK_VERSION)
+       -$(GACUTIL) /u $(LIBRARY_NAME:.dll=) $(gacdir_flag) /root $(GACROOT) /package $(LIBRARY_PACKAGE)
 
 endif
 endif
@@ -186,13 +199,13 @@ run-test-ondotnet-local: run-test-ondotnet-lib
 run-test-lib: test-local
        ok=:; \
        $(TEST_RUNTIME) $(TEST_HARNESS) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) /output:TestResult-$(PROFILE).log /exclude:NotWorking,ValueAdd,CAS,InetAccess /xml:TestResult-$(PROFILE).xml $(test_assemblies) || ok=false; \
-       sed '1,/^Tests run: /d' TestResult-$(PROFILE).log; \
+       (echo ''; cat TestResult-$(PROFILE).log) | sed '1,/^Tests run: /d'; \
        $$ok
 
 run-test-ondotnet-lib: test-local
        ok=:; \
        $(TEST_HARNESS) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_ONDOTNET_FLAGS) /exclude=NotDotNet,CAS /output:TestResult-ondotnet-$(PROFILE).log /xml:TestResult-ondotnet-$(PROFILE).xml $(test_assemblies) || ok=false; \
-       sed '1,/^Tests run: /d' TestResult-ondotnet-$(PROFILE).log; \
+       (echo ''; cat TestResult-ondotnet-$(PROFILE).log) | sed '1,/^Tests run: /d'; \
        $$ok
 endif
 
@@ -270,6 +283,7 @@ ifdef LIBRARY_USE_INTERMEDIATE_FILE
        $(SN) $(SNFLAGS) $(LIBRARY_NAME) $(LIBRARY_SNK)
        mv $(LIBRARY_NAME) $@
        test ! -f $(LIBRARY_NAME).mdb || mv $(LIBRARY_NAME).mdb $@.mdb
+       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)
@@ -292,7 +306,7 @@ endif
 
 ifdef HAVE_CS_TESTS
 
-$(test_lib): $(test_dep) $(test_response) $(test_nunit_dep)
+$(test_lib): $(the_lib) $(test_response) $(test_nunit_dep)
        $(TEST_COMPILE) -target:library -out:$@ $(test_flags) @$(test_response)
 
 $(test_response): $(test_sourcefile)
@@ -309,7 +323,7 @@ endif
 
 ifdef HAVE_VB_TESTS
 
-$(btest_lib): $(test_dep) $(btest_response) $(test_nunit_dep)
+$(btest_lib): $(the_lib) $(btest_response) $(test_nunit_dep)
        $(BTEST_COMPILE) -target:library -out:$@ $(btest_flags) @$(btest_response)
 
 $(btest_response): $(btest_sourcefile)