Move wapi shutdown to mono_cleanup () as TlsGetValue()/TlsSetValue() is used
[mono.git] / mcs / mcs / Makefile
index 7e5488db440e07db5969008f960e22cf1e82f6e9..43a2780851e2951341f0ad3643d120cb53c7de59 100644 (file)
@@ -2,26 +2,66 @@ thisdir := mcs
 SUBDIRS := 
 include ../build/rules.make
 
-BUILT_SOURCES = cs-parser.cs
-
 EXTRA_DISTFILES = \
-       compiler.csproj         \
+       *mcs.csproj             \
        compiler.doc            \
-       compiler.sln            \
-       cs-parser.jay           \
+       *mcs.sln                \
+       *cs-parser.jay          \
+       *.sources               \
        NOTES                   \
-       TODO
+       TODO                    \
+       *mcs.exe.config
+
+COMPILER_NAME = gmcs
+
+ifeq (net_2_0, $(PROFILE))
+INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/gmcs.exe
+endif
+
+ifeq (moonlight_bootstrap, $(PROFILE))
+INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/gmcs.exe
+endif
+
+ifeq (2.1, $(FRAMEWORK_VERSION))
+LOCAL_MCS_FLAGS += -d:SMCS_SOURCE
+COMPILER_NAME = smcs
+endif
+
+ifeq (4.0, $(FRAMEWORK_VERSION))
+COMPILER_NAME = dmcs
+endif
+
+PROGRAM = $(topdir)/class/lib/$(PROFILE)/$(COMPILER_NAME).exe
+
+BUILT_SOURCES = cs-parser.cs
 
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/mcs.exe
 PROGRAM_COMPILE = $(BOOT_COMPILE)
 
-CLEAN_FILES = y.output
+CLEAN_FILES += y.output
+
+%-parser.cs: %-parser.jay $(topdir)/jay/skeleton.cs
+       $(topdir)/jay/jay -cvt < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
 
-cs-parser.cs: cs-parser.jay $(topdir)/jay/skeleton.cs
-       $(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
+
+KEEP_OUTPUT_FILE_COPY = yes
 
 include ../build/executable.make
 
+csproj-local:
+       config_file=`basename $(PROGRAM) .exe`-$(PROFILE).input; \
+       echo $(thisdir):$$config_file >> $(topdir)/../mono/msvc/scripts/order; \
+       (echo $(is_boot); \
+       echo $(BOOTSTRAP_MCS);  \
+       echo $(USE_MCS_FLAGS) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS); \
+       echo $(PROGRAM); \
+       echo $(BUILT_SOURCES); \
+       echo $(PROGRAM); \
+       echo $(response)) > $(topdir)/../mono/msvc/scripts/inputs/$$config_file
+
+#
+# Below this line we have local targets used for testing and development
+#
+
 # Testing targets
 
 TIME = time
@@ -33,17 +73,17 @@ btest: mcs2.exe mcs3.exe
        ls -l mcs2.exe mcs3.exe
 
 mcs2.exe: $(PROGRAM)
-       $(TIME) $(RUNTIME) $(PROGRAM) $(USE_MCS_FLAGS) /target:exe /out:$@ $(BUILT_SOURCES) @$(response)
+       $(TIME) $(RUNTIME) $(RUNTIME_FLAGS) $(PROGRAM) $(USE_MCS_FLAGS) -target:exe -out:$@ $(BUILT_SOURCES) @$(response)
 
 mcs3.exe: mcs2.exe
-       $(TIME) $(RUNTIME) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:$@ $(BUILT_SOURCES) @$(response)
+       $(TIME) $(RUNTIME) $(RUNTIME_FLAGS) ./mcs2.exe $(USE_MCS_FLAGS) -target:exe -out:$@ $(BUILT_SOURCES) @$(response)
 
 wc:
        wc -l $(BUILT_SOURCES) `cat $(sourcefile)`
 
 ctest: 
        rm -f mcs2.exe mcs3.exe
-       $(MAKE) USE_MCS_FLAGS= btest
+       $(MAKE) USE_MCS_FLAGS="-d:NET_1_1 -d:ONLY_1_1" btest
 
 # we need this because bash tries to use its own crappy timer
 FRIENDLY_TIME = $(shell which time) -f'%U seconds'
@@ -64,6 +104,23 @@ do-corlib:
 
 PROFILER=default
 
+do-gettext:
+       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 /`
+
 profile : $(PROGRAM)
-       $(RUNTIME) --profile=$(PROFILER) $(PROGRAM) $(USE_MCS_FLAGS) /target:exe /out:mcs2.exe $(BUILT_SOURCES) @$(response)
+       $(RUNTIME) $(RUNTIME_FLAGS) --profile=$(PROFILER) $(PROGRAM) $(USE_MCS_FLAGS) -target:exe -out:mcs2.exe $(BUILT_SOURCES) @$(response)
+
+#
+# quick hack target, to quickly develop the gmcs compiler
+# Update manually.
+
+q: cs-parser.cs qh
+       echo 'System.Console.WriteLine ("Hello");' | mono csharp.exe
+       echo -e 'using System;\nConsole.WriteLine ("hello");' | mono csharp.exe
+       echo -e '"foo" == "bar";' | mono csharp.exe
+       echo -e 'var a = 1;\na + 2;' | mono csharp.exe
+       echo -e 'int j;\nj = 1;' | mono csharp.exe
+       echo -e 'var a = new int[]{1,2,3};\nfrom x in a select x;' | mono csharp.exe
+       echo -e 'var a = from f in System.IO.Directory.GetFiles ("/tmp") where f == "passwd" select f;' | mono csharp.exe
+