2011-05-13 16:40:28 +02:00
|
|
|
#
|
2013-03-21 22:11:30 +01:00
|
|
|
# Linux-specific packaging script
|
2011-05-13 16:40:28 +02:00
|
|
|
#
|
|
|
|
|
2013-03-21 22:11:30 +01:00
|
|
|
ifndef OPENPILOT_IS_COOL
|
|
|
|
$(error Top level Makefile must be used to build this target)
|
|
|
|
endif
|
|
|
|
|
2015-02-01 21:34:05 +01:00
|
|
|
DEB_VER := $(subst RELEASE-,,$(PACKAGE_LBL))-1
|
2015-01-08 23:05:29 +01:00
|
|
|
DEB_DIR := $(ROOT_DIR)/package/linux/debian
|
2011-12-19 01:58:42 +01:00
|
|
|
DEB_BUILD_DIR := $(ROOT_DIR)/debian
|
|
|
|
|
|
|
|
SED_DATE_STRG = $(shell date -R)
|
2015-01-09 05:29:01 +01:00
|
|
|
SED_SCRIPT = s/<VERSION>/$(DEB_VER)/;s/<DATE>/$(SED_DATE_STRG)/
|
2011-12-19 01:58:42 +01:00
|
|
|
|
2015-01-09 04:49:28 +01:00
|
|
|
DEB_ARCH := $(shell dpkg --print-architecture)
|
2015-01-09 05:29:01 +01:00
|
|
|
DEB_PACKAGE_NAME := openpilot_$(DEB_VER)_$(DEB_ARCH)
|
2011-12-19 01:58:42 +01:00
|
|
|
|
2013-03-21 22:11:30 +01:00
|
|
|
.PHONY: package
|
2015-01-08 23:05:29 +01:00
|
|
|
package:
|
2012-12-05 16:40:14 +01:00
|
|
|
$(V1) echo "Building Linux package, please wait..."
|
2015-01-08 23:54:02 +01:00
|
|
|
$(V1) cp -rL $(DEB_DIR) $(DEB_BUILD_DIR)
|
2015-01-30 23:04:10 +01:00
|
|
|
$(V1) sed -i -e "$(SED_SCRIPT)" $(DEB_BUILD_DIR)/changelog
|
|
|
|
$(V1) dpkg-buildpackage -b -us -uc
|
2015-01-08 23:05:29 +01:00
|
|
|
$(V1) mv $(ROOT_DIR)/../$(DEB_PACKAGE_NAME).deb $(BUILD_DIR)/$(DEB_PACKAGE_NAME).deb
|
|
|
|
$(V1) mv $(ROOT_DIR)/../$(DEB_PACKAGE_NAME).changes $(BUILD_DIR)/$(DEB_PACKAGE_NAME).changes
|
2012-12-05 16:40:14 +01:00
|
|
|
$(V1) rm -rf $(DEB_BUILD_DIR)
|
2015-01-30 23:16:57 +01:00
|
|
|
|
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# Install OpenPilot
|
|
|
|
#
|
|
|
|
##############################
|
|
|
|
prefix := /usr/local
|
|
|
|
bindir := $(prefix)/bin
|
|
|
|
libdir := $(prefix)/lib
|
|
|
|
datadir := $(prefix)/share
|
|
|
|
|
|
|
|
INSTALL = cp -a --no-preserve=ownership
|
|
|
|
LN = ln
|
|
|
|
LN_S = ln -s
|
|
|
|
|
|
|
|
.PHONY: install
|
|
|
|
install:
|
|
|
|
@$(ECHO) " INSTALLING GCS TO $(DESTDIR)/)"
|
|
|
|
$(V1) $(MKDIR) -p $(DESTDIR)$(bindir)
|
|
|
|
$(V1) $(MKDIR) -p $(DESTDIR)$(libdir)
|
|
|
|
$(V1) $(MKDIR) -p $(DESTDIR)$(datadir)
|
|
|
|
$(V1) $(MKDIR) -p $(DESTDIR)$(datadir)/applications
|
|
|
|
$(V1) $(MKDIR) -p $(DESTDIR)$(datadir)/pixmaps
|
|
|
|
$(V1) $(MKDIR) -p $(DESTDIR)$(udevdir)
|
|
|
|
$(V1) $(INSTALL) $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)/bin/openpilotgcs $(DESTDIR)$(bindir)
|
|
|
|
$(V1) $(INSTALL) $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)/bin/udp_test $(DESTDIR)$(bindir)
|
|
|
|
$(V1) $(INSTALL) $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)/lib/openpilotgcs $(DESTDIR)$(libdir)
|
|
|
|
$(V1) $(INSTALL) $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)/share/openpilotgcs $(DESTDIR)$(datadir)
|
|
|
|
$(V1) $(INSTALL) $(ROOT_DIR)/package/linux/openpilot.desktop $(DESTDIR)$(datadir)/applications
|
|
|
|
$(V1) $(INSTALL) $(ROOT_DIR)/package/linux/openpilot.png $(DESTDIR)$(datadir)/pixmaps
|
|
|
|
$(V1) rm $(DESTDIR)/$(datadir)/openpilotgcs/translations/Makefile
|
|
|
|
|
|
|
|
|