2004-08-09 Atsushi Enomoto <atsushi@ximian.com>
[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
41 all_sources = $(COMPILER_SOURCES) cs-parser.cs
42
43 DISTFILES = \
44         $(COMPILER_SOURCES)     \
45         compiler.csproj         \
46         compiler.doc            \
47         compiler.sln            \
48         cs-parser.jay           \
49         mcs.exe.config          \
50         NOTES                   \
51         TODO
52 #uncomment to enable some debug stuff
53 #DEBUG_FLAGS=/define:MCS_DEBUG
54
55 all-local: gmcs.exe
56
57 install-local: gmcs.exe
58         $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/lib/mono/2.0
59         $(INSTALL_BIN) gmcs.exe $(DESTDIR)$(prefix)/lib/mono/2.0
60
61 uninstall-local:
62         -rm -f $(DESTDIR)$(prefix)/bin/mcs.exe
63
64 test-local run-test-local:
65
66 clean-local:
67         rm -f *.exe *.pdb cs-parser.cs y.output
68
69 dist-local: dist-default
70
71 gmcs.exe: $(all_sources)
72         MONO_PATH="../class/lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" mono ../mcs/mcs.exe $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $^
73
74 gmcs2.exe: $(all_sources)
75         MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time mcs -2 /target:exe /debug /out:$@ $^ $(DEBUG_FLAGS) 
76
77 gmcs3.exe: $(all_sources)
78         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:$@ $^
79
80 gmcs4.exe: $(all_sources)
81         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:$@ $^
82
83 cs-parser.cs: cs-parser.jay $(topdir)/jay/skeleton.cs
84         $(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
85
86 # Testing targets
87
88 TIME = 
89
90 # This used to be called test, but that conflicts with the global
91 # recursive target.
92
93 btest: gmcs2.exe gmcs3.exe gmcs4.exe
94         ls -l gmcs3.exe gmcs4.exe
95
96 wc:
97         wc -l $(all_sources)
98
99 ctest: 
100         rm -f gmcs3.exe mcs4.exe
101         make btest USE_MCS_FLAGS= 
102
103 # we need this because bash tries to use its own crappy timer
104 FRIENDLY_TIME = $(shell which time) -f'%U seconds'
105
106 do-time : mcs.exe
107         @ echo -n "Run 1:   "
108          $(FRIENDLY_TIME) $(RUNTIME) ./mcs.exe $(USE_MCS_FLAGS) /target:exe /out:mcs2.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
109         @ echo -n "Run 2:   "
110         @ $(FRIENDLY_TIME) $(RUNTIME) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:mcs3.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
111         @ echo -n "corlib:  "
112         @ rm -f ../class/lib/mscorlib.dll
113         @ (cd ../class/corlib ; make BOOTSTRAP_MCS="$(FRIENDLY_TIME) mono ../../mcs/mcs.exe" > /dev/null ) || (echo FAILED; exit 1)
114
115 do-corlib:
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 PROFILER=default
121
122 profile : gmcs2.exe
123         make gmcs3.exe RUNTIME="$(RUNTIME) --profile"
124
125 response:
126         echo $(all_sources) > res