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