- Added missing default
[mono.git] / mcs / gmcs / Makefile
1 thisdir := gmcs
2 SUBDIRS := 
3 include ../build/rules.make
4
5 COMPILER_SOURCES = \
6         AssemblyInfo.cs                 \
7         anonymous.cs                    \
8         assign.cs                       \
9         attribute.cs                    \
10         driver.cs                       \
11         cs-tokenizer.cs                 \
12         cfold.cs                        \
13         class.cs                        \
14         codegen.cs                      \
15         const.cs                        \
16         constant.cs                     \
17         convert.cs                      \
18         decl.cs                         \
19         delegate.cs                     \
20         enum.cs                         \
21         ecore.cs                        \
22         expression.cs                   \
23         flowanalysis.cs                 \
24         generic.cs                      \
25         iterators.cs                    \
26         literal.cs                      \
27         location.cs                     \
28         modifiers.cs                    \
29         namespace.cs                    \
30         parameter.cs                    \
31         pending.cs                      \
32         report.cs                       \
33         rootcontext.cs                  \
34         statement.cs                    \
35         support.cs                      \
36         typemanager.cs                  \
37         symbolwriter.cs                 \
38         tree.cs                         \
39         CryptoConvert.cs                \
40         $(topdir)/class/Mono.CSharp.Debugger/MonoSymbolFile.cs  \
41         $(topdir)/class/Mono.CSharp.Debugger/MonoSymbolTable.cs \
42         $(topdir)/class/Mono.CSharp.Debugger/MonoSymbolWriter.cs
43
44 all_sources = $(COMPILER_SOURCES) cs-parser.cs
45
46 DISTFILES = \
47         $(COMPILER_SOURCES)     \
48         compiler.csproj         \
49         compiler.doc            \
50         compiler.sln            \
51         cs-parser.jay           \
52         gmcs.exe.config         \
53         NOTES                   \
54         TODO
55 #uncomment to enable some debug stuff
56 #DEBUG_FLAGS=/define:MCS_DEBUG
57
58 all-local: gmcs.exe
59
60 install-local: gmcs.exe
61         $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/lib/mono/2.0
62         $(INSTALL_BIN) gmcs.exe $(DESTDIR)$(prefix)/lib/mono/2.0
63         $(INSTALL_DATA) gmcs.exe.config $(DESTDIR)$(prefix)/lib/mono/2.0
64         $(INSTALL_DATA) gmcs.exe.mdb $(DESTDIR)$(prefix)/lib/mono/2.0
65
66 uninstall-local:
67         -rm -f $(DESTDIR)$(prefix)/bin/mcs.exe
68
69 test-local run-test-local:
70
71 clean-local:
72         rm -f *.exe *.pdb cs-parser.cs y.output *.mdb
73
74 dist-local: dist-default
75
76 gmcs.exe: $(all_sources)
77         MONO_PATH="../class/lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" mono ../mcs/mcs.exe $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $^
78
79 gmcs2.exe: $(all_sources)
80         MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time mcs -2 /target:exe /debug /out:$@ $^ $(DEBUG_FLAGS) 
81
82 gmcs3.exe: $(all_sources)
83         MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time $(RUNTIME) ./gmcs2.exe $(USE_MCS_FLAGS) $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $^
84
85 gmcs4.exe: $(all_sources)
86         MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time $(RUNTIME) ./gmcs3.exe $(USE_MCS_FLAGS) $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $^
87
88 cs-parser.cs: cs-parser.jay $(topdir)/jay/skeleton.cs
89         $(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
90
91 # Testing targets
92
93 TIME = 
94
95 # This used to be called test, but that conflicts with the global
96 # recursive target.
97
98 btest: gmcs2.exe gmcs3.exe gmcs4.exe
99         ls -l gmcs3.exe gmcs4.exe
100
101 wc:
102         wc -l $(all_sources)
103
104 ctest: 
105         rm -f gmcs3.exe mcs4.exe
106         make btest USE_MCS_FLAGS= 
107
108 # we need this because bash tries to use its own crappy timer
109 FRIENDLY_TIME = $(shell which time) -f'%U seconds'
110
111 do-time : mcs.exe
112         @ echo -n "Run 1:   "
113          $(FRIENDLY_TIME) $(RUNTIME) ./mcs.exe $(USE_MCS_FLAGS) /target:exe /out:mcs2.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
114         @ echo -n "Run 2:   "
115         @ $(FRIENDLY_TIME) $(RUNTIME) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:mcs3.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
116         @ echo -n "corlib:  "
117         @ rm -f ../class/lib/mscorlib.dll
118         @ (cd ../class/corlib ; make BOOTSTRAP_MCS="$(FRIENDLY_TIME) mono ../../mcs/mcs.exe" > /dev/null ) || (echo FAILED; exit 1)
119
120 do-corlib:
121         @ echo -n "corlib:  "
122         @ rm -f ../class/lib/mscorlib.dll
123         @ (cd ../class/corlib ; make BOOTSTRAP_MCS="$(FRIENDLY_TIME) mono ../../mcs/mcs.exe" > /dev/null ) || (echo FAILED; exit 1)
124
125 PROFILER=default
126
127 profile : gmcs2.exe
128         make gmcs3.exe RUNTIME="$(RUNTIME) --profile"
129
130 response:
131         echo $(all_sources) > res