2006-10-26 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / gmcs / Makefile
index 10e72ad4ceed4019685ab2909377be582674fa9c..7441b40b117eb045c8bbeab093bd21f8f20dfbee 100644 (file)
@@ -5,22 +5,32 @@ include ../build/rules.make
 #uncomment to enable some debug stuff
 #DEBUG_FLAGS=/define:MCS_DEBUG
 
+LOCAL_MCS_FLAGS += -d:GMCS_SOURCE
+
 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/mcs.exe $(DEBUG_FLAGS)
 
 BUILT_SOURCES = cs-parser.cs
 
 EXTRA_DISTFILES = cs-parser.jay
 
-PROGRAM = gmcs.exe
+PROGRAM = $(topdir)/class/lib/$(PROFILE)/gmcs.exe
 PROGRAM_COMPILE = $(BOOT_COMPILE)
 
-CLEAN_FILES = y.output
+CLEAN_FILES = y.output *.exe *.mdb
 
 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 $@
 
 include ../build/executable.make
 
+ifeq (net_2_0, $(PROFILE))
+# Utility rule to make debugging somewhat easier.
+all-local: gmcs.exe
+gmcs.exe: $(PROGRAM)
+       cp -p $< $@
+       test ! -f $<.mdb || cp -p $<.mdb $@.mdb
+endif
+
 clean-local: clean-net_2_0_bootstrap
 clean-net_2_0_bootstrap:
        cd .. && $(MAKE) PROFILE=net_2_0_bootstrap clean
@@ -34,7 +44,7 @@ $(bootstrap_libfiles): bootstrap-libs
 bootstrap-libs:
        cd .. && $(MAKE) PROFILE=net_2_0_bootstrap all
 
-gmcs.exe: $(bootstrap_libfiles)
+$(PROGRAM): $(bootstrap_libfiles)
 
 gmcs2.exe: $(PROGRAM)
        MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time $(PROGRAM) -2 /target:exe /debug /out:$@ $^ $(DEBUG_FLAGS)