Browse Source

- add $(PKG)_MAKE_CMDS and $(PKG)_MAKE_INSTALL_CMDS

master
vanhofen 3 years ago
parent
commit
5284d1de2c
  1. 56
      package/pkg-generic.mk
  2. 14
      package/pkg-utils.mk

56
package/pkg-generic.mk

@ -6,27 +6,31 @@
TARGET_MAKE_ENV =
define TARGET_MAKE
@$(call MESSAGE,"Compiling")
$(foreach hook,$($(PKG)_PRE_COMPILE_HOOKS),$(call $(hook))$(sep))
$(Q)( \
define TARGET_MAKE_CMDS
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(TARGET_MAKE_ENV) $($(PKG)_MAKE_ENV) \
$($(PKG)_MAKE) $($(PKG)_MAKE_ARGS)\
$($(PKG)_MAKE_OPTS); \
)
$($(PKG)_MAKE_OPTS)
endef
define TARGET_MAKE
@$(call MESSAGE,"Compiling")
$(foreach hook,$($(PKG)_PRE_COMPILE_HOOKS),$(call $(hook))$(sep))
$(Q)$(call $(PKG)_MAKE_CMDS)
$(foreach hook,$($(PKG)_POST_COMPILE_HOOKS),$(call $(hook))$(sep))
endef
define TARGET_MAKE_INSTALL
@$(call MESSAGE,"Installing")
$(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
$(Q)( \
define TARGET_MAKE_INSTALL_CMDS
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(TARGET_MAKE_ENV) $($(PKG)_MAKE_INSTALL_ENV) \
$($(PKG)_MAKE_INSTALL) $($(PKG)_MAKE_INSTALL_ARGS) DESTDIR=$(TARGET_DIR) \
$($(PKG)_MAKE_INSTALL_OPTS); \
)
$($(PKG)_MAKE_INSTALL_OPTS)
endef
define TARGET_MAKE_INSTALL
@$(call MESSAGE,"Installing")
$(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
$(Q)$(call $(PKG)_MAKE_INSTALL_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
endef
@ -43,27 +47,31 @@ endef
HOST_MAKE_ENV =
define HOST_MAKE
@$(call MESSAGE,"Compiling")
$(foreach hook,$($(PKG)_PRE_COMPILE_HOOKS),$(call $(hook))$(sep))
$(Q)( \
define HOST_MAKE_CMDS
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(HOST_MAKE_ENV) $($(PKG)_MAKE_ENV) \
$($(PKG)_MAKE) $($(PKG)_MAKE_ARGS)\
$($(PKG)_MAKE_OPTS); \
)
$($(PKG)_MAKE_OPTS)
endef
define HOST_MAKE
@$(call MESSAGE,"Compiling")
$(foreach hook,$($(PKG)_PRE_COMPILE_HOOKS),$(call $(hook))$(sep))
$(Q)$(call $(PKG)_MAKE_CMDS)
$(foreach hook,$($(PKG)_POST_COMPILE_HOOKS),$(call $(hook))$(sep))
endef
define HOST_MAKE_INSTALL
@$(call MESSAGE,"Installing")
$(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
$(Q)( \
define HOST_MAKE_INSTALL_CMDS
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(HOST_MAKE_ENV) $($(PKG)_MAKE_INSTALL_ENV) \
$($(PKG)_MAKE_INSTALL) $($(PKG)_MAKE_INSTALL_ARGS) \
$($(PKG)_MAKE_INSTALL_OPTS); \
)
$($(PKG)_MAKE_INSTALL_OPTS)
endef
define HOST_MAKE_INSTALL
@$(call MESSAGE,"Installing")
$(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
$(Q)$(call $(PKG)_MAKE_INSTALL_CMDS)
$(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
endef

14
package/pkg-utils.mk

@ -68,6 +68,13 @@ 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
@ -82,6 +89,13 @@ 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

Loading…
Cancel
Save