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