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