Replace SIZEOF_REGISTER with sizeof(mgreg_t) for consistency with sizeof(gpointer)
[mono.git] / mcs / mcs / Makefile
1 thisdir := mcs
2 SUBDIRS := 
3 include ../build/rules.make
4
5 EXTRA_DISTFILES = \
6         *mcs.csproj             \
7         compiler.doc            \
8         *mcs.sln                \
9         *cs-parser.jay          \
10         *.sources               \
11         NOTES                   \
12         TODO                    \
13         *mcs.exe.config
14
15 COMPILER_NAME = gmcs
16
17 ifeq (net_2_0, $(PROFILE))
18 INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/gmcs.exe
19 endif
20
21 ifeq (moonlight_bootstrap, $(PROFILE))
22 INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/gmcs.exe
23 endif
24
25 ifeq (2.1, $(FRAMEWORK_VERSION))
26 LOCAL_MCS_FLAGS += -d:SMCS_SOURCE
27 COMPILER_NAME = smcs
28 endif
29
30 ifeq (4.0, $(FRAMEWORK_VERSION))
31 COMPILER_NAME = dmcs
32 endif
33
34 PROGRAM = $(topdir)/class/lib/$(PROFILE)/$(COMPILER_NAME).exe
35
36 BUILT_SOURCES = cs-parser.cs
37
38 PROGRAM_COMPILE = $(BOOT_COMPILE)
39
40 CLEAN_FILES += y.output
41
42 # Use -cvt for parser debug version
43 %-parser.cs: %-parser.jay $(topdir)/jay/skeleton.cs
44         $(topdir)/jay/jay -cv < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
45
46
47 KEEP_OUTPUT_FILE_COPY = yes
48
49 include ../build/executable.make
50
51 csproj-local:
52         config_file=`basename $(PROGRAM) .exe`-$(PROFILE).input; \
53         echo $(thisdir):$$config_file >> $(topdir)/../mono/msvc/scripts/order; \
54         (echo $(is_boot); \
55         echo $(BOOTSTRAP_MCS);  \
56         echo $(USE_MCS_FLAGS) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS); \
57         echo $(PROGRAM); \
58         echo $(BUILT_SOURCES); \
59         echo $(PROGRAM); \
60         echo $(response)) > $(topdir)/../mono/msvc/scripts/inputs/$$config_file
61
62 #
63 # Below this line we have local targets used for testing and development
64 #
65
66 # Testing targets
67
68 TIME = time
69
70 # This used to be called test, but that conflicts with the global
71 # recursive target.
72
73 btest: mcs2.exe mcs3.exe
74         ls -l mcs2.exe mcs3.exe
75
76 mcs2.exe: $(PROGRAM)
77         $(TIME) $(RUNTIME) $(RUNTIME_FLAGS) $(PROGRAM) $(USE_MCS_FLAGS) -target:exe -out:$@ $(BUILT_SOURCES) @$(response)
78
79 mcs3.exe: mcs2.exe
80         $(TIME) $(RUNTIME) $(RUNTIME_FLAGS) ./mcs2.exe $(USE_MCS_FLAGS) -target:exe -out:$@ $(BUILT_SOURCES) @$(response)
81
82 wc:
83         wc -l $(BUILT_SOURCES) `cat $(sourcefile)`
84
85 ctest: 
86         rm -f mcs2.exe mcs3.exe
87         $(MAKE) USE_MCS_FLAGS="-d:NET_1_1 -d:ONLY_1_1" btest
88
89 # we need this because bash tries to use its own crappy timer
90 FRIENDLY_TIME = $(shell which time) -f'%U seconds'
91
92 do-time : $(PROGRAM)
93         @ echo -n "Run 1:   "
94         @ rm -f mcs2.exe
95         @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs2.exe > /dev/null || (echo FAILED; exit 1)
96         @ echo -n "Run 2:   "
97         @ rm -f mcs3.exe
98         @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs3.exe > /dev/null || (echo FAILED; exit 1)
99         @ $(MAKE) do-corlib
100
101 do-corlib:
102         @ echo -n "corlib:  "
103         @ rm -f ../class/lib/mscorlib.dll
104         @ cd ../class/corlib ; $(MAKE) BOOTSTRAP_MCS='$(FRIENDLY_TIME) mono $$(topdir)/class/lib/$(PROFILE)/mcs.exe' > /dev/null || (echo FAILED; exit 1)
105
106 PROFILER=default
107
108 do-gettext:
109         xgettext --keyword='Report.Error:3' --keyword='Report.Error:2' --keyword='Report.Warning:3' --keyword='Report.Warning:2' -o mcs.po --language='C#' `cat gmcs.exe.sources | grep -v /`
110
111 profile : $(PROGRAM)
112         $(RUNTIME) $(RUNTIME_FLAGS) --profile=$(PROFILER) $(PROGRAM) $(USE_MCS_FLAGS) -target:exe -out:mcs2.exe $(BUILT_SOURCES) @$(response)
113
114 #
115 # quick hack target, to quickly develop the gmcs compiler
116 # Update manually.
117
118 q: cs-parser.cs qh
119         echo 'System.Console.WriteLine ("Hello");' | mono csharp.exe
120         echo -e 'using System;\nConsole.WriteLine ("hello");' | mono csharp.exe
121         echo -e '"foo" == "bar";' | mono csharp.exe
122         echo -e 'var a = 1;\na + 2;' | mono csharp.exe
123         echo -e 'int j;\nj = 1;' | mono csharp.exe
124         echo -e 'var a = new int[]{1,2,3};\nfrom x in a select x;' | mono csharp.exe
125         echo -e 'var a = from f in System.IO.Directory.GetFiles ("/tmp") where f == "passwd" select f;' | mono csharp.exe
126
127