2009-12-09 Jb Evain <jbevain@novell.com>
[mcs.git] / mcs / Makefile
blobe2a9785c660eae8bdd43cc2c1aa509affb539f88
1 thisdir := mcs
2 SUBDIRS :=
3 include ../build/rules.make
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
15 COMPILER_NAME = gmcs
17 ifeq (net_2_0, $(PROFILE))
18 INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/gmcs.exe
19 endif
21 ifeq (2.1, $(FRAMEWORK_VERSION))
22 LOCAL_MCS_FLAGS += -d:SMCS_SOURCE
23 COMPILER_NAME = smcs
24 endif
26 ifeq (4.0, $(FRAMEWORK_VERSION))
27 COMPILER_NAME = dmcs
28 endif
30 PROGRAM = $(topdir)/class/lib/$(PROFILE)/$(COMPILER_NAME).exe
32 BUILT_SOURCES = cs-parser.cs
34 PROGRAM_COMPILE = $(BOOT_COMPILE)
36 CLEAN_FILES += y.output
38 %-parser.cs: %-parser.jay $(topdir)/jay/skeleton.cs
39 $(topdir)/jay/jay -cvt < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
42 KEEP_OUTPUT_FILE_COPY = yes
44 include ../build/executable.make
46 csproj-local:
47 config_file=`basename $(PROGRAM) .exe`-$(PROFILE).input; \
48 echo $(thisdir):$$config_file >> $(topdir)/../mono/msvc/scripts/order; \
49 (echo $(is_boot); \
50 echo $(BOOTSTRAP_MCS); \
51 echo $(USE_MCS_FLAGS) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS); \
52 echo $(PROGRAM); \
53 echo $(BUILT_SOURCES); \
54 echo $(PROGRAM); \
55 echo $(response)) > $(topdir)/../mono/msvc/scripts/inputs/$$config_file
58 # Below this line we have local targets used for testing and development
61 # Testing targets
63 TIME = time
65 # This used to be called test, but that conflicts with the global
66 # recursive target.
68 btest: mcs2.exe mcs3.exe
69 ls -l mcs2.exe mcs3.exe
71 mcs2.exe: $(PROGRAM)
72 $(TIME) $(RUNTIME) $(RUNTIME_FLAGS) $(PROGRAM) $(USE_MCS_FLAGS) -target:exe -out:$@ $(BUILT_SOURCES) @$(response)
74 mcs3.exe: mcs2.exe
75 $(TIME) $(RUNTIME) $(RUNTIME_FLAGS) ./mcs2.exe $(USE_MCS_FLAGS) -target:exe -out:$@ $(BUILT_SOURCES) @$(response)
77 wc:
78 wc -l $(BUILT_SOURCES) `cat $(sourcefile)`
80 ctest:
81 rm -f mcs2.exe mcs3.exe
82 $(MAKE) USE_MCS_FLAGS="-d:NET_1_1 -d:ONLY_1_1" btest
84 # we need this because bash tries to use its own crappy timer
85 FRIENDLY_TIME = $(shell which time) -f'%U seconds'
87 do-time : $(PROGRAM)
88 @ echo -n "Run 1: "
89 @ rm -f mcs2.exe
90 @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs2.exe > /dev/null || (echo FAILED; exit 1)
91 @ echo -n "Run 2: "
92 @ rm -f mcs3.exe
93 @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs3.exe > /dev/null || (echo FAILED; exit 1)
94 @ $(MAKE) do-corlib
96 do-corlib:
97 @ echo -n "corlib: "
98 @ rm -f ../class/lib/mscorlib.dll
99 @ cd ../class/corlib ; $(MAKE) BOOTSTRAP_MCS='$(FRIENDLY_TIME) mono $$(topdir)/class/lib/$(PROFILE)/mcs.exe' > /dev/null || (echo FAILED; exit 1)
101 PROFILER=default
103 do-gettext:
104 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 /`
106 profile : $(PROGRAM)
107 $(RUNTIME) $(RUNTIME_FLAGS) --profile=$(PROFILER) $(PROGRAM) $(USE_MCS_FLAGS) -target:exe -out:mcs2.exe $(BUILT_SOURCES) @$(response)
110 # quick hack target, to quickly develop the gmcs compiler
111 # Update manually.
113 q: cs-parser.cs qh
114 echo 'System.Console.WriteLine ("Hello");' | mono csharp.exe
115 echo -e 'using System;\nConsole.WriteLine ("hello");' | mono csharp.exe
116 echo -e '"foo" == "bar";' | mono csharp.exe
117 echo -e 'var a = 1;\na + 2;' | mono csharp.exe
118 echo -e 'int j;\nj = 1;' | mono csharp.exe
119 echo -e 'var a = new int[]{1,2,3};\nfrom x in a select x;' | mono csharp.exe
120 echo -e 'var a = from f in System.IO.Directory.GetFiles ("/tmp") where f == "passwd" select f;' | mono csharp.exe