From 3dec910954e2370c8ccf7519ce6ef9226e1377f7 Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Sat, 28 May 2011 03:14:51 +0300 Subject: [PATCH] package: now it is called 'make package' instead of 'make release' --- Makefile | 6 +-- {release => package}/Makefile | 38 +++++++++--------- {release => package}/Makefile.linux | 0 package/Makefile.osx | 20 +++++++++ {release => package}/Makefile.winx86 | 13 +++--- {release => package}/osx/OpenPilot.dmg | Bin {release => package}/osx/libraries | 0 {release => package}/osx/package | 10 ++--- .../winx86/licenses/GPLv3_de.rtf | 0 .../winx86/licenses/GPLv3_en.rtf | 0 .../winx86/licenses/GPLv3_es.rtf | 0 .../winx86/licenses/GPLv3_fr.rtf | 0 .../winx86/licenses/GPLv3_ru.rtf | 0 .../winx86/licenses/GPLv3_zh_CN.rtf | 0 {release => package}/winx86/openpilotgcs.nsi | 12 +++--- {release => package}/winx86/openpilotgcs.tpl | 8 ++-- .../winx86/resources/header.bmp | Bin .../winx86/resources/openpilot.ico | Bin .../winx86/resources/welcome.bmp | Bin .../winx86/translations/languages.nsh | 0 .../winx86/translations/strings_de.nsh | 0 .../winx86/translations/strings_en.nsh | 0 .../winx86/translations/strings_es.nsh | 0 .../winx86/translations/strings_fr.nsh | 0 .../winx86/translations/strings_ru.nsh | 0 .../winx86/translations/strings_zh_CN.nsh | 0 release/Makefile.osx | 20 --------- 27 files changed, 65 insertions(+), 62 deletions(-) rename {release => package}/Makefile (80%) rename {release => package}/Makefile.linux (100%) create mode 100644 package/Makefile.osx rename {release => package}/Makefile.winx86 (54%) rename {release => package}/osx/OpenPilot.dmg (100%) rename {release => package}/osx/libraries (100%) rename {release => package}/osx/package (71%) rename {release => package}/winx86/licenses/GPLv3_de.rtf (100%) rename {release => package}/winx86/licenses/GPLv3_en.rtf (100%) rename {release => package}/winx86/licenses/GPLv3_es.rtf (100%) rename {release => package}/winx86/licenses/GPLv3_fr.rtf (100%) rename {release => package}/winx86/licenses/GPLv3_ru.rtf (100%) rename {release => package}/winx86/licenses/GPLv3_zh_CN.rtf (100%) rename {release => package}/winx86/openpilotgcs.nsi (94%) rename {release => package}/winx86/openpilotgcs.tpl (74%) rename {release => package}/winx86/resources/header.bmp (100%) rename {release => package}/winx86/resources/openpilot.ico (100%) rename {release => package}/winx86/resources/welcome.bmp (100%) rename {release => package}/winx86/translations/languages.nsh (100%) rename {release => package}/winx86/translations/strings_de.nsh (100%) rename {release => package}/winx86/translations/strings_en.nsh (100%) rename {release => package}/winx86/translations/strings_es.nsh (100%) rename {release => package}/winx86/translations/strings_fr.nsh (100%) rename {release => package}/winx86/translations/strings_ru.nsh (100%) rename {release => package}/winx86/translations/strings_zh_CN.nsh (100%) delete mode 100644 release/Makefile.osx diff --git a/Makefile b/Makefile index 79c9cf292..6b0601ebb 100644 --- a/Makefile +++ b/Makefile @@ -457,9 +457,9 @@ sim_win32_%: uavobjects_flight ############################## # -# Release packaging components +# Packaging components # ############################## -.PHONY: release -release: +.PHONY: package +package: $(V1) cd $@ && $(MAKE) --no-print-directory $@ diff --git a/release/Makefile b/package/Makefile similarity index 80% rename from release/Makefile rename to package/Makefile index 645a67758..67db6b129 100644 --- a/release/Makefile +++ b/package/Makefile @@ -14,9 +14,9 @@ ROOT_DIR := $(realpath $(WHEREAMI)/../) # Set up some macros BUILD_DIR := $(ROOT_DIR)/build VERSION_CMD := python $(ROOT_DIR)/make/scripts/version-info.py --path="$(ROOT_DIR)" -RELEASE_LBL := $(shell $(VERSION_CMD) --format=\$${DATE}-\$${TAG_OR_HASH8}\$${DIRTY}) -RELEASE_DIR := $(BUILD_DIR)/release-$(RELEASE_LBL) -FW_DIR := $(RELEASE_DIR)/firmware-$(RELEASE_LBL) +PACKAGE_LBL := $(shell $(VERSION_CMD) --format=\$${DATE}-\$${TAG_OR_HASH8}\$${DIRTY}) +PACKAGE_DIR := $(BUILD_DIR)/package-$(PACKAGE_LBL) +FW_DIR := $(PACKAGE_DIR)/firmware-$(PACKAGE_LBL) BL_DIR := $(FW_DIR)/bootloaders BU_DIR := $(FW_DIR)/bootloader-updaters FE_DIR := $(FW_DIR)/flash-erase-tools @@ -52,11 +52,11 @@ help: @echo " Here is a summary of the available targets:" @echo @echo " [Packaging]" - @echo " release - Build and package the OpenPilot distributable" - @echo " release_flight - Build and package the OpenPilot flight firmware only" + @echo " package - Build and package the OpenPilot distributable" + @echo " package_flight - Build and package the OpenPilot flight firmware only" @echo @echo " Notes:" - @echo " - package will be placed in $(RELEASE_DIR)" + @echo " - package will be placed in $(PACKAGE_DIR)" @echo @echo " - the build directory will be removed first on every run unless one" @echo " of CLEAN_BUILD=NO or CLEAN_BUILD=NEVER options is defined." @@ -101,19 +101,19 @@ endif endef # Firmware for different input drivers -$(eval $(call INSTALL_TEMPLATE,fw_common,uavobjects,$(FW_DIR),,-$(RELEASE_LBL),,,$(FW_TARGETS_COMMON),install)) -$(eval $(call INSTALL_TEMPLATE,fw_pwm,uavobjects,$(FW_DIR),,-pwm-$(RELEASE_LBL),,clean,$(FW_TARGETS_INPUT),install)) -$(eval $(call INSTALL_TEMPLATE,fw_spektrum,uavobjects,$(FW_DIR),,-spektrum-$(RELEASE_LBL),USE_SPEKTRUM=YES,clean,$(FW_TARGETS_INPUT),install)) -$(eval $(call INSTALL_TEMPLATE,fw_ppm,uavobjects,$(FW_DIR),,-ppm-$(RELEASE_LBL),USE_PPM=YES,clean,$(FW_TARGETS_INPUT),install)) +$(eval $(call INSTALL_TEMPLATE,fw_common,uavobjects,$(FW_DIR),,-$(PACKAGE_LBL),,,$(FW_TARGETS_COMMON),install)) +$(eval $(call INSTALL_TEMPLATE,fw_pwm,uavobjects,$(FW_DIR),,-pwm-$(PACKAGE_LBL),,clean,$(FW_TARGETS_INPUT),install)) +$(eval $(call INSTALL_TEMPLATE,fw_spektrum,uavobjects,$(FW_DIR),,-spektrum-$(PACKAGE_LBL),USE_SPEKTRUM=YES,clean,$(FW_TARGETS_INPUT),install)) +$(eval $(call INSTALL_TEMPLATE,fw_ppm,uavobjects,$(FW_DIR),,-ppm-$(PACKAGE_LBL),USE_PPM=YES,clean,$(FW_TARGETS_INPUT),install)) # Bootloaders (change 'install' to 'bin' if you don't want to install bootloaders) -$(eval $(call INSTALL_TEMPLATE,all_bl,uavobjects,$(BL_DIR),,-$(RELEASE_LBL),,,$(BL_TARGETS),install)) +$(eval $(call INSTALL_TEMPLATE,all_bl,uavobjects,$(BL_DIR),,-$(PACKAGE_LBL),,,$(BL_TARGETS),install)) # Bootloader updaters -$(eval $(call INSTALL_TEMPLATE,all_bu,all_bl,$(BU_DIR),,-$(RELEASE_LBL),,,$(BU_TARGETS),install)) +$(eval $(call INSTALL_TEMPLATE,all_bu,all_bl,$(BU_DIR),,-$(PACKAGE_LBL),,,$(BU_TARGETS),install)) # CopterControl flash eraser tool -$(eval $(call INSTALL_TEMPLATE,fw_tools,uavobjects,$(FE_DIR),,-flash-erase-$(RELEASE_LBL),ERASE_FLASH=YES,clean,$(FW_TARGETS_TOOLS),install)) +$(eval $(call INSTALL_TEMPLATE,fw_tools,uavobjects,$(FE_DIR),,-flash-erase-$(PACKAGE_LBL),ERASE_FLASH=YES,clean,$(FW_TARGETS_TOOLS),install)) # Order-only dependencies # They are bit complicated to support parallel (-j) builds and to create @@ -127,17 +127,17 @@ fw_ppm: | fw_spektrum # ordered build fw_tools: | fw_spektrum # ordered build, replace fw_spektrum by fw_ppm if uncommented below -release_fw: | fw_common fw_pwm fw_spektrum # fw_ppm +package_fw: | fw_common fw_pwm fw_spektrum # fw_ppm -release_bu: | all_bu +package_bu: | all_bu -release_flight: | release_fw release_bu fw_tools +package_flight: | package_fw package_bu fw_tools -release_ground: | ground_package +package_ground: | ground_package -release: | release_flight release_ground +package: | package_flight package_ground -.PHONY: help uavobjects all_clean release release_flight release_fw release_bu release_ground +.PHONY: help uavobjects all_clean package package_flight package_fw package_bu package_ground # Decide on a verbosity level based on the V= parameter export AT := @ diff --git a/release/Makefile.linux b/package/Makefile.linux similarity index 100% rename from release/Makefile.linux rename to package/Makefile.linux diff --git a/package/Makefile.osx b/package/Makefile.osx new file mode 100644 index 000000000..e2b3c62ba --- /dev/null +++ b/package/Makefile.osx @@ -0,0 +1,20 @@ +# +# MacOSX-specific packaging +# + +osx_package: gcs package_flight + ( \ + ROOT_DIR="$(ROOT_DIR)" \ + BUILD_DIR="$(BUILD_DIR)" \ + PACKAGE_LBL="$(PACKAGE_LBL)" \ + PACKAGE_DIR="$(PACKAGE_DIR)" \ + FW_DIR="$(FW_DIR)" \ + "$(ROOT_DIR)/package/osx/package" \ + ) + +gcs: uavobjects + $(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@ + +ground_package: | osx_package + +.PHONY: gcs ground_package osx_package diff --git a/release/Makefile.winx86 b/package/Makefile.winx86 similarity index 54% rename from release/Makefile.winx86 rename to package/Makefile.winx86 index 1c8a1db4c..5ff65a97d 100644 --- a/release/Makefile.winx86 +++ b/package/Makefile.winx86 @@ -4,19 +4,22 @@ NSIS_CMD := makensis.exe NSIS_OPTS := /V3 -NSIS_DIR := $(ROOT_DIR)/release/winx86 +NSIS_DIR := $(ROOT_DIR)/package/winx86 NSIS_SCRIPT := $(NSIS_DIR)/openpilotgcs.nsi NSIS_TEMPLATE := $(NSIS_DIR)/openpilotgcs.tpl NSIS_HEADER := $(BUILD_DIR)/ground/openpilotgcs/openpilotgcs.nsh -package: gcs release_flight - mkdir -p "$(dir $(NSIS_HEADER))" +win_package: gcs package_flight + $(V1) mkdir -p "$(dir $(NSIS_HEADER))" $(VERSION_CMD) --template="$(NSIS_TEMPLATE)" --outfile="$(NSIS_HEADER)" + $(V1) echo "Building Windows installer, please wait..." + $(V1) echo "If you have a script error in line 1 - use Unicode NSIS 2.46+" + $(V1) echo " http://www.scratchpaper.com" $(NSIS_CMD) $(NSIS_OPTS) $(NSIS_SCRIPT) gcs: uavobjects $(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@ -ground_package: | package +ground_package: | win_package -.PHONY: gcs ground_package package +.PHONY: gcs ground_package win_package diff --git a/release/osx/OpenPilot.dmg b/package/osx/OpenPilot.dmg similarity index 100% rename from release/osx/OpenPilot.dmg rename to package/osx/OpenPilot.dmg diff --git a/release/osx/libraries b/package/osx/libraries similarity index 100% rename from release/osx/libraries rename to package/osx/libraries diff --git a/release/osx/package b/package/osx/package similarity index 71% rename from release/osx/package rename to package/osx/package index 2983d98cc..a12e7e9fe 100755 --- a/release/osx/package +++ b/package/osx/package @@ -1,19 +1,19 @@ #!/bin/bash # the following environment variables must be set -: ${ROOT_DIR?} ${BUILD_DIR?} ${RELEASE_LBL?} ${RELEASE_DIR?} ${FW_DIR?} +: ${ROOT_DIR?} ${BUILD_DIR?} ${PACKAGE_LBL?} ${PACKAGE_DIR?} ${FW_DIR?} # more variables APP_PATH="${BUILD_DIR}/ground/openpilotgcs/bin/OpenPilot GCS.app" -TEMP_FILE="${RELEASE_DIR}/OpenPilot-temp.dmg" -OUT_FILE="${RELEASE_DIR}/OpenPilot-${RELEASE_LBL}.dmg" +TEMP_FILE="${PACKAGE_DIR}/OpenPilot-temp.dmg" +OUT_FILE="${PACKAGE_DIR}/OpenPilot-${PACKAGE_LBL}.dmg" VOL_NAME="OpenPilot" # prepare the stage rm -f "${TEMP_FILE}" rm -f "${OUT_FILE}" -hdiutil convert "${ROOT_DIR}/release/osx/OpenPilot.dmg" \ +hdiutil convert "${ROOT_DIR}/package/osx/OpenPilot.dmg" \ -format UDRW -o "${TEMP_FILE}" device=$(hdiutil attach "${TEMP_FILE}" | \ egrep '^/dev/' | sed 1q | awk '{print $1}') @@ -22,7 +22,7 @@ device=$(hdiutil attach "${TEMP_FILE}" | \ cp -r "${APP_PATH}" "/Volumes/${VOL_NAME}" cp -r "${FW_DIR}" "/Volumes/${VOL_NAME}/firmware" -"${ROOT_DIR}/release/osx/libraries" \ +"${ROOT_DIR}/package/osx/libraries" \ "/Volumes/${VOL_NAME}/OpenPilot GCS.app" || exit 1 hdiutil detach ${device} diff --git a/release/winx86/licenses/GPLv3_de.rtf b/package/winx86/licenses/GPLv3_de.rtf similarity index 100% rename from release/winx86/licenses/GPLv3_de.rtf rename to package/winx86/licenses/GPLv3_de.rtf diff --git a/release/winx86/licenses/GPLv3_en.rtf b/package/winx86/licenses/GPLv3_en.rtf similarity index 100% rename from release/winx86/licenses/GPLv3_en.rtf rename to package/winx86/licenses/GPLv3_en.rtf diff --git a/release/winx86/licenses/GPLv3_es.rtf b/package/winx86/licenses/GPLv3_es.rtf similarity index 100% rename from release/winx86/licenses/GPLv3_es.rtf rename to package/winx86/licenses/GPLv3_es.rtf diff --git a/release/winx86/licenses/GPLv3_fr.rtf b/package/winx86/licenses/GPLv3_fr.rtf similarity index 100% rename from release/winx86/licenses/GPLv3_fr.rtf rename to package/winx86/licenses/GPLv3_fr.rtf diff --git a/release/winx86/licenses/GPLv3_ru.rtf b/package/winx86/licenses/GPLv3_ru.rtf similarity index 100% rename from release/winx86/licenses/GPLv3_ru.rtf rename to package/winx86/licenses/GPLv3_ru.rtf diff --git a/release/winx86/licenses/GPLv3_zh_CN.rtf b/package/winx86/licenses/GPLv3_zh_CN.rtf similarity index 100% rename from release/winx86/licenses/GPLv3_zh_CN.rtf rename to package/winx86/licenses/GPLv3_zh_CN.rtf diff --git a/release/winx86/openpilotgcs.nsi b/package/winx86/openpilotgcs.nsi similarity index 94% rename from release/winx86/openpilotgcs.nsi rename to package/winx86/openpilotgcs.nsi index 0bf5eb52a..9cad5d233 100644 --- a/release/winx86/openpilotgcs.nsi +++ b/package/winx86/openpilotgcs.nsi @@ -50,17 +50,17 @@ !define INSTALLER_NAME "OpenPilot GCS Installer" ; Read automatically generated version info -; !define RELEASE_LBL "${DATE}-${TAG_OR_HASH8}" -; !define RELEASE_DIR "..\..\build\release-$${RELEASE_LBL}" -; !define OUT_FILE "OpenPilotGCS-$${RELEASE_LBL}-install.exe" -; !define FIRMWARE_DIR "firmware-$${RELEASE_LBL}" +; !define PACKAGE_LBL "${DATE}-${TAG_OR_HASH8}" +; !define PACKAGE_DIR "..\..\build\package-$${PACKAGE_LBL}" +; !define OUT_FILE "OpenPilotGCS-$${PACKAGE_LBL}-install.exe" +; !define FIRMWARE_DIR "firmware-$${PACKAGE_LBL}" ; !define PRODUCT_VERSION "0.0.0.0" ; !define FILE_VERSION "${TAG_OR_BRANCH}:${HASH8} ${DATETIME}" ; !define BUILD_DESCRIPTION "${TAG_OR_BRANCH}:${HASH8} built using ${ORIGIN} as origin, committed ${DATETIME} as ${HASH}" !include "${GCS_BUILD_TREE}\openpilotgcs.nsh" Name "${PRODUCT_NAME}" - OutFile "${RELEASE_DIR}\${OUT_FILE}" + OutFile "${PACKAGE_DIR}\${OUT_FILE}" VIProductVersion ${PRODUCT_VERSION} VIAddVersionKey "ProductName" "${INSTALLER_NAME}" @@ -185,7 +185,7 @@ SectionEnd Section "Firmware" InSecFirmware SetOutPath "$INSTDIR\firmware\${FIRMWARE_DIR}" - File /r "${RELEASE_DIR}\${FIRMWARE_DIR}\*" + File /r "${PACKAGE_DIR}\${FIRMWARE_DIR}\*" SectionEnd Section "Shortcuts" InSecShortcuts diff --git a/release/winx86/openpilotgcs.tpl b/package/winx86/openpilotgcs.tpl similarity index 74% rename from release/winx86/openpilotgcs.tpl rename to package/winx86/openpilotgcs.tpl index f75c6503a..bb0adc452 100644 --- a/release/winx86/openpilotgcs.tpl +++ b/package/winx86/openpilotgcs.tpl @@ -12,10 +12,10 @@ # ; Some names, paths and constants -!define RELEASE_LBL "${DATE}-${TAG_OR_HASH8}${DIRTY}" -!define RELEASE_DIR "..\..\build\release-$${RELEASE_LBL}" -!define OUT_FILE "OpenPilot-$${RELEASE_LBL}-install.exe" -!define FIRMWARE_DIR "firmware-$${RELEASE_LBL}" +!define PACKAGE_LBL "${DATE}-${TAG_OR_HASH8}${DIRTY}" +!define PACKAGE_DIR "..\..\build\package-$${PACKAGE_LBL}" +!define OUT_FILE "OpenPilot-$${PACKAGE_LBL}-install.exe" +!define FIRMWARE_DIR "firmware-$${PACKAGE_LBL}" ; Installer version info !define PRODUCT_VERSION "0.0.0.0" diff --git a/release/winx86/resources/header.bmp b/package/winx86/resources/header.bmp similarity index 100% rename from release/winx86/resources/header.bmp rename to package/winx86/resources/header.bmp diff --git a/release/winx86/resources/openpilot.ico b/package/winx86/resources/openpilot.ico similarity index 100% rename from release/winx86/resources/openpilot.ico rename to package/winx86/resources/openpilot.ico diff --git a/release/winx86/resources/welcome.bmp b/package/winx86/resources/welcome.bmp similarity index 100% rename from release/winx86/resources/welcome.bmp rename to package/winx86/resources/welcome.bmp diff --git a/release/winx86/translations/languages.nsh b/package/winx86/translations/languages.nsh similarity index 100% rename from release/winx86/translations/languages.nsh rename to package/winx86/translations/languages.nsh diff --git a/release/winx86/translations/strings_de.nsh b/package/winx86/translations/strings_de.nsh similarity index 100% rename from release/winx86/translations/strings_de.nsh rename to package/winx86/translations/strings_de.nsh diff --git a/release/winx86/translations/strings_en.nsh b/package/winx86/translations/strings_en.nsh similarity index 100% rename from release/winx86/translations/strings_en.nsh rename to package/winx86/translations/strings_en.nsh diff --git a/release/winx86/translations/strings_es.nsh b/package/winx86/translations/strings_es.nsh similarity index 100% rename from release/winx86/translations/strings_es.nsh rename to package/winx86/translations/strings_es.nsh diff --git a/release/winx86/translations/strings_fr.nsh b/package/winx86/translations/strings_fr.nsh similarity index 100% rename from release/winx86/translations/strings_fr.nsh rename to package/winx86/translations/strings_fr.nsh diff --git a/release/winx86/translations/strings_ru.nsh b/package/winx86/translations/strings_ru.nsh similarity index 100% rename from release/winx86/translations/strings_ru.nsh rename to package/winx86/translations/strings_ru.nsh diff --git a/release/winx86/translations/strings_zh_CN.nsh b/package/winx86/translations/strings_zh_CN.nsh similarity index 100% rename from release/winx86/translations/strings_zh_CN.nsh rename to package/winx86/translations/strings_zh_CN.nsh diff --git a/release/Makefile.osx b/release/Makefile.osx deleted file mode 100644 index 52e4670ef..000000000 --- a/release/Makefile.osx +++ /dev/null @@ -1,20 +0,0 @@ -# -# MacOSX-specific packaging -# - -package: gcs release_flight - ( \ - ROOT_DIR="$(ROOT_DIR)" \ - BUILD_DIR="$(BUILD_DIR)" \ - RELEASE_LBL="$(RELEASE_LBL)" \ - RELEASE_DIR="$(RELEASE_DIR)" \ - FW_DIR="$(FW_DIR)" \ - "$(ROOT_DIR)/release/osx/package" \ - ) - -gcs: uavobjects - $(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@ - -ground_package: | package - -.PHONY: gcs ground_package package