2011-05-13 16:40:28 +02:00
|
|
|
#
|
|
|
|
# Linux-specific packaging
|
|
|
|
#
|
|
|
|
|
2011-12-19 01:58:42 +01:00
|
|
|
# Update this number for every formal release. The Deb packaging system relies on this to know to update a
|
|
|
|
# package or not. Otherwise, the user has to uninstall first.
|
2012-12-05 16:40:14 +01:00
|
|
|
# Until we do that, package name does NOT include $(VERNUM) and uses $(PACKAGE_LBL) only
|
2013-01-19 20:23:48 +01:00
|
|
|
VERNUM := 0.1.0
|
2011-12-19 01:58:42 +01:00
|
|
|
VERSION_FULL := $(VERNUM)-$(PACKAGE_LBL)
|
|
|
|
DEB_BUILD_DIR := $(ROOT_DIR)/debian
|
|
|
|
|
|
|
|
SED_DATE_STRG = $(shell date -R)
|
2012-12-21 03:48:48 +01:00
|
|
|
SED_SCRIPT = s/<VERSION>/$(VERNUM)/;s/<DATE>/$(SED_DATE_STRG)/
|
2011-12-19 01:58:42 +01:00
|
|
|
|
2013-01-19 20:23:48 +01:00
|
|
|
DEB_CFG_CMN := $(ROOT_DIR)/package/linux/deb_common
|
2011-12-19 01:58:42 +01:00
|
|
|
DEB_CFG_I386_DIR := $(ROOT_DIR)/package/linux/deb_i386
|
|
|
|
DEB_CFG_AMD64_DIR := $(ROOT_DIR)/package/linux/deb_amd64
|
2012-12-05 16:40:14 +01:00
|
|
|
DEB_CFG_CMN_FILES := $(shell ls $(DEB_CFG_CMN))
|
|
|
|
DEB_CFG_I386_FILES := $(shell ls $(DEB_CFG_I386_DIR))
|
2011-12-19 01:58:42 +01:00
|
|
|
DEB_CFG_AMD64_FILES := $(shell ls $(DEB_CFG_AMD64_DIR))
|
2012-12-05 16:40:14 +01:00
|
|
|
|
2011-12-19 01:58:42 +01:00
|
|
|
DEB_PLATFORM := amd64
|
|
|
|
DEB_MACHINE_DIR := $(DEB_CFG_AMD64_DIR)
|
|
|
|
DEB_MACHINE_FILES := $(DEB_CFG_AMD64_FILES)
|
|
|
|
MACHINE_TYPE := $(shell uname -m)
|
|
|
|
ifneq ($(MACHINE_TYPE), x86_64)
|
2013-01-19 20:23:48 +01:00
|
|
|
DEB_PLATFORM := i386
|
|
|
|
DEB_MACHINE_DIR := $(DEB_CFG_I386_DIR)
|
|
|
|
DEB_MACHINE_FILES := $(DEB_CFG_I386_FILES)
|
2011-12-19 01:58:42 +01:00
|
|
|
endif
|
2012-12-21 03:48:48 +01:00
|
|
|
DEB_PACKAGE_NAME := openpilot_$(VERNUM)_$(DEB_PLATFORM)
|
2012-12-11 15:35:16 +01:00
|
|
|
FULL_PACKAGE_NAME := $(PACKAGE_NAME)$(PACKAGE_SEP)$(PACKAGE_LBL)$(PACKAGE_SEP)$(DEB_PLATFORM)
|
2012-12-05 16:40:14 +01:00
|
|
|
|
2011-12-19 01:58:42 +01:00
|
|
|
ALL_DEB_FILES = $(foreach f, $(DEB_CFG_CMN_FILES), $(DEB_BUILD_DIR)/$(f))
|
|
|
|
ALL_DEB_FILES += $(foreach f, $(DEB_MACHINE_FILES), $(DEB_BUILD_DIR)/$(f))
|
|
|
|
|
2012-12-05 16:40:14 +01:00
|
|
|
linux_deb_package: $(ALL_DEB_FILES) gcs package_flight
|
|
|
|
$(V1) echo "Building Linux package, please wait..."
|
|
|
|
$(V1) mkdir -p $(DEB_BUILD_DIR)
|
2013-01-19 20:23:48 +01:00
|
|
|
$(V1)$(shell echo $(FW_DIR) > $(BUILD_DIR)/package_dir)
|
|
|
|
$(V1)sed -i -e "$(SED_SCRIPT)" $(DEB_BUILD_DIR)/changelog
|
2012-12-05 16:40:14 +01:00
|
|
|
$(V1) cd .. && dpkg-buildpackage -b -us -uc
|
2012-12-11 15:35:16 +01:00
|
|
|
$(V1) mv $(ROOT_DIR)/../$(DEB_PACKAGE_NAME).deb $(BUILD_DIR)/$(FULL_PACKAGE_NAME).deb
|
|
|
|
$(V1) mv $(ROOT_DIR)/../$(DEB_PACKAGE_NAME).changes $(BUILD_DIR)/$(FULL_PACKAGE_NAME).changes
|
2012-12-05 16:40:14 +01:00
|
|
|
$(V1) rm -rf $(DEB_BUILD_DIR)
|
2011-12-19 01:58:42 +01:00
|
|
|
|
2012-12-05 16:40:14 +01:00
|
|
|
$(ALL_DEB_FILES): | uavobjects
|
2011-12-19 01:58:42 +01:00
|
|
|
|
2012-12-05 16:40:14 +01:00
|
|
|
define CP_DEB_FILES_TEMPLATE
|
|
|
|
.PHONY: $(2)/$(1)
|
|
|
|
$(2)/$(1): $(3)/$(1)
|
|
|
|
$(V1) mkdir -p $(2)
|
|
|
|
$(V1) cp -a $$< $$@
|
|
|
|
endef
|
2011-12-19 01:58:42 +01:00
|
|
|
|
|
|
|
$(foreach cpfile, $(DEB_CFG_CMN_FILES), $(eval $(call CP_DEB_FILES_TEMPLATE,$(cpfile),$(DEB_BUILD_DIR),$(DEB_CFG_CMN))))
|
|
|
|
$(foreach cpfile, $(DEB_MACHINE_FILES), $(eval $(call CP_DEB_FILES_TEMPLATE,$(cpfile),$(DEB_BUILD_DIR),$(DEB_MACHINE_DIR))))
|
|
|
|
|
2011-05-13 16:40:28 +02:00
|
|
|
gcs: uavobjects
|
|
|
|
$(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@
|
|
|
|
|
2012-12-05 16:40:14 +01:00
|
|
|
ground_package: | linux_deb_package
|
2011-05-13 16:40:28 +02:00
|
|
|
|
2012-12-05 16:40:14 +01:00
|
|
|
.PHONY: gcs ground_package linux_deb_package
|