Merge pull request #1319 from directhex/systemwide-per-arch-aot-cache
[mono.git] / mcs / tools / xbuild / xbuild_test.make
1 XBUILD_DATA_DIR=$(topdir)/tools/xbuild/data
2 XBUILD_PROFILE_DIR=$(topdir)/class/lib/$(PROFILE)
3
4 # makes xbuild look in the class/lib/$PROFILE build directories for targets etc
5 export TESTING_MONO=a
6
7 ifeq (4.0, $(FRAMEWORK_VERSION))
8 NO_TEST=true
9 else
10 test-local: copy-targets $(test_lib).config
11 clean-local: clean-targets clean-test-config
12 endif
13
14 xbuild-net4-fail:
15         @echo "The net_4_0 profile contains reference assemblies only and cannot be installed/tested as an xbuild toolset"
16         @exit 1
17
18 $(test_lib).config: $(XBUILD_DATA_DIR)/xbuild.exe.config.in
19         sed -e 's/@ASM_VERSION@/$(XBUILD_ASSEMBLY_VERSION)/g' $(XBUILD_DATA_DIR)/xbuild.exe.config.in > $(test_lib).config
20
21 clean-test-config:
22         rm -f $(test_lib).config
23
24 copy-targets: copy-targets-$(XBUILD_VERSION)
25
26 clean-targets: clean-targets-$(XBUILD_VERSION)
27
28 XBUILD_4_0_PROFILE_DIR=$(topdir)/class/lib/net_4_5
29 XBUILD_12_0_PROFILE_DIR=$(topdir)/class/lib/xbuild_12
30 XBUILD_14_0_PROFILE_DIR=$(topdir)/class/lib/xbuild_14
31
32 copy-targets-4.0:
33         cp $(XBUILD_DATA_DIR)/4.0/Microsoft.Common.targets $(XBUILD_4_0_PROFILE_DIR)
34         cp $(XBUILD_DATA_DIR)/4.0/Microsoft.Common.tasks $(XBUILD_4_0_PROFILE_DIR)
35         cp $(XBUILD_DATA_DIR)/4.0/Microsoft.CSharp.targets $(XBUILD_4_0_PROFILE_DIR)
36         cp $(XBUILD_DATA_DIR)/Microsoft.VisualBasic.targets $(XBUILD_4_0_PROFILE_DIR)
37
38 copy-targets-12.0:
39         cp $(XBUILD_DATA_DIR)/12.0/Microsoft.Common.targets $(XBUILD_12_0_PROFILE_DIR)
40         cp $(XBUILD_DATA_DIR)/12.0/Microsoft.Common.tasks $(XBUILD_12_0_PROFILE_DIR)
41         cp $(XBUILD_DATA_DIR)/12.0/Microsoft.CSharp.targets $(XBUILD_12_0_PROFILE_DIR)
42         cp $(XBUILD_DATA_DIR)/Microsoft.VisualBasic.targets $(XBUILD_12_0_PROFILE_DIR)
43
44 copy-targets-14.0:
45         cp $(XBUILD_DATA_DIR)/14.0/Microsoft.Common.targets $(XBUILD_14_0_PROFILE_DIR)
46         cp $(XBUILD_DATA_DIR)/14.0/Microsoft.Common.tasks $(XBUILD_14_0_PROFILE_DIR)
47         cp $(XBUILD_DATA_DIR)/14.0/Microsoft.CSharp.targets $(XBUILD_14_0_PROFILE_DIR)
48         cp $(XBUILD_DATA_DIR)/Microsoft.VisualBasic.targets $(XBUILD_14_0_PROFILE_DIR)
49
50 clean-targets-4.0:
51         rm -f $(XBUILD_4_0_PROFILE_DIR)/Microsoft.Common.targets
52         rm -f $(XBUILD_4_0_PROFILE_DIR)/Microsoft.Common.tasks
53         rm -f $(XBUILD_4_0_PROFILE_DIR)/Microsoft.CSharp.targets
54         rm -f $(XBUILD_4_0_PROFILE_DIR)/Microsoft.VisualBasic.targets
55
56 clean-targets-12.0:
57         rm -f $(XBUILD_12_0_PROFILE_DIR)/Microsoft.Common.targets
58         rm -f $(XBUILD_12_0_PROFILE_DIR)/Microsoft.Common.tasks
59         rm -f $(XBUILD_12_0_PROFILE_DIR)/Microsoft.CSharp.targets
60         rm -f $(XBUILD_12_0_PROFILE_DIR)/Microsoft.VisualBasic.targets
61
62 clean-targets-14.0:
63         rm -f $(XBUILD_14_0_PROFILE_DIR)/Microsoft.Common.targets
64         rm -f $(XBUILD_14_0_PROFILE_DIR)/Microsoft.Common.tasks
65         rm -f $(XBUILD_14_0_PROFILE_DIR)/Microsoft.CSharp.targets
66         rm -f $(XBUILD_14_0_PROFILE_DIR)/Microsoft.VisualBasic.targets
67
68 #allow tests to find older versions of libs and targets
69 ifneq (4.0, $(XBUILD_VERSION))
70 TEST_MONO_PATH := $(topdir)/class/lib/net_4_5$(PLATFORM_PATH_SEPARATOR)$(TEST_MONO_PATH)
71 copy-targets: copy-targets-4.0
72 clean-targets: clean-targets-4.0
73 endif