Hide boostrap compiler for people looking for mcs.exe
[mono.git] / mcs / mcs / Makefile
1 thisdir := mcs
2 SUBDIRS := 
3 include ../build/rules.make
4
5 EXTRA_DISTFILES = \
6         mcs.csproj              \
7         compiler.doc            \
8         mcs.sln         \
9         cs-parser.jay           \
10         mcs.exe.sources         \
11         NOTES                   \
12         TODO                    \
13         ikvm.cs
14
15 ifeq (basic, $(PROFILE))
16 PROGRAM = $(topdir)/class/lib/$(PROFILE)/basic.exe
17 sourcefile = mcs.exe.sources
18 else
19 PROGRAM = $(topdir)/class/lib/build/mcs.exe
20 LOCAL_MCS_FLAGS += -lib:$(topdir)/class/lib/build
21 endif
22
23 LOCAL_MCS_FLAGS += -d:STATIC
24
25 PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/4.0
26
27 PROGRAM_COMPILE = $(BOOT_COMPILE)
28
29 BUILT_SOURCES = cs-parser.cs
30
31 CLEAN_FILES += y.output
32
33 # Use -cvt for parser debug version
34 %-parser.cs: %-parser.jay $(topdir)/jay/skeleton.cs
35         $(topdir)/jay/jay -cv < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
36
37
38 KEEP_OUTPUT_FILE_COPY = yes
39
40 include ../build/executable.make
41
42 csproj-local:
43         config_file=`basename $(PROGRAM) .exe`-$(PROFILE).input; \
44         echo $(thisdir):$$config_file >> $(topdir)/../msvc/scripts/order; \
45         (echo $(is_boot); \
46         echo $(BOOTSTRAP_MCS);  \
47         echo $(USE_MCS_FLAGS) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS); \
48         echo $(PROGRAM); \
49         echo $(BUILT_SOURCES); \
50         echo $(PROGRAM); \
51         echo $(response)) > $(topdir)/../msvc/scripts/inputs/$$config_file
52         
53 ifeq (basic, $(PROFILE))
54 install-local:
55         $(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
56         $(INSTALL_BIN) $(PROGRAM) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
57         test ! -f $(PROGRAM).mdb || $(INSTALL_BIN) $(PROGRAM).mdb $(DESTDIR)$(PROGRAM_INSTALL_DIR)
58 endif
59
60 #
61 # Below this line we have local targets used for testing and development
62 #
63
64 # Testing targets
65
66 TIME = time
67
68 # This used to be called test, but that conflicts with the global
69 # recursive target.
70
71 btest: mcs2.exe mcs3.exe
72         ls -l mcs2.exe mcs3.exe
73
74 mcs2.exe: $(PROGRAM)
75         $(TIME) $(RUNTIME) $(RUNTIME_FLAGS) $(PROGRAM) $(USE_MCS_FLAGS) -target:exe -out:$@ $(BUILT_SOURCES) @$(response)
76
77 mcs3.exe: mcs2.exe
78         $(TIME) $(RUNTIME) $(RUNTIME_FLAGS) ./mcs2.exe $(USE_MCS_FLAGS) -target:exe -out:$@ $(BUILT_SOURCES) @$(response)
79
80 wc:
81         wc -l $(BUILT_SOURCES) `cat $(sourcefile)`
82
83 ctest: 
84         rm -f mcs2.exe mcs3.exe
85         $(MAKE) USE_MCS_FLAGS="-d:NET_1_1 -d:ONLY_1_1" btest
86
87 # we need this because bash tries to use its own crappy timer
88 FRIENDLY_TIME = $(shell which time) -f'%U seconds'
89
90 do-time : $(PROGRAM)
91         @ echo -n "Run 1:   "
92         @ rm -f mcs2.exe
93         @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs2.exe > /dev/null || (echo FAILED; exit 1)
94         @ echo -n "Run 2:   "
95         @ rm -f mcs3.exe
96         @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs3.exe > /dev/null || (echo FAILED; exit 1)
97         @ $(MAKE) do-corlib
98
99 do-corlib:
100         @ echo -n "corlib:  "
101         @ rm -f ../class/lib/mscorlib.dll
102         @ cd ../class/corlib ; $(MAKE) BOOTSTRAP_MCS='$(FRIENDLY_TIME) mono $$(topdir)/class/lib/$(PROFILE)/mcs.exe' > /dev/null || (echo FAILED; exit 1)
103
104 PROFILER=default
105
106 do-gettext:
107         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 /`
108
109 profile : $(PROGRAM)
110         $(RUNTIME) $(RUNTIME_FLAGS) --profile=$(PROFILER) $(PROGRAM) $(USE_MCS_FLAGS) -target:exe -out:mcs2.exe $(BUILT_SOURCES) @$(response)
111
112 #
113 # quick hack target, to quickly develop the gmcs compiler
114 # Update manually.
115
116 q: cs-parser.cs qh
117         echo 'System.Console.WriteLine ("Hello");' | mono csharp.exe
118         echo -e 'using System;\nConsole.WriteLine ("hello");' | mono csharp.exe
119         echo -e '"foo" == "bar";' | mono csharp.exe
120         echo -e 'var a = 1;\na + 2;' | mono csharp.exe
121         echo -e 'int j;\nj = 1;' | mono csharp.exe
122         echo -e 'var a = new int[]{1,2,3};\nfrom x in a select x;' | mono csharp.exe
123         echo -e 'var a = from f in System.IO.Directory.GetFiles ("/tmp") where f == "passwd" select f;' | mono csharp.exe
124
125