From 0be56a900b6e1f69ae836cd1b4255f8589f0fe83 Mon Sep 17 00:00:00 2001 From: James Duley Date: Wed, 19 Aug 2015 09:58:48 +1200 Subject: [PATCH] LP-100 make firmware package: added fw_dist target This produces a tarball of the firmware --- Makefile | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 7ea686c4f..9972bd042 100644 --- a/Makefile +++ b/Makefile @@ -501,11 +501,14 @@ PACKAGE_SEP := - PACKAGE_FULL_NAME := $(PACKAGE_NAME)$(PACKAGE_SEP)$(PACKAGE_LBL) # Source distribution is never dirty because it uses git archive -DIST_LBL := $(subst -dirty,,$(PACKAGE_LBL)) -DIST_NAME := $(PACKAGE_NAME)$(PACKAGE_SEP)$(DIST_LBL) -DIST_TAR := $(DIST_DIR)/$(DIST_NAME).tar -DIST_TAR_GZ := $(DIST_TAR).gz -DIST_VER_INFO := $(DIST_DIR)/version-info.json +DIST_LBL := $(subst -dirty,,$(PACKAGE_LBL)) +DIST_NAME := $(PACKAGE_NAME)$(PACKAGE_SEP)$(DIST_LBL) +DIST_TAR := $(DIST_DIR)/$(DIST_NAME).tar +DIST_TAR_GZ := $(DIST_TAR).gz +FW_DIST_NAME := $(DIST_NAME)_firmware +FW_DIST_TAR := $(DIST_DIR)/$(FW_DIST_NAME).tar +FW_DIST_TAR_GZ := $(FW_DIST_TAR).gz +DIST_VER_INFO := $(DIST_DIR)/version-info.json include $(ROOT_DIR)/package/$(UNAME).mk @@ -535,6 +538,23 @@ dist_tar_gz: $(DIST_TAR_GZ) dist: dist_tar_gz +$(FW_DIST_TAR): $(PACKAGE_FW_TARGETS) | $(DIST_DIR) + @$(ECHO) " FIRMWARE FOR DISTRIBUTION $(call toprel, $(FW_DIST_TAR))" + $(V1) tar -c --file="$(FW_DIST_TAR)" --directory=$(FIRMWARE_DIR) \ + --transform='s,^,firmware/,' \ + $(foreach fw_targ,$(PACKAGE_FW_TARGETS),$(fw_targ)/$(fw_targ).opfw) + +$(FW_DIST_TAR_GZ): $(FW_DIST_TAR) + @$(ECHO) " FIRMWARE FOR DISTRIBUTION $(call toprel, $(FW_DIST_TAR_GZ))" + $(V1) gzip -kf "$(FW_DIST_TAR)" + +.PHONY: fw_dist_tar_gz +fw_dist_tar_gz: $(FW_DIST_TAR_GZ) + +.PHONY: fw_dist +fw_dist: fw_dist_tar_gz + + ############################## # # Source code formatting @@ -773,6 +793,7 @@ help: @$(ECHO) " package - Build and package the OpenPilot platform-dependent package (no clean)" @$(ECHO) " opfw_resource - Generate resources to embed firmware binaries into the GCS" @$(ECHO) " dist - Generate source archive for distribution" + @$(ECHO) " fw_dist - Generate archive of firmware" @$(ECHO) " install - Install GCS to \"DESTDIR\" with prefix \"prefix\" (Linux only)" @$(ECHO) @$(ECHO) " [Code Formatting]"