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

14
package/pkg-utils.mk

@ -68,6 +68,13 @@ endif
ifndef $(PKG)_MAKE ifndef $(PKG)_MAKE
$(PKG)_MAKE = $$(MAKE) $(PKG)_MAKE = $$(MAKE)
endif 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 ifndef $(PKG)_MAKE_ENV
$(PKG)_MAKE_ENV = $(PKG)_MAKE_ENV =
endif endif
@ -82,6 +89,13 @@ endif
ifndef $(PKG)_MAKE_INSTALL ifndef $(PKG)_MAKE_INSTALL
$(PKG)_MAKE_INSTALL = $$($(PKG)_MAKE) $(PKG)_MAKE_INSTALL = $$($(PKG)_MAKE)
endif 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 ifndef $(PKG)_MAKE_INSTALL_ENV
$(PKG)_MAKE_INSTALL_ENV = $$($(PKG)_MAKE_ENV) $(PKG)_MAKE_INSTALL_ENV = $$($(PKG)_MAKE_ENV)
endif endif

Loading…
Cancel
Save