Fixed format of VS2005 project file. Please revert if it breaks MSBuild compilation...
[mono.git] / mcs / gmcs / Makefile
index 28011ef28376c10a21291104bf9eae5cc1a1622b..71a1418f5684eebc94617c98608cef9f5ca3b195 100644 (file)
@@ -5,22 +5,30 @@ include ../build/rules.make
 #uncomment to enable some debug stuff
 #DEBUG_FLAGS=/define:MCS_DEBUG
 
-BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(topdir)/class/lib/net_2_0_bootstrap/mcs.exe $(DEBUG_FLAGS)
+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,16 +42,16 @@ $(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) 
 
 gmcs3.exe: gmcs2.exe
-       MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time $(RUNTIME) ./gmcs2.exe $(USE_MCS_FLAGS) $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $^
+       MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time $(RUNTIME) $(RUNTIME_FLAGS) ./gmcs2.exe $(USE_MCS_FLAGS) $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $^
 
 gmcs4.exe: gmcs3.exe
-       MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time $(RUNTIME) ./gmcs3.exe $(USE_MCS_FLAGS) $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $^
+       MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time $(RUNTIME) $(RUNTIME_FLAGS) ./gmcs3.exe $(USE_MCS_FLAGS) $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $^
 
 
 # Testing targets
@@ -68,9 +76,9 @@ FRIENDLY_TIME = $(shell which time) -f'%U seconds'
 
 do-time : mcs.exe
        @ echo -n "Run 1:   "
-        $(FRIENDLY_TIME) $(RUNTIME) ./mcs.exe $(USE_MCS_FLAGS) /target:exe /out:mcs2.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
+        $(FRIENDLY_TIME) $(RUNTIME) $(RUNTIME_FLAGS) ./mcs.exe $(USE_MCS_FLAGS) /target:exe /out:mcs2.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
        @ echo -n "Run 2:   "
-       @ $(FRIENDLY_TIME) $(RUNTIME) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:mcs3.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
+       @ $(FRIENDLY_TIME) $(RUNTIME) $(RUNTIME_FLAGS) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:mcs3.exe $(all_sources) > /dev/null || (echo FAILED; exit 1)
        @ echo -n "corlib:  "
        @ rm -f ../class/lib/mscorlib.dll
        @ (cd ../class/corlib ; make BOOTSTRAP_MCS="$(FRIENDLY_TIME) mono ../../mcs/mcs.exe" > /dev/null ) || (echo FAILED; exit 1)
@@ -84,5 +92,5 @@ PROFILER=default
 
 profile : gmcs2.exe
        -rm -f gmcs3.exe
-       make gmcs3.exe RUNTIME="$(RUNTIME) --profile=$(PROFILER)"
+       make gmcs3.exe RUNTIME_FLAGS='--profile=$(PROFILER)'