[xbuild] Add new reserved properties $(MSBuildThisFile*).
[mono.git] / mcs / mcs / Makefile
index 80b07f654097873c46d2abc048605b33133be11e..2a0b1b0c75ba99031f3b57d1f7f94881bf12cc52 100644 (file)
@@ -2,57 +2,57 @@ thisdir := mcs
 SUBDIRS := 
 include ../build/rules.make
 
-BUILT_SOURCES = cs-parser.cs
-
 EXTRA_DISTFILES = \
-       *mcs.csproj             \
+       mcs.csproj              \
        compiler.doc            \
-       *mcs.sln                \
+       mcs.sln         \
        cs-parser.jay           \
+       mcs.exe.sources         \
        NOTES                   \
-       TODO
-
-PROGRAM = $(topdir)/class/lib/$(PROFILE)/mcs.exe
-PROGRAM_COMPILE = $(BOOT_COMPILE)
+       TODO                    \
+       ikvm.cs
 
-CLEAN_FILES = y.output *.exe *.mdb
+ifeq (basic, $(PROFILE))
+PROGRAM = $(topdir)/class/lib/$(PROFILE)/basic.exe
+sourcefile = mcs.exe.sources
+else
+PROGRAM = $(topdir)/class/lib/build/mcs.exe
+LOCAL_MCS_FLAGS += -lib:$(topdir)/class/lib/build
+endif
 
-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 $@
+LOCAL_MCS_FLAGS += -d:STATIC
 
-ifeq (net_2_0_bootstrap, $(PROFILE))
+PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/4.0
 
-all-local $(STD_TARGETS:=-local):
-       @:
+PROGRAM_COMPILE = $(BOOT_COMPILE)
 
-all-local: $(PROGRAM) $(PROGRAM).config
-clean-local: clean-program
-clean-program:
-       rm -f $(PROGRAM) $(PROGRAM).config
+BUILT_SOURCES = cs-parser.cs
 
-progdir = $(dir $(PROGRAM))
+CLEAN_FILES += y.output
 
-$(progdir)/.stamp:
-       $(MKINSTALLDIRS) $(@D)
-       touch $@
+# 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): $(topdir)/class/lib/default/mcs.exe $(progdir)/.stamp
-       cp $< $@
 
-$(PROGRAM).config: $(topdir)/gmcs/gmcs.exe.config $(progdir)/.stamp
-       cp $< $@
+KEEP_OUTPUT_FILE_COPY = yes
 
-else
 include ../build/executable.make
-endif
 
-ifeq (default, $(PROFILE))
-# Utility rule to make debugging somewhat easier.
-all-local: mcs.exe
-mcs.exe: $(PROGRAM)
-       cp -p $< $@
-       test ! -f $<.mdb || cp -p $<.mdb $@.mdb
-endif
+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
+
+#
+# Below this line we have local targets used for testing and development
+#
 
 # Testing targets
 
@@ -96,5 +96,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
+
+