Browse Source

- add $($(PKG)_MAKE_ENV) and $($(PKG)_MAKE_OPTS)

master
vanhofen 3 years ago
parent
commit
194465c986
  1. 2
      package/busybox/busybox.mk
  2. 2
      package/lua/lua.mk
  3. 2
      package/neutrino/neutrino.mk
  4. 45
      package/pkg-autotools.mk
  5. 20
      package/pkg-cmake.mk
  6. 45
      package/pkg-generic.mk
  7. 4
      package/pkg-kernel-module.mk
  8. 22
      package/pkg-meson.mk
  9. 4
      package/pkg-python.mk

2
package/busybox/busybox.mk

@ -29,7 +29,7 @@ BUSYBOX_MAKE_ENV = \
CFLAGS_busybox="$(BUSYBOX_CFLAGS_busybox)"
BUSYBOX_MAKE_OPTS = \
$(TARGET_MAKE_OPTS) \
$(TARGET_CONFIGURE_ENVIRONMENT) \
CFLAGS_EXTRA="$(TARGET_CFLAGS)" \
EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
CONFIG_PREFIX="$(TARGET_DIR)"

2
package/lua/lua.mk

@ -22,7 +22,7 @@ lua: $(LUA_DEPENDENCIES) $(DL_DIR)/$(LUA_SOURCE) | $(TARGET_DIR)
$(CHDIR)/$(LUA_DIR); \
$(MAKE) linux \
PKG_VERSION=$(LUA_VERSION) \
$(TARGET_MAKE_OPTS) \
$(TARGET_CONFIGURE_ENVIRONMENT) \
AR="$(TARGET_AR) rcu" \
LDFLAGS="$(TARGET_LDFLAGS)" \
; \

2
package/neutrino/neutrino.mk

@ -53,7 +53,7 @@ NEUTRINO_LDFLAGS += -lcrypto -ldl -lz
# -----------------------------------------------------------------------------
NEUTRINO_CONF_ENV = \
$(TARGET_MAKE_OPTS) \
$(TARGET_CONFIGURE_ENVIRONMENT) \
\
CFLAGS="$(NEUTRINO_CFLAGS)" \
CPPFLAGS="$(NEUTRINO_CFLAGS)" \

45
package/pkg-autotools.mk

