Add support for ToolsVersion and correctly build msbuild+xbuild assemblies
[mono.git] / mcs / tools / xbuild / Makefile
index b1122842be6f90cd9c7885ed8e0893941e652d03..da7a5bc766ce1edd993565582c19a23f472de3b7 100644 (file)
@@ -3,11 +3,26 @@ SUBDIRS =
 include ../../build/rules.make
 HAS_NUNIT_TEST = yes
 
-LOCAL_MCS_FLAGS = -r:Microsoft.Build.Framework.dll -r:Microsoft.Build.Utilities.dll -r:Microsoft.Build.Engine.dll
-PROGRAM = xbuild.exe
+ifeq (3.5, $(FRAMEWORK_VERSION))
+NAME_SUFFIX = .v3.5
+ASSEMBLY_VERSION = 3.5.0.0
+else
+ifeq (4.0, $(FRAMEWORK_VERSION))
+NAME_SUFFIX = .v4.0
+ASSEMBLY_VERSION = 4.0.0.0
+endif
+endif
+
+LOCAL_MCS_FLAGS = -r:Microsoft.Build.Framework.dll -r:Microsoft.Build.Utilities$(NAME_SUFFIX).dll -r:Microsoft.Build.Engine.dll
+PROGRAM = $(topdir)/class/lib/$(PROFILE)/xbuild.exe
 
 include ../../build/executable.make
 
+CLEAN_FILES= xbuild.exe xbuild.exe.mdb
+
+XBUILD_DIR=.
+include $(XBUILD_DIR)/xbuild_targets.make
+
 install-local: install-extras
 
 WEBAPP_DIR = Microsoft/VisualStudio/v9.0/WebApplications
@@ -15,7 +30,7 @@ EXTRAS_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
 install-extras: 
        $(MKINSTALLDIRS) $(DESTDIR)$(EXTRAS_DIR)
        $(INSTALL_DATA) xbuild/xbuild.rsp $(DESTDIR)$(EXTRAS_DIR)
-       $(INSTALL_DATA) xbuild/Microsoft.Common.tasks $(DESTDIR)$(EXTRAS_DIR)
+       $(INSTALL_DATA) xbuild/$(FRAMEWORK_VERSION)/Microsoft.Common.tasks $(DESTDIR)$(EXTRAS_DIR)
        $(INSTALL_DATA) xbuild/Microsoft.Build.xsd $(DESTDIR)$(EXTRAS_DIR)
        $(INSTALL_DATA) xbuild/Microsoft.Common.targets $(DESTDIR)$(EXTRAS_DIR)
        $(INSTALL_DATA) xbuild/Microsoft.CSharp.targets $(DESTDIR)$(EXTRAS_DIR)
@@ -29,7 +44,9 @@ install-extras:
 
 EXTRA_DISTFILES = \
        xbuild/xbuild.rsp \
-       xbuild/Microsoft.Common.tasks \
+       xbuild/2.0/Microsoft.Common.tasks \
+       xbuild/3.5/Microsoft.Common.tasks \
+       xbuild/4.0/Microsoft.Common.tasks \
        xbuild/Microsoft.Build.xsd \
        xbuild/Microsoft.CSharp.targets \
        xbuild/Microsoft.Common.targets \