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