defs.mk: Add automatic detection of PKG_FORMAT

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2015-05-30 14:09:32 +00:00
commit 9c76972358

View file

@ -21,6 +21,14 @@ include pre-local.mk
endif
# ----- standard variables
PROJECT ?= $(patsubst $(FLAVOUR_PREFIX)%,%,$(notdir $(shell cd $(TOPDIR); pwd | $(SED) 's/.*\///; s/-[0-9].*//')))
ifeq ($(PROJECT),ytools)
MOD_SCRIPT_DIR ?= $(MODDIR)/devutil/scripts
else
MOD_SCRIPT_DIR ?= $(firstword $(wildcard $(MODDIR)/devutil/scripts $(MODDIR)/bin))
endif
OS ?= $(shell sh $(MOD_SCRIPT_DIR)/get_os.sh)
ifeq ($(TARGET),mingw)
FLAVOUR_PREFIX ?= win32-
@ -32,6 +40,12 @@ FLAVOUR_PATH_SUFFIX ?= /win32
endif
endif
ifneq ($(filter debian%,$(OS)),)
PKG_FORMAT ?= debian
else
PKG_FORMAT ?= rpm
endif
ifeq ($(PKG_FORMAT),debian)
export INCLUDE_REV_IN_VERSIONS = true
endif
@ -45,7 +59,6 @@ CVS_PROJ_DIR ?= $(TOPDIR)/..
CVSTOPDIR ?= $(CVS_PROJ_DIR)/..
PROJECT_DESCR_FILE ?= $(wildcard $(TOPDIR)/doc/share/project.txt)
PROJECT ?= $(patsubst $(FLAVOUR_PREFIX)%,%,$(notdir $(shell cd $(TOPDIR); pwd | $(SED) 's/.*\///; s/-[0-9].*//')))
PROJECT_SHORT_NAME ?= $(PROJECT)
PROJECT_CAPNAME = $(shell echo $(PROJECT) | tr [a-z] [A-Z] | $(SED) 's/-/_/g')
PROJECT_DESCR ?= No description
@ -79,11 +92,6 @@ endif
endif
# ----- input dirs
ifeq ($(PROJECT),ytools)
MOD_SCRIPT_DIR ?= $(MODDIR)/devutil/scripts
else
MOD_SCRIPT_DIR ?= $(firstword $(wildcard $(MODDIR)/devutil/scripts $(MODDIR)/bin))
endif
YTOOLS_DIR = $(MODDIR)
PROJECT_STEM = $(PROJECT)-$(DIST_VERSION)
CVS_ROOT_DIR = $(shell test -d CVS && pwd | $(SED) -e "s%`$(CAT) CVS/Repository`%%; s%/$$%%")
@ -95,7 +103,6 @@ PCKG_DEFS_DIR = $(MODDIR)/make/defs.d
# ----- compilation options
TARGET ?= Linux
OS ?= $(shell sh $(MOD_SCRIPT_DIR)/get_os.sh)
ifndef ARCH
ifeq ($(shell uname -m),armv7l)