|
|
@ -11,21 +11,19 @@ pkg = $(call LOWERCASE,$(pkgname)) |
|
|
|
PKG = $(call UPPERCASE,$(pkgname)) |
|
|
|
|
|
|
|
PKG_PARENT = $(subst HOST_,,$(PKG)) |
|
|
|
PKG_PACKAGE = $(if $(filter $(firstword $(subst -, ,$(pkg))),host),HOST,TARGET) |
|
|
|
|
|
|
|
PKG_BUILD_DIR = $(BUILD_DIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR) |
|
|
|
PKG_FILES_DIR = $(PACKAGE_DIR)/$(subst host-,,$(pkgname))/files |
|
|
|
PKG_PATCHES_DIR = $(PACKAGE_DIR)/$(subst host-,,$(pkgname))/patches |
|
|
|
|
|
|
|
PKG_HOST_PACKAGE = $(if $(filter $(firstword $(subst -, ,$(pkg))),host),YES,NO) |
|
|
|
PKG_TARGET_PACKAGE = $(if $(filter $(PKG_HOST_PACKAGE),NO),YES,NO) |
|
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# check for necessary $(PKG) variables
|
|
|
|
define PKG_CHECK_VARIABLES |
|
|
|
|
|
|
|
# auto-assign HOST_ variables
|
|
|
|
ifeq ($(PKG_HOST_PACKAGE),YES) |
|
|
|
ifeq ($(PKG_PACKAGE),HOST) |
|
|
|
ifndef $(PKG)_VERSION |
|
|
|
$(PKG)_VERSION = $$($(PKG_PARENT)_VERSION) |
|
|
|
endif |
|
|
@ -81,19 +79,19 @@ endif |
|
|
|
# configure commands
|
|
|
|
ifndef $(PKG)_CONFIGURE_CMDS |
|
|
|
ifeq ($(PKG_MODE),CMAKE) |
|
|
|
ifeq ($(PKG_HOST_PACKAGE),YES) |
|
|
|
ifeq ($(PKG_PACKAGE),HOST) |
|
|
|
$(PKG)_CONFIGURE_CMDS = $$(HOST_CMAKE_CMDS_DEFAULT) |
|
|
|
else |
|
|
|
$(PKG)_CONFIGURE_CMDS = $$(TARGET_CMAKE_CMDS_DEFAULT) |
|
|
|
endif |
|
|
|
else ifeq ($(PKG_MODE),MESON) |
|
|
|
ifeq ($(PKG_HOST_PACKAGE),YES) |
|
|
|
ifeq ($(PKG_PACKAGE),HOST) |
|
|
|
$(PKG)_CONFIGURE_CMDS = $$(HOST_MESON_CMDS_DEFAULT) |
|
|
|
else |
|
|
|
$(PKG)_CONFIGURE_CMDS = $$(TARGET_MESON_CMDS_DEFAULT) |
|
|
|
endif |
|
|
|
else |
|
|
|
ifeq ($(PKG_HOST_PACKAGE),YES) |
|
|
|
ifeq ($(PKG_PACKAGE),HOST) |
|
|
|
$(PKG)_CONFIGURE_CMDS = $$(HOST_CONFIGURE_CMDS_DEFAULT) |
|
|
|
else |
|
|
|
$(PKG)_CONFIGURE_CMDS = $$(TARGET_CONFIGURE_CMDS_DEFAULT) |
|
|
@ -119,13 +117,13 @@ endif |
|
|
|
# TODO: python
|
|
|
|
ifndef $(PKG)_BUILD_CMDS |
|
|
|
ifeq ($(PKG_MODE),$(filter $(PKG_MODE),AUTOTOOLS CMAKE GENERIC KCONFIG)) |
|
|
|
ifeq ($(PKG_HOST_PACKAGE),YES) |
|
|
|
ifeq ($(PKG_PACKAGE),HOST) |
|
|
|
$(PKG)_BUILD_CMDS = $$(HOST_MAKE_BUILD_CMDS_DEFAULT) |
|
|
|
else |
|
|
|
$(PKG)_BUILD_CMDS = $$(TARGET_MAKE_BUILD_CMDS_DEFAULT) |
|
|
|
endif |
|
|
|
else ifeq ($(PKG_MODE),MESON) |
|
|
|
ifeq ($(PKG_HOST_PACKAGE),YES) |
|
|
|
ifeq ($(PKG_PACKAGE),HOST) |
|
|
|
$(PKG)_BUILD_CMDS = $$(HOST_NINJA_BUILD_CMDS_DEFAULT) |
|
|
|
else |
|
|
|
$(PKG)_BUILD_CMDS = $$(TARGET_NINJA_BUILD_CMDS_DEFAULT) |
|
|
@ -155,13 +153,13 @@ endif |
|
|
|
# TODO: python, kernel
|
|
|
|
ifndef $(PKG)_INSTALL_CMDS |
|
|
|
ifeq ($(PKG_MODE),$(filter $(PKG_MODE),AUTOTOOLS CMAKE GENERIC KCONFIG)) |
|
|
|
ifeq ($(PKG_HOST_PACKAGE),YES) |
|
|
|
ifeq ($(PKG_PACKAGE),HOST) |
|
|
|
$(PKG)_INSTALL_CMDS = $$(HOST_MAKE_INSTALL_CMDS_DEFAULT) |
|
|
|
else |
|
|
|
$(PKG)_INSTALL_CMDS = $$(TARGET_MAKE_INSTALL_CMDS_DEFAULT) |
|
|
|
endif |
|
|
|
else ifeq ($(PKG_MODE),MESON) |
|
|
|
ifeq ($(PKG_HOST_PACKAGE),YES) |
|
|
|
ifeq ($(PKG_PACKAGE),HOST) |
|
|
|
$(PKG)_INSTALL_CMDS = $$(HOST_NINJA_INSTALL_CMDS_DEFAULT) |
|
|
|
else |
|
|
|
$(PKG)_INSTALL_CMDS = $$(TARGET_NINJA_INSTALL_CMDS_DEFAULT) |
|
|
|