diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index abd050b1..a8a723b6 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -16,7 +16,7 @@ endef define TARGET_MAKE @$(call MESSAGE,"Building") $(foreach hook,$($(PKG)_PRE_BUILD_HOOKS),$(call $(hook))$(sep)) - $(Q)$(call $(PKG)_MAKE_CMDS) + $(Q)$(call $(PKG)_BUILD_CMDS) $(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep)) endef @@ -58,7 +58,7 @@ endef define HOST_MAKE @$(call MESSAGE,"Compiling") $(foreach hook,$($(PKG)_PRE_BUILD_HOOKS),$(call $(hook))$(sep)) - $(Q)$(call $(PKG)_MAKE_CMDS) + $(Q)$(call $(PKG)_BUILD_CMDS) $(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep)) endef diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk index 08d8ab3d..ee6da485 100644 --- a/package/pkg-meson.mk +++ b/package/pkg-meson.mk @@ -63,13 +63,20 @@ define TARGET_MESON_CONFIGURE $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep)) endef -define TARGET_NINJA_BUILD +define TARGET_NINJA_CMDS $(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \ $(TARGET_MAKE_ENV) $($(PKG)_NINJA_ENV) \ $(HOST_NINJA_BINARY) -C $(PKG_BUILD_DIR)/build \ $($(PKG)_NINJA_OPTS) endef +define TARGET_NINJA_BUILD + @$(call MESSAGE,"Building") + $(foreach hook,$($(PKG)_PRE_BUILD_HOOKS),$(call $(hook))$(sep)) + $(Q)$(call $(PKG)_BUILD_CMDS) + $(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep)) +endef + define TARGET_NINJA_INSTALL $(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \ $(TARGET_MAKE_ENV) $($(PKG)_NINJA_ENV) \ @@ -111,13 +118,20 @@ define HOST_MESON_CONFIGURE $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep)) endef -define HOST_NINJA_BUILD +define HOST_NINJA_CMDS $(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \ $(HOST_MAKE_ENV) $($(PKG)_NINJA_ENV) \ $(HOST_NINJA_BINARY) -C $(PKG_BUILD_DIR)/build \ $($(PKG)_NINJA_OPTS) endef +define HOST_NINJA_BUILD + @$(call MESSAGE,"Building") + $(foreach hook,$($(PKG)_PRE_BUILD_HOOKS),$(call $(hook))$(sep)) + $(Q)$(call $(PKG)_BUILD_CMDS) + $(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep)) +endef + define HOST_NINJA_INSTALL $(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \ $(HOST_MAKE_ENV) $($(PKG)_NINJA_ENV) \ diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk index adcda2ab..8fe5933a 100644 --- a/package/pkg-utils.mk +++ b/package/pkg-utils.mk @@ -86,13 +86,6 @@ endif ifndef $(PKG)_MAKE $(PKG)_MAKE = $$(MAKE) endif -ifndef $(PKG)_MAKE_CMDS - ifeq ($(PKG_HOST_PACKAGE),YES) - $(PKG)_MAKE_CMDS = $$(HOST_MAKE_CMDS) - else - $(PKG)_MAKE_CMDS = $$(TARGET_MAKE_CMDS) - endif -endif ifndef $(PKG)_MAKE_ENV $(PKG)_MAKE_ENV = endif @@ -103,6 +96,24 @@ ifndef $(PKG)_MAKE_OPTS $(PKG)_MAKE_OPTS = endif +# build commands +# TODO: python, kernel +ifndef $(PKG)_BUILD_CMDS + ifeq ($(PKG_MODE),$(filter $(PKG_MODE),AUTOTOOLS CMAKE GENERIC)) + ifeq ($(PKG_HOST_PACKAGE),YES) + $(PKG)_BUILD_CMDS = $$(HOST_MAKE_CMDS) + else + $(PKG)_BUILD_CMDS = $$(TARGET_MAKE_CMDS) + endif + else ifeq ($(PKG_MODE),$(filter $(PKG_MODE),MESON)) + ifeq ($(PKG_HOST_PACKAGE),YES) + $(PKG)_BUILD_CMDS = $$(HOST_NINJA_CMDS) + else + $(PKG)_BUILD_CMDS = $$(TARGET_NINJA_CMDS) + endif + endif +endif + # make install ifndef $(PKG)_MAKE_INSTALL $(PKG)_MAKE_INSTALL = $$($(PKG)_MAKE)