- Fixed pointer type
[mono.git] / mcs / gmcs / Makefile
index d379bf3a9697ee68a043f676f6cab93c7bb2feb2..28011ef28376c10a21291104bf9eae5cc1a1622b 100644 (file)
@@ -2,76 +2,49 @@ thisdir := gmcs
 SUBDIRS := 
 include ../build/rules.make
 
-COMPILER_SOURCES = \
-       AssemblyInfo.cs                 \
-       anonymous.cs                    \
-       assign.cs                       \
-       attribute.cs                    \
-       driver.cs                       \
-       cs-tokenizer.cs                 \
-       cfold.cs                        \
-       class.cs                        \
-       codegen.cs                      \
-       const.cs                        \
-       constant.cs                     \
-       convert.cs                      \
-       decl.cs                         \
-       delegate.cs                     \
-       enum.cs                         \
-       ecore.cs                        \
-       expression.cs                   \
-       flowanalysis.cs                 \
-       generic.cs                      \
-       interface.cs                    \
-       iterators.cs                    \
-       literal.cs                      \
-       location.cs                     \
-       modifiers.cs                    \
-       namespace.cs                    \
-       parameter.cs                    \
-       pending.cs                      \
-       report.cs                       \
-       rootcontext.cs                  \
-       statement.cs                    \
-       support.cs                      \
-       typemanager.cs                  \
-       symbolwriter.cs                 \
-       tree.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
-
-all-local: gmcs.exe
-
-install-local: gmcs.exe
-       $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/bin
-       $(INSTALL_BIN) gmcs.exe $(DESTDIR)$(prefix)/bin
-
-uninstall-local:
-       -rm -f $(DESTDIR)$(prefix)/bin/mcs.exe
-
-test-local run-test-local:
-
-clean-local:
-       rm -f *.exe *.pdb cs-parser.cs y.output
-
-dist-local: dist-default
-
-gmcs.exe: $(all_sources)
-       $(BOOT_COMPILE) /target:exe /out:$@ $^
+#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)
+
+BUILT_SOURCES = cs-parser.cs
+
+EXTRA_DISTFILES = cs-parser.jay
+
+PROGRAM = gmcs.exe
+PROGRAM_COMPILE = $(BOOT_COMPILE)
+
+CLEAN_FILES = y.output
 
 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 $@
+
+include ../build/executable.make
+
+clean-local: clean-net_2_0_bootstrap
+clean-net_2_0_bootstrap:
+       cd .. && $(MAKE) PROFILE=net_2_0_bootstrap clean
+
+bootstrap_libs = mscorlib.dll System.dll System.Xml.dll Mono.CompilerServices.SymbolWriter.dll
+bootstrap_libfiles = $(bootstrap_libs:%=$(topdir)/class/lib/net_2_0_bootstrap/%)
+
+$(bootstrap_libfiles): bootstrap-libs
+       @:
+.PHONY: bootstrap-libs
+bootstrap-libs:
+       cd .. && $(MAKE) PROFILE=net_2_0_bootstrap all
+
+gmcs.exe: $(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:$@ $^
+
+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:$@ $^
+
 
 # Testing targets
 
@@ -80,18 +53,36 @@ 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
-
-mcs2.exe: gmcs.exe
-       $(TIME) $(RUNTIME) ./gmcs.exe $(USE_MCS_FLAGS) /target:exe /out:$@ $(all_sources)
+btest: gmcs2.exe gmcs3.exe gmcs4.exe
+       ls -l gmcs3.exe gmcs4.exe
 
-mcs3.exe: mcs2.exe
-       $(TIME) $(RUNTIME) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:$@ $(all_sources)
+wc:
+       wc -l $(all_sources)
 
 ctest: 
-       -rm mcs2.exe mcs3.exe
+       rm -f gmcs3.exe mcs4.exe
        make btest USE_MCS_FLAGS= 
 
-response:
-       echo $(all_sources) > res
+# 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
+
+profile : gmcs2.exe
+       -rm -f gmcs3.exe
+       make gmcs3.exe RUNTIME="$(RUNTIME) --profile=$(PROFILER)"
+