@ -9,15 +9,34 @@ define AUTORECONF_HOOK
if [ "$($(PKG)_AUTORECONF)" == "YES" ]; then \
$(call MESSAGE,"Autoreconfiguring"); \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$($(PKG)_AUTORECONF_ENV) autoreconf -fi $($(PKG)_AUTORECONF_OPTS); \
$($(PKG)_AUTORECONF_ENV) \
autoreconf -fi \
$($(PKG)_AUTORECONF_OPTS); \
fi; \
)
endef
# -----------------------------------------------------------------------------
TARGET_CONFIGURE_ENV = \
$(TARGET_MAKE_OPTS) \
TARGET_CONFIGURE_ENVIRONMENT = \
CROSS_COMPILE="$(TARGET_CROSS)" \
CC="$(TARGET_CC)" \
GCC="$(TARGET_CC)" \
CPP="$(TARGET_CPP)" \
CXX="$(TARGET_CXX)" \
LD="$(TARGET_LD)" \
AR="$(TARGET_AR)" \
AS="$(TARGET_AS)" \
NM="$(TARGET_NM)" \
OBJCOPY="$(TARGET_OBJCOPY)" \
OBJDUMP="$(TARGET_OBJDUMP)" \
RANLIB="$(TARGET_RANLIB)" \
READELF="$(TARGET_READELF)" \
STRIP="$(TARGET_STRIP)" \
ARCH=$(TARGET_ARCH)
TARGET_CONFIGURE_ENV += \
$(TARGET_CONFIGURE_ENVIRONMENT) \
CFLAGS="$(TARGET_CFLAGS)" \
CPPFLAGS="$(TARGET_CPPFLAGS)" \
CXXFLAGS="$(TARGET_CXXFLAGS)" \
@ -28,9 +47,6 @@ TARGET_CONFIGURE_ENV += \
PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" \
PKG_CONFIG_SYSROOT_DIR=$(PKG_CONFIG_SYSROOT_DIR)
TARGET_CONFIGURE_ENV += \
$($(PKG)_CONF_ENV)
TARGET_CONFIGURE_OPTS = \
--build=$(GNU_HOST_NAME) \
--host=$(TARGET) \
@ -47,9 +63,6 @@ TARGET_CONFIGURE_OPTS = \
--mandir=$(REMOVE_mandir) \
--infodir=$(REMOVE_infodir)
TARGET_CONFIGURE_OPTS += \
$($(PKG)_CONF_OPTS)
define TARGET_CONFIGURE
@$(call MESSAGE,"Configuring")
$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
@ -58,7 +71,9 @@ define TARGET_CONFIGURE
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
test -f ./configure || ./autogen.sh && \
CONFIG_SITE=/dev/null \
$(TARGET_CONFIGURE_ENV) ./configure $(TARGET_CONFIGURE_OPTS); \
$(TARGET_CONFIGURE_ENV) $($(PKG)_CONF_ENV) \
./configure \
$(TARGET_CONFIGURE_OPTS) $($(PKG)_CONF_OPTS); \
)
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
endef
@ -86,16 +101,10 @@ HOST_CONFIGURE_ENV += \
PKG_CONFIG=/usr/bin/pkg-config \
PKG_CONFIG_LIBDIR="$(HOST_DIR)/lib/pkgconfig"
HOST_CONFIGURE_ENV += \
$($(PKG)_CONF_ENV)
HOST_CONFIGURE_OPTS = \
--prefix=$(HOST_DIR) \
--sysconfdir=$(HOST_DIR)/etc
HOST_CONFIGURE_OPTS += \
$($(PKG)_CONF_OPTS)
define HOST_CONFIGURE
@$(call MESSAGE,"Configuring")
$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
@ -104,7 +113,9 @@ define HOST_CONFIGURE
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
test -f ./configure || ./autogen.sh && \
CONFIG_SITE=/dev/null \
$(HOST_CONFIGURE_ENV) ./configure $(HOST_CONFIGURE_OPTS); \
$(HOST_CONFIGURE_ENV) $($(PKG)_CONF_ENV) \
./configure \
$(HOST_CONFIGURE_OPTS) $($(PKG)_CONF_OPTS); \
)
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
endef

20
package/pkg-cmake.mk

@ -4,8 +4,7 @@
#
################################################################################
TARGET_CMAKE_ENV = \
$($(PKG)_CONF_ENV)
TARGET_CMAKE_ENV =
TARGET_CMAKE_OPTS = \
--no-warn-unused-cli
@ -45,16 +44,15 @@ TARGET_CMAKE_OPTS += \
-DCMAKE_READELF="$(TARGET_READELF)" \
-DCMAKE_STRIP="$(TARGET_STRIP)"
TARGET_CMAKE_OPTS += \
$($(PKG)_CONF_OPTS)
define TARGET_CMAKE
@$(call MESSAGE,"Configuring")
$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
rm -f CMakeCache.txt; \
$(TARGET_CMAKE_ENV) cmake $(TARGET_CMAKE_OPTS); \
$(TARGET_CMAKE_ENV) $($(PKG)_CONF_ENV) \
cmake \
$(TARGET_CMAKE_OPTS) $($(PKG)_CONF_OPTS); \
)
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
endef
@ -71,8 +69,7 @@ endef
# -----------------------------------------------------------------------------
HOST_CMAKE_ENV = \
$($(PKG)_CONF_ENV)
HOST_CMAKE_ENV =
HOST_CMAKE_OPTS += \
--no-warn-unused-cli
@ -91,16 +88,15 @@ HOST_CMAKE_OPTS += \
-DCMAKE_INSTALL_PREFIX="$(HOST_DIR)" \
-DCMAKE_PREFIX_PATH="$(HOST_DIR)"
HOST_CMAKE_OPTS += \
$($(PKG)_CONF_OPTS)
define HOST_CMAKE
@$(call MESSAGE,"Configuring")
$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
rm -f CMakeCache.txt; \
$(HOST_CMAKE_ENV) cmake $(HOST_CMAKE_OPTS); \
$(HOST_CMAKE_ENV) $($(PKG)_CONF_ENV) \
cmake \
$(HOST_CMAKE_OPTS) $($(PKG)_CONF_OPTS); \
)
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
endef

