Browse Source

- unify $(PKG)_BUILD_CMDS

master
vanhofen 3 years ago
parent
commit
01422f5f95
  1. 4
      package/pkg-generic.mk
  2. 18
      package/pkg-meson.mk
  3. 25
      package/pkg-utils.mk

4
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

18
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) \

25
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)

Loading…
Cancel
Save