* codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
[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 LOCAL_MCS_FLAGS += -d:GMCS_SOURCE
9
10 BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/net_2_0_bootstrap/mcs.exe $(DEBUG_FLAGS)
11
12 BUILT_SOURCES = cs-parser.cs
13
14 EXTRA_DISTFILES = cs-parser.jay
15
16 PROGRAM = $(topdir)/class/lib/$(PROFILE)/gmcs.exe
17 PROGRAM_COMPILE = $(BOOT_COMPILE)
18
19 CLEAN_FILES = y.output *.exe *.mdb
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 ifeq (net_2_0, $(PROFILE))
27 # Utility rule to make debugging somewhat easier.
28 all-local: gmcs.exe
29 gmcs.exe: $(PROGRAM)
30         cp -p $< $@
31         test ! -f $<.mdb || cp -p $<.mdb $@.mdb
32 endif
33
34 clean-local: clean-net_2_0_bootstrap
35 clean-net_2_0_bootstrap:
36         cd .. && $(MAKE) PROFILE=net_2_0_bootstrap clean
37
38 bootstrap_libs = mscorlib.dll System.dll System.Xml.dll Mono.CompilerServices.SymbolWriter.dll
39 bootstrap_libfiles = $(bootstrap_libs:%=$(topdir)/class/lib/net_2_0_bootstrap/%)
40
41 $(bootstrap_libfiles): bootstrap-libs
42         @:
43 .PHONY: bootstrap-libs
44 bootstrap-libs:
45         cd .. && $(MAKE) PROFILE=net_2_0_bootstrap all
46
47 $(PROGRAM): $(bootstrap_libfiles)
48
49 gmcs2.exe: $(PROGRAM)
50         MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time $(PROGRAM) -2 /target:exe /debug /out:$@ $^ $(DEBUG_FLAGS) 
51
52 gmcs3.exe: gmcs2.exe
53         MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time $(RUNTIME) $(RUNTIME_FLAGS) ./gmcs2.exe $(USE_MCS_FLAGS) $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $^
54
55 gmcs4.exe: gmcs3.exe
56         MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time $(RUNTIME) $(RUNTIME_FLAGS) ./gmcs3.exe $(USE_MCS_FLAGS) $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $^
57
58
59 # Testing targets
60
61 TIME = 
62
63 # This used to be called test, but that conflicts with the global
64 # recursive target.
65
66 btest: gmcs2.exe gmcs3.exe gmcs4.exe
67         ls -l gmcs3.exe gmcs4.exe
68
69 wc:
70         wc -l $(all_sources)
71
72 ctest: 
73         rm -f gmcs3.exe mcs4.exe
74         make btest USE_MCS_FLAGS= 
75
76 # we need this because bash tries to use its own crappy timer
77 FRIENDLY_TIME = $(shell which time) -f'%U seconds'
78
79 do-time : mcs.exe
80         @ echo -n "Run 1:   "
81          $(FRIENDLY_TIME) $(RUNTIME) $(RUNTIME_FLAGS) ./mcs.exe $(USE_MCS_FLAGS) /target:exe /out:mcs2.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
82         @ echo -n "Run 2:   "
83         @ $(FRIENDLY_TIME) $(RUNTIME) $(RUNTIME_FLAGS) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:mcs3.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
84         @ echo -n "corlib:  "
85         @ rm -f ../class/lib/mscorlib.dll
86         @ (cd ../class/corlib ; make BOOTSTRAP_MCS="$(FRIENDLY_TIME) mono ../../mcs/mcs.exe" > /dev/null ) || (echo FAILED; exit 1)
87
88 do-corlib:
89         @ echo -n "corlib:  "
90         @ rm -f ../class/lib/mscorlib.dll
91         @ (cd ../class/corlib ; make BOOTSTRAP_MCS="$(FRIENDLY_TIME) mono ../../mcs/mcs.exe" > /dev/null ) || (echo FAILED; exit 1)
92
93 PROFILER=default
94
95 profile : gmcs2.exe
96         -rm -f gmcs3.exe
97         make gmcs3.exe RUNTIME_FLAGS='--profile=$(PROFILER)'
98