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