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