From 672749d0d72f4b7f91ca62f91cfecf1e822449b9 Mon Sep 17 00:00:00 2001 From: James Duley Date: Wed, 25 Nov 2015 16:06:17 +0000 Subject: [PATCH] LP-187 MSYS2: add arch to installer filename --- Makefile | 2 ++ make/functions.mk | 1 - package/Windows.mk | 11 ++++++++++- package/winx86/gcs.nsi | 6 +++++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ef5d4e741..0d03a9510 100644 --- a/Makefile +++ b/Makefile @@ -130,6 +130,8 @@ else ifeq ($(V), 0) else ifeq ($(V), 1) endif +ARCH := $(call get_arch) + # Include tools installers include $(ROOT_DIR)/make/tools.mk diff --git a/make/functions.mk b/make/functions.mk index acd77b302..9054524fa 100644 --- a/make/functions.mk +++ b/make/functions.mk @@ -19,7 +19,6 @@ # Make sure we know few things about the architecture before including # the tools.mk to ensure that we download/install the right tools. UNAME := $(shell uname) -ARCH := $(shell uname -m) # Here and everywhere if not Linux or Mac then assume Windows ifeq ($(filter Linux Darwin, $(UNAME)), ) UNAME := Windows diff --git a/package/Windows.mk b/package/Windows.mk index 82228db04..ee6e50c0e 100644 --- a/package/Windows.mk +++ b/package/Windows.mk @@ -6,12 +6,20 @@ ifndef TOP_LEVEL_MAKEFILE $(error Top level Makefile must be used to build this target) endif +PACKAGE_EXE := $(BUILD_DIR)/$(PACKAGE_FULL_NAME)_$(ARCH).exe + NSIS_OPTS := -V3 NSIS_WINX86 := $(ROOT_DIR)/package/winx86 NSIS_SCRIPT := $(NSIS_WINX86)/gcs.nsi +ifeq ($(ARCH),x86_64) +WIN_DEF = -DW64 +endif + .PHONY: package -package: gcs uavobjects_matlab | $(PACKAGE_DIR) +package: $(PACKAGE_EXE) + +$(PACKAGE_EXE): $(NSIS_SCRIPT) gcs uavobjects_matlab | $(PACKAGE_DIR) ifneq ($(GCS_BUILD_CONF),release) # We can only package release builds $(error Packaging is currently supported for release builds only) @@ -29,4 +37,5 @@ endif -DPROJECT_ROOT='$(call system_path,$(ROOT_DIR))' \ -DGCS_BUILD_TREE='$(call system_path,$(GCS_DIR))' \ -DUAVO_SYNTH_TREE='$(call system_path,$(UAVOBJ_OUT_DIR))' \ + $(WIN_DEF) \ $(NSIS_SCRIPT) diff --git a/package/winx86/gcs.nsi b/package/winx86/gcs.nsi index ba7b49fb1..3d5b1f6f2 100644 --- a/package/winx86/gcs.nsi +++ b/package/winx86/gcs.nsi @@ -37,7 +37,11 @@ !define AEROSIMRC_TREE "${GCS_BUILD_TREE}\misc\AeroSIM-RC" ; Default installation folder - InstallDir "$PROGRAMFILES\${ORG_BIG_NAME}" +!ifdef W64 + InstallDir "$PROGRAMFILES64\${ORG_BIG_NAME}" +!else + InstallDir "$PROGRAMFILES32\${ORG_BIG_NAME}" +!endif ; Get installation folder from registry if available InstallDirRegKey HKLM "Software\${ORG_BIG_NAME}" "Install Location"