Fix typo
[mono.git] / mcs / mcs / Makefile
1 thisdir := mcs
2 SUBDIRS := 
3 include ../build/rules.make
4
5 BUILT_SOURCES = cs-parser.cs
6
7 EXTRA_DISTFILES = \
8         compiler.csproj         \
9         compiler.doc            \
10         compiler.sln            \
11         cs-parser.jay           \
12         NOTES                   \
13         TODO
14
15 PROGRAM = $(topdir)/class/lib/$(PROFILE)/mcs.exe
16 PROGRAM_COMPILE = $(BOOT_COMPILE)
17
18 CLEAN_FILES = y.output *.exe *.mdb
19
20 cs-parser.cs: cs-parser.jay $(topdir)/jay/skeleton.cs
21         $(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
22
23 ifeq (net_2_0_bootstrap, $(PROFILE))
24
25 all-local $(STD_TARGETS:=-local):
26         @:
27
28 all-local: $(PROGRAM) $(PROGRAM).config
29 clean-local: clean-program
30 clean-program:
31         rm -f $(PROGRAM) $(PROGRAM).config
32
33 progdir = $(dir $(PROGRAM))
34
35 $(progdir):
36         $(MKINSTALLDIRS) $@
37
38 $(PROGRAM): $(topdir)/class/lib/default/mcs.exe | $(progdir)
39         cp $< $@
40
41 $(PROGRAM).config: $(topdir)/gmcs/gmcs.exe.config | $(progdir)
42         cp $< $@
43
44 else
45 include ../build/executable.make
46 endif
47
48 ifeq (default, $(PROFILE))
49 # Utility rule to make debugging somewhat easier.
50 all-local: mcs.exe
51 mcs.exe: $(PROGRAM)
52         cp -p $< $@
53         test ! -f $<.mdb || cp -p $<.mdb $@.mdb
54 endif
55
56 # Testing targets
57
58 TIME = time
59
60 # This used to be called test, but that conflicts with the global
61 # recursive target.
62
63 btest: mcs2.exe mcs3.exe
64         ls -l mcs2.exe mcs3.exe
65
66 mcs2.exe: $(PROGRAM)
67         $(TIME) $(RUNTIME) $(RUNTIME_FLAGS) $(PROGRAM) $(USE_MCS_FLAGS) -target:exe -out:$@ $(BUILT_SOURCES) @$(response)
68
69 mcs3.exe: mcs2.exe
70         $(TIME) $(RUNTIME) $(RUNTIME_FLAGS) ./mcs2.exe $(USE_MCS_FLAGS) -target:exe -out:$@ $(BUILT_SOURCES) @$(response)
71
72 wc:
73         wc -l $(BUILT_SOURCES) `cat $(sourcefile)`
74
75 ctest: 
76         rm -f mcs2.exe mcs3.exe
77         $(MAKE) USE_MCS_FLAGS="-d:NET_1_1 -d:ONLY_1_1" btest
78
79 # we need this because bash tries to use its own crappy timer
80 FRIENDLY_TIME = $(shell which time) -f'%U seconds'
81
82 do-time : $(PROGRAM)
83         @ echo -n "Run 1:   "
84         @ rm -f mcs2.exe
85         @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs2.exe > /dev/null || (echo FAILED; exit 1)
86         @ echo -n "Run 2:   "
87         @ rm -f mcs3.exe
88         @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs3.exe > /dev/null || (echo FAILED; exit 1)
89         @ $(MAKE) do-corlib
90
91 do-corlib:
92         @ echo -n "corlib:  "
93         @ rm -f ../class/lib/mscorlib.dll
94         @ cd ../class/corlib ; $(MAKE) BOOTSTRAP_MCS='$(FRIENDLY_TIME) mono $$(topdir)/class/lib/$(PROFILE)/mcs.exe' > /dev/null || (echo FAILED; exit 1)
95
96 PROFILER=default
97
98 profile : $(PROGRAM)
99         $(RUNTIME) $(RUNTIME_FLAGS) --profile=$(PROFILER) $(PROGRAM) $(USE_MCS_FLAGS) -target:exe -out:mcs2.exe $(BUILT_SOURCES) @$(response)