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