In tools/corcompare:
[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
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 include ../build/executable.make
24
25 # Testing targets
26
27 TIME = time
28
29 # This used to be called test, but that conflicts with the global
30 # recursive target.
31
32 btest: mcs2.exe mcs3.exe
33         ls -l mcs2.exe mcs3.exe
34
35 mcs2.exe: $(PROGRAM)
36         $(TIME) $(RUNTIME) $(PROGRAM) $(USE_MCS_FLAGS) /target:exe /out:$@ $(BUILT_SOURCES) @$(response)
37
38 mcs3.exe: mcs2.exe
39         $(TIME) $(RUNTIME) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:$@ $(BUILT_SOURCES) @$(response)
40
41 wc:
42         wc -l $(BUILT_SOURCES) `cat $(sourcefile)`
43
44 ctest: 
45         rm -f mcs2.exe mcs3.exe
46         $(MAKE) USE_MCS_FLAGS= btest
47
48 # we need this because bash tries to use its own crappy timer
49 FRIENDLY_TIME = $(shell which time) -f'%U seconds'
50
51 do-time : $(PROGRAM)
52         @ echo -n "Run 1:   "
53         @ rm -f mcs2.exe
54         @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs2.exe > /dev/null || (echo FAILED; exit 1)
55         @ echo -n "Run 2:   "
56         @ rm -f mcs3.exe
57         @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs3.exe > /dev/null || (echo FAILED; exit 1)
58         @ $(MAKE) do-corlib
59
60 do-corlib:
61         @ echo -n "corlib:  "
62         @ rm -f ../class/lib/mscorlib.dll
63         @ cd ../class/corlib ; $(MAKE) BOOTSTRAP_MCS='$(FRIENDLY_TIME) mono $$(topdir)/class/lib/$(PROFILE)/mcs.exe' > /dev/null || (echo FAILED; exit 1)
64
65 PROFILER=default
66
67 profile : $(PROGRAM)
68         $(RUNTIME) --profile=$(PROFILER) $(PROGRAM) $(USE_MCS_FLAGS) /target:exe /out:mcs2.exe $(BUILT_SOURCES) @$(response)
69