Fix mcs build to use Thread.Abort.
[mono.git] / mcs / mcs / Makefile
1 # To produce a debugging parser, use the version that says "-cvt"
2 JAY_FLAGS=-c
3 # JAY_FLAGS=-cvt
4
5 thisdir := mcs
6 SUBDIRS := 
7 include ../build/rules.make
8
9 EXTRA_DISTFILES = \
10         mcs.csproj              \
11         mcs.sln         \
12         cs-parser.jay           \
13         mcs.exe.sources
14
15 LIB_REFS = System System.Core System.Xml
16
17 ifeq (basic, $(PROFILE))
18 PROGRAM = basic.exe
19 sourcefile = mcs.exe.sources
20 else
21 PROGRAM_USE_INTERMEDIATE_FILE = true
22 PROGRAM = mcs.exe
23 the_libdir = $(topdir)/class/lib/build/
24 LOCAL_MCS_FLAGS += -lib:$(topdir)/class/lib/build -debug
25 endif
26
27 LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE
28
29 ifndef NO_THREAD_ABORT
30 REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
31 endif
32
33 LOCAL_MCS_FLAGS += $(REFERENCE_SOURCES_FLAGS)
34
35 PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/4.5
36
37 PROGRAM_COMPILE = $(BOOT_COMPILE)
38
39 BUILT_SOURCES = cs-parser.cs
40
41 CLEAN_FILES += y.output
42
43 %-parser.cs: %-parser.jay $(topdir)/jay/skeleton.cs
44         $(topdir)/jay/jay $(JAY_FLAGS) < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
45
46 KEEP_OUTPUT_FILE_COPY = yes
47
48 include ../build/executable.make
49
50 #
51 # Below this line we have local targets used for testing and development
52 #
53
54 # Testing targets
55
56 TIME = time
57
58 # This used to be called test, but that conflicts with the global
59 # recursive target.
60
61 btest: mcs2.exe mcs3.exe
62         ls -l mcs2.exe mcs3.exe
63
64 mcs2.exe: $(PROGRAM)
65         $(TIME) $(RUNTIME) $(RUNTIME_FLAGS) $(PROGRAM) $(USE_MCS_FLAGS) -target:exe -out:$@ $(BUILT_SOURCES) @$(response)
66
67 mcs3.exe: mcs2.exe
68         $(TIME) $(RUNTIME) $(RUNTIME_FLAGS) ./mcs2.exe $(USE_MCS_FLAGS) -target:exe -out:$@ $(BUILT_SOURCES) @$(response)
69
70 wc:
71         wc -l $(BUILT_SOURCES) `cat $(sourcefile)`
72
73 # we need this because bash tries to use its own crappy timer
74 FRIENDLY_TIME = $(shell which time) -f'%U seconds'
75
76 do-time : $(PROGRAM)
77         @ echo -n "Run 1:   "
78         @ rm -f mcs2.exe
79         @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs2.exe > /dev/null || (echo FAILED; exit 1)
80         @ echo -n "Run 2:   "
81         @ rm -f mcs3.exe
82         @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs3.exe > /dev/null || (echo FAILED; exit 1)
83         @ $(MAKE) do-corlib
84
85 do-corlib:
86         @ echo -n "corlib:  "
87         @ rm -f ../class/lib/mscorlib.dll
88         @ cd ../class/corlib ; $(MAKE) BOOTSTRAP_MCS='$(FRIENDLY_TIME) mono $$(topdir)/class/lib/$(PROFILE)/mcs.exe' > /dev/null || (echo FAILED; exit 1)
89
90 PROFILER=default
91
92 do-gettext:
93         xgettext --keyword='Report.Error:3' --keyword='Report.Error:2' --keyword='Report.Warning:3' --keyword='Report.Warning:2' -o mcs.po --language='C#' `cat gmcs.exe.sources | grep -v /`
94
95 profile : $(PROGRAM)
96         $(RUNTIME) $(RUNTIME_FLAGS) --profile=$(PROFILER) $(PROGRAM) $(USE_MCS_FLAGS) -target:exe -out:mcs2.exe $(BUILT_SOURCES) @$(response)
97
98 debug-parser:
99         rm cs-parser.cs
100         $(MAKE) JAY_FLAGS=-cvt
101
102 #
103 # quick hack target, to quickly develop the gmcs compiler
104 # Update manually.
105
106 q: cs-parser.cs qh
107         echo 'System.Console.WriteLine ("Hello");' | mono csharp.exe
108         echo -e 'using System;\nConsole.WriteLine ("hello");' | mono csharp.exe
109         echo -e '"foo" == "bar";' | mono csharp.exe
110         echo -e 'var a = 1;\na + 2;' | mono csharp.exe
111         echo -e 'int j;\nj = 1;' | mono csharp.exe
112         echo -e 'var a = new int[]{1,2,3};\nfrom x in a select x;' | mono csharp.exe
113         echo -e 'var a = from f in System.IO.Directory.GetFiles ("/tmp") where f == "passwd" select f;' | mono csharp.exe
114
115