2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / gmcs / Makefile
1 thisdir := gmcs
2 SUBDIRS := 
3 include ../build/rules.make
4
5 #uncomment to enable some debug stuff
6 #DEBUG_FLAGS=/define:MCS_DEBUG
7
8 BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(topdir)/class/lib/net_2_0_bootstrap/mcs.exe $(DEBUG_FLAGS)
9
10 BUILT_SOURCES = cs-parser.cs
11
12 EXTRA_DISTFILES = cs-parser.jay
13
14 PROGRAM = gmcs.exe
15 PROGRAM_COMPILE = $(BOOT_COMPILE)
16
17 CLEAN_FILES = y.output
18
19 cs-parser.cs: cs-parser.jay $(topdir)/jay/skeleton.cs
20         $(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
21
22 include ../build/executable.make
23
24 clean-local: clean-net_2_0_bootstrap
25 clean-net_2_0_bootstrap:
26         cd .. && $(MAKE) PROFILE=net_2_0_bootstrap clean
27
28 bootstrap_libs = mscorlib.dll System.dll System.Xml.dll Mono.CompilerServices.SymbolWriter.dll
29 bootstrap_libfiles = $(bootstrap_libs:%=$(topdir)/class/lib/net_2_0_bootstrap/%)
30
31 $(bootstrap_libfiles): bootstrap-libs
32         @:
33 .PHONY: bootstrap-libs
34 bootstrap-libs:
35         cd .. && $(MAKE) PROFILE=net_2_0_bootstrap all
36
37 gmcs.exe: $(bootstrap_libfiles)
38
39 gmcs2.exe: $(PROGRAM)
40         MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time $(PROGRAM) -2 /target:exe /debug /out:$@ $^ $(DEBUG_FLAGS) 
41
42 gmcs3.exe: gmcs2.exe
43         MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time $(RUNTIME) ./gmcs2.exe $(USE_MCS_FLAGS) $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $^
44
45 gmcs4.exe: gmcs3.exe
46         MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time $(RUNTIME) ./gmcs3.exe $(USE_MCS_FLAGS) $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $^
47
48
49 # Testing targets
50
51 TIME = 
52
53 # This used to be called test, but that conflicts with the global
54 # recursive target.
55
56 btest: gmcs2.exe gmcs3.exe gmcs4.exe
57         ls -l gmcs3.exe gmcs4.exe
58
59 wc:
60         wc -l $(all_sources)
61
62 ctest: 
63         rm -f gmcs3.exe mcs4.exe
64         make btest USE_MCS_FLAGS= 
65
66 # we need this because bash tries to use its own crappy timer
67 FRIENDLY_TIME = $(shell which time) -f'%U seconds'
68
69 do-time : mcs.exe
70         @ echo -n "Run 1:   "
71          $(FRIENDLY_TIME) $(RUNTIME) ./mcs.exe $(USE_MCS_FLAGS) /target:exe /out:mcs2.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
72         @ echo -n "Run 2:   "
73         @ $(FRIENDLY_TIME) $(RUNTIME) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:mcs3.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
74         @ echo -n "corlib:  "
75         @ rm -f ../class/lib/mscorlib.dll
76         @ (cd ../class/corlib ; make BOOTSTRAP_MCS="$(FRIENDLY_TIME) mono ../../mcs/mcs.exe" > /dev/null ) || (echo FAILED; exit 1)
77
78 do-corlib:
79         @ echo -n "corlib:  "
80         @ rm -f ../class/lib/mscorlib.dll
81         @ (cd ../class/corlib ; make BOOTSTRAP_MCS="$(FRIENDLY_TIME) mono ../../mcs/mcs.exe" > /dev/null ) || (echo FAILED; exit 1)
82
83 PROFILER=default
84
85 profile : gmcs2.exe
86         -rm -f gmcs3.exe
87         make gmcs3.exe RUNTIME="$(RUNTIME) --profile=$(PROFILER)"
88