From a41e60f8ea1e69763c2cd0af98eddc2db35300e5 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 7 Jul 2022 18:21:54 +0200 Subject: [PATCH] - add $(PKG_MODE) --- package/pkg-autotools.mk | 2 ++ package/pkg-cmake.mk | 2 ++ package/pkg-generic.mk | 2 ++ package/pkg-individual.mk | 2 ++ package/pkg-kernel-module.mk | 1 + package/pkg-meson.mk | 2 ++ package/pkg-python.mk | 1 + package/pkg-utils.mk | 4 ++++ 8 files changed, 16 insertions(+) diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk index 2ae5f5d6..31175431 100644 --- a/package/pkg-autotools.mk +++ b/package/pkg-autotools.mk @@ -92,6 +92,7 @@ endef # ----------------------------------------------------------------------------- define autotools-package + $(eval PKG_MODE = $(pkg-mode)) $(call PREPARE,$(1)) $(call TARGET_CONFIGURE) $(if $(filter $(1),$(PKG_NO_BUILD)),,$(call TARGET_MAKE)) @@ -148,6 +149,7 @@ endef # ----------------------------------------------------------------------------- define host-autotools-package + $(eval PKG_MODE = $(pkg-mode)) $(call PREPARE,$(1)) $(call HOST_CONFIGURE) $(if $(filter $(1),$(PKG_NO_BUILD)),,$(call HOST_MAKE)) diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk index 541cf68d..ea643638 100644 --- a/package/pkg-cmake.mk +++ b/package/pkg-cmake.mk @@ -62,6 +62,7 @@ endef # ----------------------------------------------------------------------------- define cmake-package + $(eval PKG_MODE = $(pkg-mode)) $(call PREPARE,$(1)) $(call TARGET_CMAKE) $(if $(filter $(1),$(PKG_NO_BUILD)),,$(call TARGET_MAKE)) @@ -108,6 +109,7 @@ endef # ----------------------------------------------------------------------------- define host-cmake-package + $(eval PKG_MODE = $(pkg-mode)) $(call PREPARE,$(1)) $(call HOST_CMAKE) $(if $(filter $(1),$(PKG_NO_BUILD)),,$(call HOST_MAKE)) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index edc73ecf..abd050b1 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -37,6 +37,7 @@ endef # ----------------------------------------------------------------------------- define generic-package + $(eval PKG_MODE = $(pkg-mode)) $(call PREPARE,$(1)) $(if $(filter $(1),$(PKG_NO_BUILD)),,$(call TARGET_MAKE)) $(if $(filter $(1),$(PKG_NO_INSTALL)),,$(call TARGET_MAKE_INSTALL)) @@ -78,6 +79,7 @@ endef # ----------------------------------------------------------------------------- define host-generic-package + $(eval PKG_MODE = $(pkg-mode)) $(call PREPARE,$(1)) $(if $(filter $(1),$(PKG_NO_BUILD)),,$(call HOST_MAKE)) $(if $(filter $(1),$(PKG_NO_INSTALL)),,$(call HOST_MAKE_INSTALL)) diff --git a/package/pkg-individual.mk b/package/pkg-individual.mk index 3772b1c1..486df226 100644 --- a/package/pkg-individual.mk +++ b/package/pkg-individual.mk @@ -12,6 +12,7 @@ endef # ----------------------------------------------------------------------------- define individual-package + $(eval PKG_MODE = $(pkg-mode)) $(call PREPARE,$(1)) $(call INDIVIDUAL) $(call TARGET_FOLLOWUP) @@ -20,6 +21,7 @@ endef # ----------------------------------------------------------------------------- define host-individual-package + $(eval PKG_MODE = $(pkg-mode)) $(call PREPARE,$(1)) $(call INDIVIDUAL) $(call HOST_FOLLOWUP) diff --git a/package/pkg-kernel-module.mk b/package/pkg-kernel-module.mk index 9446d52c..b0405a8d 100644 --- a/package/pkg-kernel-module.mk +++ b/package/pkg-kernel-module.mk @@ -28,6 +28,7 @@ endef # ----------------------------------------------------------------------------- define kernel-module + $(eval PKG_MODE = $(pkg-mode)) $(call PREPARE,$(1)) $(call KERNEL_MODULE_BUILD) $(call LINUX_RUN_DEPMOD) diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk index 836a4afd..174b46d2 100644 --- a/package/pkg-meson.mk +++ b/package/pkg-meson.mk @@ -78,6 +78,7 @@ endef # ----------------------------------------------------------------------------- define meson-package + $(eval PKG_MODE = $(pkg-mode)) $(call PREPARE,$(1)) $(call TARGET_MESON_CONFIGURE) $(call TARGET_NINJA_BUILD) @@ -122,6 +123,7 @@ endef # ----------------------------------------------------------------------------- define host-meson-package + $(eval PKG_MODE = $(pkg-mode)) $(call PREPARE,$(1)) $(call HOST_MESON_CONFIGURE) $(call HOST_NINJA) diff --git a/package/pkg-python.mk b/package/pkg-python.mk index f35b9911..93b3ac81 100644 --- a/package/pkg-python.mk +++ b/package/pkg-python.mk @@ -31,6 +31,7 @@ endef # ----------------------------------------------------------------------------- define host-python3-package + $(eval PKG_MODE = $(pkg-mode)) $(call PREPARE,$(1)) $(call HOST_PYTHON3_BUILD) $(call HOST_PYTHON3_INSTALL) diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk index e4d8d81d..29441502 100644 --- a/package/pkg-utils.mk +++ b/package/pkg-utils.mk @@ -129,6 +129,10 @@ pkg-check-variables = $(call PKG_CHECK_VARIABLES) # ----------------------------------------------------------------------------- +pkg-mode = $(call UPPERCASE,$(firstword $(subst -, ,$(subst host-,,$(0))))) + +# ----------------------------------------------------------------------------- + # PKG "control-flag" variables PKG_NO_EXTRACT = pkg-no-extract PKG_NO_PATCHES = pkg-no-patches