d88614fa5147ddf79c2d4d46744d0ebc47f2ae78
[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)/bin
57         $(INSTALL_BIN) gmcs.exe $(DESTDIR)$(prefix)/bin
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:$(MONO_PATH)" $(BOOT_COMPILE) /target:exe /out:$@ $^
71
72 cs-parser.cs: cs-parser.jay $(topdir)/jay/skeleton.cs
73         $(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $< >$@
74
75 # Testing targets
76
77 TIME = 
78
79 # This used to be called test, but that conflicts with the global
80 # recursive target.
81
82 btest: mcs2.exe mcs3.exe
83         ls -l mcs2.exe mcs3.exe
84
85 mcs2.exe: gmcs.exe
86         $(TIME) $(RUNTIME) ./gmcs.exe $(USE_MCS_FLAGS) /target:exe /out:$@ $(all_sources)
87
88 mcs3.exe: mcs2.exe
89         $(TIME) $(RUNTIME) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:$@ $(all_sources)
90
91 wc:
92         wc -l $(all_sources)
93
94 ctest: 
95         -rm mcs2.exe mcs3.exe
96         make btest USE_MCS_FLAGS= 
97
98 # we need this because bash tries to use its own crappy timer
99 FRIENDLY_TIME = $(shell which time) -f'%U seconds'
100
101 do-time : mcs.exe
102         @ echo -n "Run 1:   "
103          $(FRIENDLY_TIME) $(RUNTIME) ./mcs.exe $(USE_MCS_FLAGS) /target:exe /out:mcs2.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
104         @ echo -n "Run 2:   "
105         @ $(FRIENDLY_TIME) $(RUNTIME) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:mcs3.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
106         @ echo -n "corlib:  "
107         @ rm -f ../class/lib/mscorlib.dll
108         @ (cd ../class/corlib ; make BOOTSTRAP_MCS="$(FRIENDLY_TIME) mono ../../mcs/mcs.exe" > /dev/null ) || (echo FAILED; exit 1)
109
110 do-corlib:
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 PROFILER=default
116
117 profile : mcs.exe
118         $(RUNTIME) --profile=$(PROFILER) ./mcs.exe $(USE_MCS_FLAGS) /target:exe /out:mcs2.exe $(all_sources)
119
120 response:
121         echo $(all_sources) > res