Hide boostrap compiler for people looking for mcs.exe
[mono.git] / mcs / mcs / Makefile
index 6ae6a7c6c6b1900ee115b7b1b1ce07e155e9cad5..1975a570dfd0f7adc66d7489bb7b7c74a4d1a003 100644 (file)
@@ -3,87 +3,64 @@ SUBDIRS :=
 include ../build/rules.make
 
 EXTRA_DISTFILES = \
-       *mcs.csproj             \
+       mcs.csproj              \
        compiler.doc            \
-       *mcs.sln                \
-       *cs-parser.jay          \
+       mcs.sln         \
+       cs-parser.jay           \
+       mcs.exe.sources         \
        NOTES                   \
-       TODO
+       TODO                    \
+       ikvm.cs
 
-GMCS_PROFILE := $(filter net_2_0_bootstrap net_2_0 net_2_1, $(PROFILE))
-
-ifdef GMCS_PROFILE
-       BUILT_SOURCES = gcs-parser.cs
-       LOCAL_MCS_FLAGS += -d:GMCS_SOURCE
-       
-       ifeq (net_2_1, $(PROFILE))
-               INTERNAL_SMCS = $(INTERNAL_GMCS)
-               LOCAL_MCS_FLAGS += -nowarn:618 -noconfig -r:mscorlib -r:System.dll
-               PROGRAM = $(topdir)/class/lib/$(PROFILE)/smcs.exe
-       else
-               BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/net_2_0_bootstrap/gmcs.exe $(DEBUG_FLAGS)
-               PROGRAM = $(topdir)/class/lib/$(PROFILE)/gmcs.exe
-       endif   
+ifeq (basic, $(PROFILE))
+PROGRAM = $(topdir)/class/lib/$(PROFILE)/basic.exe
+sourcefile = mcs.exe.sources
 else
-       BUILT_SOURCES = cs-parser.cs
-       PROGRAM = $(topdir)/class/lib/$(PROFILE)/mcs.exe
+PROGRAM = $(topdir)/class/lib/build/mcs.exe
+LOCAL_MCS_FLAGS += -lib:$(topdir)/class/lib/build
 endif
 
-PROGRAM_COMPILE = $(BOOT_COMPILE)
-
-CLEAN_FILES += y.output
-
-%-parser.cs: %-parser.jay $(topdir)/jay/skeleton.cs
-       $(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
-
-
-ifeq (net_2_0_bootstrap, $(PROFILE))
-
-all-local $(STD_TARGETS:=-local):
-       @:
-
-all-local: $(PROGRAM) $(PROGRAM).config
-clean-local: clean-program
-clean-program:
-       rm -f $(PROGRAM) $(PROGRAM).config
-
-progdir = $(dir $(PROGRAM))
-
-$(progdir)/.stamp:
-       $(MKINSTALLDIRS) $(@D)
-       touch $@
-
-$(PROGRAM): $(topdir)/class/lib/default/mcs.exe $(progdir)/.stamp
-       cp $< $@
+LOCAL_MCS_FLAGS += -d:STATIC
 
-$(PROGRAM).config: $(progdir)/.stamp
-       cp $< $@
+PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/4.0
 
-else
-
-ifeq (net_2_0, $(PROFILE))
+PROGRAM_COMPILE = $(BOOT_COMPILE)
 
-clean-local: clean-net_2_0_bootstrap
-clean-net_2_0_bootstrap:
-       cd .. && $(MAKE) PROFILE=net_2_0_bootstrap clean
+BUILT_SOURCES = cs-parser.cs
 
-bootstrap_libs = mscorlib.dll System.dll System.Xml.dll Mono.CompilerServices.SymbolWriter.dll
-bootstrap_libfiles = $(bootstrap_libs:%=$(topdir)/class/lib/net_2_0_bootstrap/%)
+CLEAN_FILES += y.output
 
-$(bootstrap_libfiles): bootstrap-libs
-       @:
-.PHONY: bootstrap-libs
-bootstrap-libs:
-       cd .. && $(MAKE) PROFILE=net_2_0_bootstrap all
+# Use -cvt for parser debug version
+%-parser.cs: %-parser.jay $(topdir)/jay/skeleton.cs
+       $(topdir)/jay/jay -cv < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
 
-$(PROGRAM): $(bootstrap_libfiles)
-endif
 
 KEEP_OUTPUT_FILE_COPY = yes
 
 include ../build/executable.make
+
+csproj-local:
+       config_file=`basename $(PROGRAM) .exe`-$(PROFILE).input; \
+       echo $(thisdir):$$config_file >> $(topdir)/../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)/../msvc/scripts/inputs/$$config_file
+       
+ifeq (basic, $(PROFILE))
+install-local:
+       $(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
+       $(INSTALL_BIN) $(PROGRAM) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
+       test ! -f $(PROGRAM).mdb || $(INSTALL_BIN) $(PROGRAM).mdb $(DESTDIR)$(PROGRAM_INSTALL_DIR)
 endif
 
+#
+# Below this line we have local targets used for testing and development
+#
+
 # Testing targets
 
 TIME = time
@@ -126,5 +103,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) $(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
+
+