]> git.lizzy.rs Git - rust.git/commitdiff
mk: Update `make dist` for MSVC targets
authorAlex Crichton <alex@alexcrichton.com>
Wed, 13 May 2015 17:03:00 +0000 (10:03 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 19 May 2015 17:53:07 +0000 (10:53 -0700)
This commit updates the `dist` target for MSVC to not build the mingw components
and to also ensure that the `llvm-ar.exe` binary is ferried along into the right
location for installs.

mk/cfg/x86_64-pc-windows-msvc.mk
mk/dist.mk
mk/prepare.mk

index 1a1f059945a851ffb9f0202386d14448e514f28c..bd1088b7cd13348ef691d2994b690acae8ca991a 100644 (file)
@@ -45,6 +45,7 @@ endif
 # instead of `lib.exe` for assembling archives, so we need to inject this custom
 # dependency here.
 NATIVE_TOOL_DEPS_core_T_x86_64-pc-windows-msvc += llvm-ar.exe
+INSTALLED_BINS_x86_64-pc-windows-msvc += llvm-ar.exe
 
 # When working with MSVC on windows, each DLL needs to explicitly declare its
 # interface to the outside world through some means. The options for doing so
index 75c6219c5f04f17ed9fa72b4ac2f01fe991acaff..9aab51daba9141dffff527dfd5d95cd4134168b0 100644 (file)
@@ -144,9 +144,11 @@ dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1) prepare-overlay-$(1)
        @$(call E, build: $$@)
 # Copy essential gcc components into installer
 ifdef CFG_WINDOWSY_$(1)
+ifeq ($$(findstring gnu,$(1)),gnu)
        $$(Q)rm -Rf tmp/dist/win-rust-gcc-$(1)
        $$(Q)$$(CFG_PYTHON) $$(S)src/etc/make-win-dist.py tmp/dist/$$(PKG_NAME)-$(1)-image tmp/dist/win-rust-gcc-$(1) $(1)
        $$(Q)cp -r $$(S)src/etc/third-party tmp/dist/$$(PKG_NAME)-$(1)-image/share/doc/
+endif
 endif
        $$(Q)$$(S)src/rust-installer/gen-installer.sh \
                --product-name=Rust \
@@ -213,7 +215,14 @@ endif
 dist-install-dirs: $(foreach host,$(CFG_HOST),dist-install-dir-$(host))
 
 ifdef CFG_WINDOWSY_$(CFG_BUILD)
-MAYBE_MINGW_TARBALLS=$(foreach host,$(CFG_HOST),dist/$(MINGW_PKG_NAME)-$(host).tar.gz)
+define BUILD_MINGW_TARBALL
+ifeq ($$(findstring gnu,$(1)),gnu)
+MAYBE_MINGW_TARBALLS += dist/$(MINGW_PKG_NAME)-$(1).tar.gz
+endif
+endef
+
+$(foreach host,$(CFG_HOST),\
+  $(eval $(call BUILD_MINGW_TARBALL,$(host))))
 endif
 
 ifeq ($(CFG_DISABLE_DOCS),)
index a7f5a489dc5b4fcc429d084d1c26c36ac104a924..573b7ac79fd1a2fc20241ab854b8d6d25dc42859 100644 (file)
@@ -36,7 +36,10 @@ endef
 
 # Copy an executable
 # $(1) is the filename/libname-glob
+#
+# Gee, what's up with that $(nop)? See comment below.
 define PREPARE_BIN
+       $(nop)
        @$(call E, prepare: $(PREPARE_DEST_BIN_DIR)/$(1))
        $(Q)$(PREPARE_BIN_CMD) $(PREPARE_SOURCE_BIN_DIR)/$(1) $(PREPARE_DEST_BIN_DIR)/$(1)
 endef
@@ -119,6 +122,8 @@ define DEF_PREPARE_TARGET_N
 # Rebind PREPARE_*_LIB_DIR to point to rustlib, then install the libs for the targets
 prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_WORKING_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_LIB_DIR)/rustlib/$(2)/lib
 prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR)/rustlib/$(2)/lib
+prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_LIB_DIR)/rustlib/$(3)/bin
+prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_LIB_DIR)/rustlib/$(3)/bin
 prepare-target-$(2)-host-$(3)-$(1)-$(4): prepare-maybe-clean-$(4) \
         $$(foreach crate,$$(TARGET_CRATES), \
           $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
@@ -133,6 +138,7 @@ prepare-target-$(2)-host-$(3)-$(1)-$(4): prepare-maybe-clean-$(4) \
       $$(if $$(findstring $(2), $$(PREPARE_TARGETS)), \
         $$(if $$(findstring $(3), $$(PREPARE_HOST)), \
           $$(call PREPARE_DIR,$$(PREPARE_WORKING_DEST_LIB_DIR)) \
+          $$(call PREPARE_DIR,$$(PREPARE_DEST_BIN_DIR)) \
           $$(foreach crate,$$(TARGET_CRATES), \
            $$(if $$(or $$(findstring 1, $$(ONLY_RLIB_$$(crate))),$$(findstring 1,$$(CFG_INSTALL_ONLY_RLIB_$(2)))),, \
               $$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$(2),$$(crate)))) \
@@ -141,7 +147,10 @@ prepare-target-$(2)-host-$(3)-$(1)-$(4): prepare-maybe-clean-$(4) \
             $$(foreach crate,$$(HOST_CRATES), \
               $$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$(2),$$(crate)))),) \
          $$(foreach object,$$(INSTALLED_OBJECTS_$(2)),\
-           $$(call PREPARE_LIB,$$(object))),),),)
+           $$(call PREPARE_LIB,$$(object))) \
+         $$(foreach bin,$$(INSTALLED_BINS_$(3)),\
+           $$(call PREPARE_BIN,$$(bin))) \
+       ,),),)
 endef
 
 define INSTALL_GDB_DEBUGGER_SCRIPTS_COMMANDS