Browse Source

- unify $(PKG)_INSTALL_CMDS

master
vanhofen 3 years ago
parent
commit
3057f8926c
  1. 8
      package/pkg-generic.mk
  2. 22
      package/pkg-meson.mk
  3. 33
      package/pkg-utils.mk

8
package/pkg-generic.mk

@ -6,7 +6,7 @@
TARGET_MAKE_ENV =
define TARGET_MAKE_CMDS
define TARGET_MAKE_BUILD_CMDS
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(TARGET_MAKE_ENV) $($(PKG)_MAKE_ENV) \
$($(PKG)_MAKE) $($(PKG)_MAKE_ARGS)\
@ -30,7 +30,7 @@ endef
define TARGET_MAKE_INSTALL
@$(call MESSAGE,"Installing")
$(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
$(Q)$(call $(PKG)_MAKE_INSTALL_CMDS)
$(Q)$(call $(PKG)_INSTALL_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
endef
@ -48,7 +48,7 @@ endef
HOST_MAKE_ENV =
define HOST_MAKE_CMDS
define HOST_MAKE_BUILD_CMDS
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(HOST_MAKE_ENV) $($(PKG)_MAKE_ENV) \
$($(PKG)_MAKE) $($(PKG)_MAKE_ARGS)\
@ -72,7 +72,7 @@ endef
define HOST_MAKE_INSTALL
@$(call MESSAGE,"Installing")
$(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
$(Q)$(call $(PKG)_MAKE_INSTALL_CMDS)
$(Q)$(call $(PKG)_INSTALL_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
endef

22
package/pkg-meson.mk

@ -63,7 +63,7 @@ define TARGET_MESON_CONFIGURE
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
endef
define TARGET_NINJA_CMDS
define TARGET_NINJA_BUILD_CMDS
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(TARGET_MAKE_ENV) $($(PKG)_NINJA_ENV) \
$(HOST_NINJA_BINARY) -C $(PKG_BUILD_DIR)/build \
@ -77,7 +77,7 @@ define TARGET_NINJA_BUILD
$(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep))
endef
define TARGET_NINJA_INSTALL
define TARGET_NINJA_INSTALL_CMDS
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(TARGET_MAKE_ENV) $($(PKG)_NINJA_ENV) \
DESTDIR=$(TARGET_DIR) \
@ -85,6 +85,13 @@ define TARGET_NINJA_INSTALL
$($(PKG)_NINJA_OPTS)
endef
define TARGET_NINJA_INSTALL
@$(call MESSAGE,"Installing")
$(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
$(Q)$(call $(PKG)_INSTALL_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
endef
# -----------------------------------------------------------------------------
define meson-package
@ -118,7 +125,7 @@ define HOST_MESON_CONFIGURE
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
endef
define HOST_NINJA_CMDS
define HOST_NINJA_BUILD_CMDS
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(HOST_MAKE_ENV) $($(PKG)_NINJA_ENV) \
$(HOST_NINJA_BINARY) -C $(PKG_BUILD_DIR)/build \
@ -132,13 +139,20 @@ define HOST_NINJA_BUILD
$(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep))
endef
define HOST_NINJA_INSTALL
define HOST_NINJA_INSTALL_CMDS
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(HOST_MAKE_ENV) $($(PKG)_NINJA_ENV) \
$(HOST_NINJA_BINARY) -C $(PKG_BUILD_DIR)/build install \
$($(PKG)_NINJA_OPTS)
endef
define HOST_NINJA_INSTALL
@$(call MESSAGE,"Installing")
$(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
$(Q)$(call $(PKG)_INSTALL_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
endef
# -----------------------------------------------------------------------------
define host-meson-package

33
package/pkg-utils.mk

@ -101,15 +101,15 @@ endif
ifndef $(PKG)_BUILD_CMDS
ifeq ($(PKG_MODE),$(filter $(PKG_MODE),AUTOTOOLS CMAKE GENERIC))
ifeq ($(PKG_HOST_PACKAGE),YES)
$(PKG)_BUILD_CMDS = $$(HOST_MAKE_CMDS)
$(PKG)_BUILD_CMDS = $$(HOST_MAKE_BUILD_CMDS)
else
$(PKG)_BUILD_CMDS = $$(TARGET_MAKE_CMDS)
$(PKG)_BUILD_CMDS = $$(TARGET_MAKE_BUILD_CMDS)
endif
else ifeq ($(PKG_MODE),$(filter $(PKG_MODE),MESON))
ifeq ($(PKG_HOST_PACKAGE),YES)
$(PKG)_BUILD_CMDS = $$(HOST_NINJA_CMDS)
$(PKG)_BUILD_CMDS = $$(HOST_NINJA_BUILD_CMDS)
else
$(PKG)_BUILD_CMDS = $$(TARGET_NINJA_CMDS)
$(PKG)_BUILD_CMDS = $$(TARGET_NINJA_BUILD_CMDS)
endif
endif
endif
@ -118,13 +118,6 @@ endif
ifndef $(PKG)_MAKE_INSTALL
$(PKG)_MAKE_INSTALL = $$($(PKG)_MAKE)
endif
ifndef $(PKG)_MAKE_INSTALL_CMDS
ifeq ($(PKG_HOST_PACKAGE),YES)
$(PKG)_MAKE_INSTALL_CMDS = $$(HOST_MAKE_INSTALL_CMDS)
else
$(PKG)_MAKE_INSTALL_CMDS = $$(TARGET_MAKE_INSTALL_CMDS)
endif
endif
ifndef $(PKG)_MAKE_INSTALL_ENV
$(PKG)_MAKE_INSTALL_ENV = $$($(PKG)_MAKE_ENV)
endif
@ -135,6 +128,24 @@ ifndef $(PKG)_MAKE_INSTALL_OPTS
$(PKG)_MAKE_INSTALL_OPTS = $$($(PKG)_MAKE_OPTS)
endif
# install commands
# TODO: python, kernel
ifndef $(PKG)_INSTALL_CMDS
ifeq ($(PKG_MODE),$(filter $(PKG_MODE),AUTOTOOLS CMAKE GENERIC))
ifeq ($(PKG_HOST_PACKAGE),YES)
$(PKG)_INSTALL_CMDS = $$(HOST_MAKE_INSTALL_CMDS)
else
$(PKG)_INSTALL_CMDS = $$(TARGET_MAKE_INSTALL_CMDS)
endif
else ifeq ($(PKG_MODE),$(filter $(PKG_MODE),MESON))
ifeq ($(PKG_HOST_PACKAGE),YES)
$(PKG)_INSTALL_CMDS = $$(HOST_NINJA_INSTALL_CMDS)
else
$(PKG)_INSTALL_CMDS = $$(TARGET_NINJA_INSTALL_CMDS)
endif
endif
endif
# ninja
ifndef $(PKG)_NINJA_ENV
$(PKG)_NINJA_ENV =

Loading…
Cancel
Save