2008-10-24 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mcs / build / rules.make
index e2332d34029d1e1a823535437d9c468264186217..2d3d124412a3c38113d26527ca5212ab50c75446 100644 (file)
@@ -15,13 +15,17 @@ topdir := $(dots)
 
 VERSION = 0.93
 
-USE_MCS_FLAGS = $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS)
-USE_MBAS_FLAGS = $(LOCAL_MBAS_FLAGS) $(PLATFORM_MBAS_FLAGS) $(PROFILE_MBAS_FLAGS) $(MBAS_FLAGS)
+Q=$(if $(V),,@)
+# echo -e "\\t" does not work on some systems, so use 5 spaces
+Q_MCS=$(if $(V),,@echo "MCS     [$(PROFILE)] $(notdir $(@))";)
+
+USE_MCS_FLAGS = /codepage:$(CODEPAGE) $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS)
+USE_MBAS_FLAGS = /codepage:$(CODEPAGE) $(LOCAL_MBAS_FLAGS) $(PLATFORM_MBAS_FLAGS) $(PROFILE_MBAS_FLAGS) $(MBAS_FLAGS)
 USE_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS)
-CSCOMPILE = $(MCS) $(USE_MCS_FLAGS)
+CSCOMPILE = $(Q_MCS) $(MCS) $(USE_MCS_FLAGS)
 BASCOMPILE = $(MBAS) $(USE_MBAS_FLAGS)
 CCOMPILE = $(CC) $(USE_CFLAGS)
-BOOT_COMPILE = $(BOOTSTRAP_MCS) $(USE_MCS_FLAGS)
+BOOT_COMPILE = $(Q_MCS) $(BOOTSTRAP_MCS) $(USE_MCS_FLAGS)
 INSTALL = $(SHELL) $(topdir)/../mono/install-sh
 INSTALL_DATA = $(INSTALL) -c -m 644
 INSTALL_BIN = $(INSTALL) -c -m 755
@@ -29,9 +33,9 @@ INSTALL_LIB = $(INSTALL_BIN)
 MKINSTALLDIRS = $(SHELL) $(topdir)/mkinstalldirs
 INTERNAL_MCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/mcs.exe
 INTERNAL_MBAS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/mbas/mbas.exe
-INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/gmcs/gmcs.exe
+INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/mcs/gmcs.exe
 INTERNAL_ILASM = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/ilasm.exe
-INTERNAL_RESGEN = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/tools/resgen/resgen.exe
+INTERNAL_RESGEN = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/resgen.exe
 corlib = mscorlib.dll
 
 depsdir = $(topdir)/build/deps
@@ -89,7 +93,7 @@ endif
 # Rest of the configuration
 
 ifndef PROFILE
-PROFILE = default
+PROFILE = net_2_0
 endif
 
 include $(topdir)/build/profiles/$(PROFILE).make
@@ -101,7 +105,14 @@ else
 all: do-all
 endif
 
-STD_TARGETS = test run-test run-test-ondotnet clean install uninstall
+ifdef NO_INSTALL
+GACUTIL = :
+else
+gacutil = $(topdir)/class/lib/net_1_1_bootstrap/gacutil.exe
+GACUTIL = MONO_PATH="$(topdir)/class/lib/net_1_1_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(gacutil)
+endif
+
+STD_TARGETS = test run-test run-test-ondotnet clean install uninstall doc-update
 
 $(STD_TARGETS): %: do-%
 
@@ -120,6 +131,10 @@ ifndef PROFILE_SUBDIRS
 PROFILE_SUBDIRS = $(SUBDIRS)
 endif
 
+ifndef FRAMEWORK_VERSION_MAJOR
+FRAMEWORK_VERSION_MAJOR = $(basename $(FRAMEWORK_VERSION))
+endif
+
 %-recursive:
        @set . $$MAKEFLAGS; final_exit=:; \
        case $$2 in --unix) shift ;; esac; \
@@ -157,8 +172,23 @@ dist-default:
            dest=`dirname $(distdir)/$$f` ; \
            $(MKINSTALLDIRS) $$dest && cp -p $$f $$dest || exit 1 ; \
        done
+       if test -d Documentation ; then \
+               find . -name '*.xml' > .files ; \
+               tar cTf .files - | (cd $(distdir); tar xf -) ; \
+               rm .files ; \
+       fi
+
+%/.stamp:
+       $(MKINSTALLDIRS) $(@D)
+       touch $@
 
 # Useful
 
 withmcs:
        $(MAKE) MCS='$(INTERNAL_MCS)' BOOTSTRAP_MCS='$(INTERNAL_MCS)' all
+
+## Documentation stuff
+
+Q_MDOC =$(if $(V),,@echo "MDOC    [$(PROFILE)] $(notdir $(@))";)
+MDOC   =$(Q_MDOC) MONO_PATH="$(topdir)/class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/net_1_1$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(topdir)/tools/mdoc/mdoc.exe
+