098a1a0a7e99867839f7d95f3f1de8f72a6553f7
[mono.git] / mcs / mcs / Makefile
1 thisdir := mcs
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         genericparser.cs                \
25         interface.cs                    \
26         iterators.cs                    \
27         literal.cs                      \
28         location.cs                     \
29         modifiers.cs                    \
30         namespace.cs                    \
31         parameter.cs                    \
32         pending.cs                      \
33         report.cs                       \
34         rootcontext.cs                  \
35         statement.cs                    \
36         support.cs                      \
37         typemanager.cs                  \
38         symbolwriter.cs                 \
39         tree.cs
40
41 all_sources = $(COMPILER_SOURCES) cs-parser.cs
42
43 DISTFILES = \
44         $(COMPILER_SOURCES)     \
45         compiler.csproj         \
46         compiler.csproj.user    \
47         compiler.doc            \
48         compiler.sln            \
49         cs-parser.jay           \
50         mcs.exe.config          \
51         NOTES                   \
52         TODO
53
54 all-local: mcs.exe
55
56 install-local: mcs.exe
57         $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/bin
58         $(INSTALL_BIN) mcs.exe $(DESTDIR)$(prefix)/bin
59
60 uninstall-local:
61         -rm -f $(DESTDIR)$(prefix)/bin/mcs.exe
62
63 test-local run-test-local:
64
65 clean-local:
66         rm -f *.exe *.pdb cs-parser.cs y.output
67
68 dist-local: dist-default
69
70 mcs.exe: $(all_sources)
71         $(BOOT_COMPILE) /target:exe /out:$@ $^
72
73 cs-parser.cs: cs-parser.jay $(topdir)/jay/skeleton.cs
74         $(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $< >$@
75
76 # Testing targets
77
78 TIME = time
79
80 # This used to be called test, but that conflicts with the global
81 # recursive target.
82
83 btest: mcs2.exe mcs3.exe
84         ls -l mcs2.exe mcs3.exe
85
86 mcs2.exe: mcs.exe
87         $(TIME) $(RUNTIME) ./mcs.exe $(USE_MCS_FLAGS) /target:exe /out:$@ $(all_sources)
88
89 mcs3.exe: mcs2.exe
90         $(TIME) $(RUNTIME) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:$@ $(all_sources)
91
92 wc:
93         wc -l $(all_sources)
94
95 ctest: 
96         -rm mcs2.exe mcs3.exe
97         make btest USE_MCS_FLAGS= 
98
99 # we need this because bash tries to use its own crappy timer
100 FRIENDLY_TIME = $(shell which time) -f'%U seconds'
101
102 do-time : mcs.exe
103         @ echo -n "Run 1:   "
104         @ $(FRIENDLY_TIME) $(RUNTIME) ./mcs.exe $(USE_MCS_FLAGS) /target:exe /out:mcs2.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
105         @ echo -n "Run 2:   "
106         @ $(FRIENDLY_TIME) $(RUNTIME) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:mcs3.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
107         @ echo -n "corlib:  "
108         @ rm -f ../class/lib/mscorlib.dll
109         @ (cd ../class/corlib ; make BOOTSTRAP_MCS="$(FRIENDLY_TIME) mono ../../mcs/mcs.exe" > /dev/null ) || (echo FAILED; exit 1)
110
111 do-corlib:
112         @ echo -n "corlib:  "
113         @ rm -f ../class/lib/mscorlib.dll
114         @ (cd ../class/corlib ; make BOOTSTRAP_MCS="$(FRIENDLY_TIME) mono ../../mcs/mcs.exe" > /dev/null ) || (echo FAILED; exit 1)
115
116 PROFILER=default
117
118 profile : mcs.exe
119         $(RUNTIME) --profile=$(PROFILER) ./mcs.exe $(USE_MCS_FLAGS) /target:exe /out:mcs2.exe $(all_sources)
120
121 response:
122         echo $(all_sources) > res