1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00
LibrePilot/package/Linux.mk
James Duley 8714a34238 LP-80 extend linux packaging: rework distro selection
Change-Id: I476f52296de254b3b04a200c14a3924a2832e452
2015-08-02 12:37:01 +01:00

60 lines
2.1 KiB
Makefile

#
# Linux-specific packaging script
#
ifndef TOP_LEVEL_MAKEFILE
$(error Top level Makefile must be used to build this target)
endif
# Are we using a debian based distro?
ifneq ($(wildcard /etc/apt/sources.list),)
include $(ROOT_DIR)/package/linux/deb.mk
# Are we using a rpm based distro?
else ifneq ($(wildcard /etc/yum.repos.d/*),)
include $(ROOT_DIR)/package/linux/rpm.mk
# Are we using an Arch based distro?
else ifneq ($(wildcard /etc/pacman.conf),)
$(info TODO: built in arch package)
endif
##############################
#
# Install Linux Target
#
##############################
enable-udev-rules := no
prefix := /usr/local
bindir := $(prefix)/bin
libbasename := lib
libdir := $(prefix)/$(libbasename)
datadir := $(prefix)/share
udevrulesdir := /etc/udev/rules.d
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) $(INSTALL) $(BUILD_DIR)/$(GCS_SMALL_NAME)_$(GCS_BUILD_CONF)/bin/$(GCS_SMALL_NAME) $(DESTDIR)$(bindir)
$(V1) $(INSTALL) $(BUILD_DIR)/$(GCS_SMALL_NAME)_$(GCS_BUILD_CONF)/$(libbasename)/$(GCS_SMALL_NAME) $(DESTDIR)$(libdir)
$(V1) $(INSTALL) $(BUILD_DIR)/$(GCS_SMALL_NAME)_$(GCS_BUILD_CONF)/share/$(GCS_SMALL_NAME) $(DESTDIR)$(datadir)
$(V1) $(INSTALL) -T $(ROOT_DIR)/package/linux/gcs.desktop $(DESTDIR)$(datadir)/applications/$(ORG_SMALL_NAME).desktop
$(V1) $(INSTALL) -T $(ROOT_DIR)/ground/openpilotgcs/src/plugins/coreplugin/images/$(ORG_SMALL_NAME)_logo_128.png \
$(DESTDIR)$(datadir)/pixmaps/$(ORG_SMALL_NAME).png
$(V1) sed -i -e 's/gcs/$(GCS_SMALL_NAME)/g;s/GCS/$(GCS_BIG_NAME)/g;s/org/$(ORG_SMALL_NAME)/g;s/ORG/$(ORG_BIG_NAME)/g' \
$(DESTDIR)$(datadir)/applications/$(ORG_SMALL_NAME).desktop
ifneq ($(enable-udev-rules), no)
$(V1) $(MKDIR) -p $(DESTDIR)$(udevrulesdir)
$(V1) $(INSTALL) -T $(ROOT_DIR)/package/linux/45-uav.rules $(DESTDIR)$(udevrulesdir)/45-$(ORG_SMALL_NAME).rules
endif