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