45
package/pkg-generic.mk

@ -4,35 +4,16 @@
#
################################################################################
#TARGET_MAKE_ENV =
# $($(PKG)_MAKE_ENV)
TARGET_MAKE_OPTS = \
CROSS_COMPILE="$(TARGET_CROSS)" \
CC="$(TARGET_CC)" \
GCC="$(TARGET_CC)" \
CPP="$(TARGET_CPP)" \
CXX="$(TARGET_CXX)" \
LD="$(TARGET_LD)" \
AR="$(TARGET_AR)" \
AS="$(TARGET_AS)" \
NM="$(TARGET_NM)" \
OBJCOPY="$(TARGET_OBJCOPY)" \
OBJDUMP="$(TARGET_OBJDUMP)" \
RANLIB="$(TARGET_RANLIB)" \
READELF="$(TARGET_READELF)" \
STRIP="$(TARGET_STRIP)" \
ARCH=$(TARGET_ARCH)
#TARGET_MAKE_OPTS += \
# $($(PKG)_MAKE_OPTS)
TARGET_MAKE_ENV =
define TARGET_MAKE
@$(call MESSAGE,"Compiling")
$(foreach hook,$($(PKG)_PRE_COMPILE_HOOKS),$(call $(hook))$(sep))
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(MAKE); \
$(TARGET_MAKE_ENV) $($(PKG)_MAKE_ENV) \
$(MAKE) \
$($(PKG)_MAKE_OPTS); \
)
$(foreach hook,$($(PKG)_POST_COMPILE_HOOKS),$(call $(hook))$(sep))
endef
@ -42,7 +23,9 @@ define TARGET_MAKE_INSTALL
$(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(MAKE) install DESTDIR=$(TARGET_DIR); \
$(TARGET_MAKE_ENV) $($(PKG)_MAKE_ENV) \
$(MAKE) install DESTDIR=$(TARGET_DIR) \
$($(PKG)_MAKE_OPTS); \
)
$(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
endef
@ -58,8 +41,7 @@ endef
# -----------------------------------------------------------------------------
#HOST_MAKE_ENV = \
# $($(PKG)_MAKE_ENV)
HOST_MAKE_ENV =
HOST_MAKE_OPTS = \
CC="$(HOSTCC)" \
@ -73,15 +55,14 @@ HOST_MAKE_OPTS = \
OBJCOPY="$(HOSTOBJCOPY)" \
RANLIB="$(HOSTRANLIB)"
#HOST_MAKE_OPTS += \
# $($(PKG)_MAKE_OPTS)
define HOST_MAKE
@$(call MESSAGE,"Compiling")
$(foreach hook,$($(PKG)_PRE_COMPILE_HOOKS),$(call $(hook))$(sep))
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(MAKE); \
$(HOST_MAKE_ENV) $($(PKG)_MAKE_ENV) \
$(MAKE) \
$($(PKG)_MAKE_OPTS); \
)
$(foreach hook,$($(PKG)_POST_COMPILE_HOOKS),$(call $(hook))$(sep))
endef
@ -91,7 +72,9 @@ define HOST_MAKE_INSTALL
$(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(MAKE) install; \
$(HOST_MAKE_ENV) $($(PKG)_MAKE_ENV) \
$(MAKE) install \
$($(PKG)_MAKE_OPTS); \
)
$(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
endef

4
package/pkg-kernel-module.mk

@ -20,7 +20,9 @@ KERNEL_MAKE_VARS += \
define KERNEL_MODULE_BUILD
@$(call MESSAGE,"Building kernel module")
$(CHDIR)/$($(PKG)_DIR); \
$($(PKG)_MAKE_ENV) $(MAKE) $($(PKG)_MAKE_OPTS) $(KERNEL_MAKE_VARS)
$(TARGET_MAKE_ENV) $($(PKG)_MAKE_ENV) \
$(MAKE) \
$($(PKG)_MAKE_OPTS) $(KERNEL_MAKE_VARS)
endef
# -----------------------------------------------------------------------------

22
package/pkg-meson.mk

@ -52,7 +52,7 @@ define TARGET_MESON_CONFIGURE
$($(PKG)_CONF_ENV) \
$(HOST_MESON_BINARY) \
--buildtype=release \
--cross-file $(PKG_BUILD_DIR)/build/meson-cross.config \
--cross-file=$(PKG_BUILD_DIR)/build/meson-cross.config \
-Db_pie=false \
-Dstrip=false \
$($(PKG)_CONF_OPTS) \
@ -63,13 +63,16 @@ endef
define TARGET_NINJA_BUILD
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(HOST_NINJA_BINARY) -C $(PKG_BUILD_DIR)/build
$(TARGET_MAKE_ENV) $($(PKG)_NINJA_ENV) \
$(HOST_NINJA_BINARY) -C $(PKG_BUILD_DIR)/build \
$($(PKG)_NINJA_OPTS)
endef
define TARGET_NINJA_INSTALL
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
DESTDIR=$(TARGET_DIR) \
$(HOST_NINJA_BINARY) -C $(PKG_BUILD_DIR)/build install
$(TARGET_MAKE_ENV) $($(PKG)_NINJA_ENV) \
$(HOST_NINJA_BINARY) -C $(PKG_BUILD_DIR)/build install DESTDIR=$(TARGET_DIR) \
$($(PKG)_NINJA_OPTS)
endef
# -----------------------------------------------------------------------------
@ -94,7 +97,7 @@ define HOST_MESON_CONFIGURE
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$($(PKG)_CONF_ENV) \
$(HOST_MESON_BINARY) \
--prefix=/ \
--prefix=$(HOST_DIR) \
--buildtype=release \
$($(PKG)_CONF_OPTS) \
$(PKG_BUILD_DIR) $(PKG_BUILD_DIR)/build; \
@ -104,13 +107,16 @@ endef
define HOST_NINJA_BUID
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(HOST_NINJA_BINARY) -C $(PKG_BUILD_DIR)/build
$(HOST_MAKE_ENV) $($(PKG)_NINJA_ENV) \
$(HOST_NINJA_BINARY) -C $(PKG_BUILD_DIR)/build \
$($(PKG)_NINJA_OPTS)
endef
define HOST_NINJA_INSTALL
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
DESTDIR=$(HOST_DIR) \
$(HOST_NINJA_BINARY) -C $(PKG_BUILD_DIR)/build install
$(HOST_MAKE_ENV) $($(PKG)_NINJA_ENV) \
$(HOST_NINJA_BINARY) -C $(PKG_BUILD_DIR)/build install \
$($(PKG)_NINJA_OPTS)
endef
# -----------------------------------------------------------------------------

4
package/pkg-python.mk

@ -18,14 +18,14 @@ define HOST_PYTHON3_BUILD
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(HOST_PYTHON3_ENV) \
$(HOST_PYTHON3_BINARY) ./setup.py build --executable=/usr/bin/python \
$(HOST_PYTHON3_OPTS)
$(HOST_PYTHON3_OPTS)
endef
define HOST_PYTHON3_INSTALL
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
$(HOST_PYTHON3_ENV) \
$(HOST_PYTHON3_BINARY) ./setup.py install --root=$(HOST_DIR) --prefix= \
$(HOST_PYTHON3_OPTS)
$(HOST_PYTHON3_OPTS)
endef
# -----------------------------------------------------------------------------

Loading…
Cancel
Save