From 844cfa4538795c3ca1df853b1f9661966fc2f177 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 28 Aug 2018 00:10:48 -0700 Subject: [PATCH] Clean up windows sdk build * Pass ATREE_STRIP to use hermetic strip tool * Stop using sdk/build/..., which has been empty * Use soong_zip for faster, more reproducible zip files * Add more dependencies * Remove some echos to clean up output Test: m win_sdk Change-Id: I9bfbf6565dbeb4cc48ddd037596b8408ea3c3157 --- build/tools/windows_sdk.mk | 46 +++++++++----------------------------- 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/build/tools/windows_sdk.mk b/build/tools/windows_sdk.mk index 28ac714e845..afe21c94c96 100644 --- a/build/tools/windows_sdk.mk +++ b/build/tools/windows_sdk.mk @@ -19,11 +19,6 @@ ifeq ($(strip $(shell which unix2dos todos 2>/dev/null)),) $(error Need a unix2dos command. Please 'apt-get install tofrodos') endif -# Define WIN_SDK_TARGETS (the list of targets located in topdir/sdk) -# and the WIN_SDK_BUILD_PREREQ (the list of build prerequisites) -# that are tools-dependent and not platform-dependent. -include $(TOPDIR)sdk/build/windows_sdk_tools.mk - # This is the list of targets that we want to generate as # Windows executables. All the targets specified here are located in # the topdir/development directory and are somehow platform-dependent. @@ -43,8 +38,7 @@ WIN_TARGETS := \ llvm-rs-cc \ sqlite3 \ zipalign \ - split-select \ - $(WIN_SDK_TARGETS) + split-select WIN_TARGETS := $(foreach t,$(WIN_TARGETS),$(ALL_MODULES.host_cross_$(t).INSTALLED)) @@ -63,41 +57,21 @@ endif .PHONY: win_sdk winsdk-tools -define winsdk-banner -$(info ) -$(info ====== [Windows SDK] $1 ======) -$(info ) -endef - -define winsdk-info -$(info MAIN_SDK_NAME: $(MAIN_SDK_NAME)) -$(info WIN_SDK_NAME : $(WIN_SDK_NAME)) -$(info WIN_SDK_DIR : $(WIN_SDK_DIR)) -$(info WIN_SDK_ZIP : $(WIN_SDK_ZIP)) -endef - win_sdk: $(WIN_SDK_ZIP) - $(call winsdk-banner,Done) winsdk-tools: $(WIN_TARGETS) - $(call winsdk-banner,Tools Done) -$(WIN_SDK_ZIP): $(WIN_TARGETS) $(INTERNAL_SDK_TARGET) - $(call winsdk-banner,Build $(WIN_SDK_NAME)) - $(call winsdk-info) - $(hide) rm -rf $(WIN_SDK_DIR) +$(WIN_SDK_ZIP): $(WIN_TARGETS) $(INTERNAL_SDK_TARGET) $(SOONG_ZIP) \ + $(HOST_OUT_EXECUTABLES)/atree \ + development/build/tools/patch_windows_sdk.sh \ + development/build/sdk-windows-x86.atree + @echo Build Windows SDK $(WIN_SDK_NAME) + $(hide) rm -rf $(WIN_SDK_DIR) $@ $(hide) mkdir -p $(WIN_SDK_DIR) $(hide) cp -rf $(MAIN_SDK_DIR)/$(MAIN_SDK_NAME) $(WIN_SDK_DIR)/$(WIN_SDK_NAME) $(hide) USB_DRIVER_HOOK=$(USB_DRIVER_HOOK) \ PLATFORM_VERSION=$(PLATFORM_VERSION) \ - $(TOPDIR)development/build/tools/patch_windows_sdk.sh $(subst @,-q,$(hide)) \ - $(WIN_SDK_DIR)/$(WIN_SDK_NAME) $(OUT_DIR) $(TOPDIR) - $(hide) PLATFORM_VERSION=$(PLATFORM_VERSION) \ - $(TOPDIR)sdk/build/patch_windows_sdk.sh $(subst @,-q,$(hide)) \ + ATREE_STRIP=$(HOST_STRIP) \ + development/build/tools/patch_windows_sdk.sh -q \ $(WIN_SDK_DIR)/$(WIN_SDK_NAME) $(OUT_DIR) $(TOPDIR) - $(hide) ( \ - cd $(WIN_SDK_DIR) && \ - rm -f $(WIN_SDK_NAME).zip && \ - zip -rq $(subst @,-q,$(hide)) $(WIN_SDK_NAME).zip $(WIN_SDK_NAME) \ - ) - @echo "Windows SDK generated at $(WIN_SDK_ZIP)" + $(hide) $(SOONG_ZIP) -d -C $(WIN_SDK_DIR) -D $(WIN_SDK_DIR)/$(WIN_SDK_NAME) -o $@