2004-07-14 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / gmcs / Makefile
index 0374b1e90cd81a599238ce174d846b1784734e21..8bb0bcdffb5f76ea0ea5eac523f223d360e28ea4 100644 (file)
@@ -20,8 +20,8 @@ COMPILER_SOURCES = \
        enum.cs                         \
        ecore.cs                        \
        expression.cs                   \
+       flowanalysis.cs                 \
        generic.cs                      \
-       interface.cs                    \
        iterators.cs                    \
        literal.cs                      \
        location.cs                     \
@@ -35,26 +35,31 @@ COMPILER_SOURCES = \
        support.cs                      \
        typemanager.cs                  \
        symbolwriter.cs                 \
-       tree.cs
+       tree.cs                         \
+       CryptoConvert.cs
 
 all_sources = $(COMPILER_SOURCES) cs-parser.cs
 
 DISTFILES = \
        $(COMPILER_SOURCES)     \
        compiler.csproj         \
-       compiler.csproj.user    \
        compiler.doc            \
        compiler.sln            \
        cs-parser.jay           \
        mcs.exe.config          \
        NOTES                   \
        TODO
+#uncomment to enable some debug stuff
+#DEBUG_FLAGS=/define:MCS_DEBUG
 
 all-local: gmcs.exe
 
 install-local: gmcs.exe
-       $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/bin
-       $(INSTALL_BIN) gmcs.exe $(DESTDIR)$(prefix)/bin
+       $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/lib/mono/2.0
+       $(INSTALL_BIN) gmcs.exe $(DESTDIR)$(prefix)/lib/mono/2.0
+
+uninstall-local:
+       -rm -f $(DESTDIR)$(prefix)/bin/mcs.exe
 
 test-local run-test-local:
 
@@ -64,10 +69,19 @@ clean-local:
 dist-local: dist-default
 
 gmcs.exe: $(all_sources)
-       $(BOOT_COMPILE) /target:exe /out:$@ $^
+       MONO_PATH="../class/lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" mono ../mcs/mcs.exe $(DEBUG_FLAGS) -2 /target:exe /debug /out:$@ $^
+
+gmcs2.exe: $(all_sources)
+       MONO_PATH="../class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" time mcs -2 /target:exe /debug /out:$@ $^ $(DEBUG_FLAGS) 
+
+gmcs3.exe: $(all_sources)
+       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:$@ $^
+
+gmcs4.exe: $(all_sources)
+       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:$@ $^
 
 cs-parser.cs: cs-parser.jay $(topdir)/jay/skeleton.cs
-       $(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $< >$@
+       $(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
 
 # Testing targets
 
@@ -76,11 +90,37 @@ TIME =
 # This used to be called test, but that conflicts with the global
 # recursive target.
 
-btest: mcs2.exe mcs3.exe
-       ls -l mcs2.exe mcs3.exe
+btest: gmcs2.exe gmcs3.exe gmcs4.exe
+       ls -l gmcs3.exe gmcs4.exe
+
+wc:
+       wc -l $(all_sources)
+
+ctest: 
+       rm -f gmcs3.exe mcs4.exe
+       make btest USE_MCS_FLAGS= 
+
+# we need this because bash tries to use its own crappy timer
+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)
+       @ 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)
+       @ 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)
+
+do-corlib:
+       @ 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)
+
+PROFILER=default
 
-mcs2.exe: gmcs.exe
-       $(TIME) $(RUNTIME) ./gmcs.exe $(USE_MCS_FLAGS) /target:exe /out:$@ $(all_sources)
+profile : gmcs2.exe
+       make gmcs3.exe RUNTIME="$(RUNTIME) --profile"
 
-mcs3.exe: mcs2.exe
-       $(TIME) $(RUNTIME) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:$@ $(all_sources)
+response:
+       echo $(all_sources) > res