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