2009-06-17 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / errors / Makefile
1 thisdir = errors
2 SUBDIRS = 
3 include ../build/rules.make
4
5 with_mono_path = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH"
6
7 ifeq (net_1_1, $(PROFILE))
8 # force this, we don't case if CSC is broken. This also
9 # means we can use --options, yay.
10
11 MCS = $(with_mono_path) $(INTERNAL_MCS)
12 else
13 EXTRA_SUPPORT_FILES = CSFriendAssembly-lib.dll GCS0122-2-lib.dll GCS0730-lib.dll GCS0733-lib.dll GCS1685-lib.dll
14 endif
15
16 ilasm = $(topdir)/class/lib/$(PROFILE)/ilasm.exe
17 ILASM = $(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $(ilasm)
18
19 DISTFILES = \
20         CONTRIBUTORS_README     \
21         errors.txt              \
22         do-tests.pl             \
23         $(wildcard *.cs)        \
24         $(wildcard *.il)        \
25         $(wildcard *.inc)       \
26         $(wildcard *.pub)       \
27         $(wildcard *.snk)       \
28         $(wildcard *.response)  \
29         $(wildcard known-issues-*)
30
31 TEST_SUPPORT_FILES = \
32         CS0118-2-lib.dll CS0122-10-lib.dll CS0122-14-lib.dll CS0122-15-lib.dll CS0122-19-lib.dll CS0144-3-lib.dll \
33         CS0205-3-lib.dll \
34         CS0229-3-lib.dll CS0229-4-lib.dll \
35         CS0433-lib.dll CS0433-2-lib.dll \
36         CS0534-3-lib.dll CS0534-4-lib.dll CS0571-3-lib.dll CS0571-5-lib.dll CS0571-6-lib.dll \
37         CS0612-2-lib.dll CS0618-2-lib.dll CS0619-8-lib.dll CS0619-17-lib.dll CS0619-32-lib.dll CS0619-33-lib.dll CS0619-36-lib.dll CS0619-42-lib.dll \
38         CS0619-43-lib.dll CS1546-lib.dll CS0619-51-lib.dll CS1509-module.dll CS1681-2-lib.dll \
39         CS2015-lib.dll CS3005-16-lib.dll CS3013-module.dll CSExternAlias-lib.dll \
40         $(EXTRA_SUPPORT_FILES) 
41
42 # mention all targets
43 all-local $(STD_TARGETS:=-local):
44
45 VALID_PROFILE := $(filter net_1_1 net_2_0 net_2_1, $(PROFILE))
46 ifdef VALID_PROFILE
47
48 check: run-mcs-tests 
49
50 # again, run-test is when the tests actually happen, so
51 # don't compile on make test.
52
53 test-local:
54         @:
55
56 run-test-local: clean-local run-mcs-tests
57
58 test-everything:
59         $(MAKE) PROFILE=net_1_1 run-test
60         $(MAKE) PROFILE=net_2_0 run-test
61
62 ifeq (net_2_1, $(PROFILE))
63 COMPILER_NAME = smcs
64 TEST_PATTERN = '*cs*.cs'
65 LOCAL_RUNTIME_FLAGS = --security=temporary-smcs-hack
66 endif
67 ifeq (net_2_0, $(PROFILE))
68 COMPILER_NAME = gmcs
69 TEST_PATTERN = '*cs*.cs'
70 endif
71 ifeq (net_1_1, $(PROFILE))
72 COMPILER_NAME = mcs
73 TEST_PATTERN = 'cs*.cs'
74 endif
75
76 COMPILER = $(topdir)/class/lib/$(PROFILE)/$(COMPILER_NAME).exe
77 TESTER = MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(LOCAL_RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe
78
79 run-mcs-tests: $(TEST_SUPPORT_FILES)
80         $(TESTER) -mode:neg -files:$(TEST_PATTERN) -compiler:$(COMPILER) -issues:known-issues-$(COMPILER_NAME) -log:$(COMPILER_NAME).log $(TESTER_OPTIONS)
81
82 cecil:
83         $(TESTER) -mode:neg -files:$(TEST_PATTERN) -compiler:../tests/gmcs.exe -issues:known-issues-$(COMPILER_NAME) -log:$(COMPILER_NAME).log $(TESTER_OPTIONS) -verbose
84
85 clean-local:
86         rm -f *.exe *.dll *.log *.mdb dummy.xml *.junk
87
88 dist-local: dist-default
89
90 install-local uninstall-local:
91
92 %-lib.dll: %-lib.cs
93         $(CSCOMPILE) /target:library /out:$@ $<
94
95 %-module.dll: %-module.cs
96         $(CSCOMPILE) /target:module /out:$@ $<
97
98 %-lib.dll: %-lib.il
99         $(ILASM) /dll /out:$@ $<
100
101 endif