From 9c76972358fd196beb7da5e7a2bebf0b73e02615 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sat, 30 May 2015 14:09:32 +0000 Subject: [PATCH] defs.mk: Add automatic detection of PKG_FORMAT Signed-off-by: Jan Lindemann --- make/defs.mk | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/make/defs.mk b/make/defs.mk index d34f694f..32edda7d 100644 --- a/make/defs.mk +++ b/make/defs.mk @@ -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)