build: include BUILD_VARIANT in PKG_BUILD_DIR
authorJeffery To <jeffery.to@gmail.com>
Sat, 3 Aug 2019 20:45:06 +0000 (04:45 +0800)
committerJo-Philipp Wich <jo@mein.io>
Wed, 4 Sep 2019 11:35:17 +0000 (13:35 +0200)
This changes the default PKG_BUILD_DIR to take BUILD_VARIANT into
account (if set), so that packages do not need to manually override
PKG_BUILD_DIR just to handle variants.

This also updates most base packages with variants to use the updated
default PKG_BUILD_DIR.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit e545fac8d968864a965edb9e50c6f90940b0a6c9)

17 files changed:
include/kernel.mk
include/package.mk
package/boot/tfa-layerscape/Makefile
package/kernel/lantiq/ltq-adsl-mei/Makefile
package/kernel/lantiq/ltq-atm/Makefile
package/kernel/lantiq/ltq-deu/Makefile
package/kernel/lantiq/ltq-ptm/Makefile
package/libs/ustream-ssl/Makefile
package/network/services/hostapd/Makefile
package/network/services/odhcpd/Makefile
package/network/services/openvpn/Makefile
package/network/services/ppp/Makefile
package/network/utils/iproute2/Makefile
package/network/utils/iw/Makefile
package/network/utils/tcpdump/Makefile
package/system/ucert/Makefile
package/utils/px5g/Makefile

index 975cf455c4f3aefaa7e103496d4a460194215a5e..97d23661c9c11672d3a6d0f437e2367875485c29 100644 (file)
@@ -77,7 +77,7 @@ else
   TARGET_MODULES_DIR:=$(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
 
   ifneq ($(TARGET_BUILD),1)
-    PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
+    PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
   endif
 endif
 
index 66137f211bbcfaada8b1e7c69763e0c6274f3e5a..c541f6edf7a967bb317c87b8a5c63ce98cb0673a 100644 (file)
@@ -11,7 +11,7 @@ all: $(if $(DUMP),dumpinfo,$(if $(CHECK),check,compile))
 
 include $(INCLUDE_DIR)/download.mk
 
-PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
+PKG_BUILD_DIR ?= $(BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
 PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
 PKG_BUILD_PARALLEL ?=
 PKG_USE_MIPS16 ?= 1
index 28014e87f210817532cc48149e498924f34bb175..a34c52bc3b5acec33bc956698da10f801b38a2bb 100644 (file)
@@ -15,7 +15,6 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/atf
 PKG_SOURCE_VERSION:=7e34aebe658c7c3439d2d68b0ce6b9776e8e6996
 PKG_MIRROR_HASH:=9cf0bc32fa589a0ee7c48c87898679e645341f29da1253d0ba5d2e82c6ea074d
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_BUILD_DEPENDS:=uboot-layerscape tfa-layerscape/host
 
 include $(INCLUDE_DIR)/host-build.mk
index 08e5775771d518dcd5102a276056501434a4263f..31e671e53f73c18f9d92f70281fd488c4d1681c1 100644 (file)
@@ -8,7 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-adsl-mei
 PKG_RELEASE:=1
-PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-adsl-mei-$(BUILD_VARIANT)/
 
 PKG_MAINTAINER:=John Crispin <john@phrozen.org>
 PKG_CHECK_FORMAT_SECURITY:=0
index 5d63983d2c38a41a13042517cb403c6306b57533..455d7b25e30f073cb3ca1cc7df39e5410441c9d4 100644 (file)
@@ -8,7 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-atm
 PKG_RELEASE:=2
-PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-atm-$(BUILD_VARIANT)
 
 PKG_MAINTAINER:=John Crispin <john@phrozen.org>
 PKG_LICENSE:=GPL-2.0+
index af299d888377f59b8ed2e16b0bc671ab33e2cae5..7bc9e8532dda2d45563b36451bbd9a21c3b6d105 100644 (file)
@@ -8,7 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-deu
 PKG_RELEASE:=1
-PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-deu-$(BUILD_VARIANT)
 
 PKG_MAINTAINER:=John Crispin <john@phrozen.org>
 PKG_LICENSE:=GPL-2.0+
index 13831a2b6f5dc5e27426ecc463e096516dd36ce5..73fd63f42bcb5628887cc04d39ced811de304d40 100644 (file)
@@ -9,7 +9,6 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-ptm
 PKG_RELEASE:=1
-PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-ptm-$(BUILD_VARIANT)
 
 PKG_MAINTAINER:=John Crispin <john@phrozen.org>
 PKG_LICENSE:=GPL-2.0+
index ca9ad5d98b7ecd239cccd5330a28445da786fa06..b8d09672829a415f90b0fb216b8e12c3bf267c20 100644 (file)
@@ -10,8 +10,6 @@ PKG_SOURCE_VERSION:=738e8d2489fc64f782affd1292388c66f6d69e82
 PKG_MIRROR_HASH:=29e69fce0a334746ed3a68d27f5ca5bffbfc144d04329335be47983fdd7cbdfd
 CMAKE_INSTALL:=1
 
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
-
 PKG_LICENSE:=ISC
 PKG_LICENSE_FILES:=
 
index e389efccb23196b865956c1467a664b7eae6df99..be2a9069c7693c9cebfdeed1a95ac27ff90834e2 100644 (file)
@@ -66,8 +66,6 @@ ifeq ($(LOCAL_VARIANT),mesh)
   CONFIG_VARIANT:=full
 endif
 
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
 include $(INCLUDE_DIR)/package.mk
 
 STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(CONFIG_WPA_MSG_MIN_PRIORITY)
index 52a366a507bbb510c1515adbe568d8c1f4baa693..0eae24358520c5f98f44ab3486ced8321e9be701 100644 (file)
@@ -19,8 +19,6 @@ PKG_MIRROR_HASH:=991263706a11fead66b1378b0adda50f188101f18f2b6cb130182d401fa9e15
 PKG_MAINTAINER:=Hans Dedecker <dedeckeh@gmail.com>
 PKG_LICENSE:=GPL-2.0
 
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
 PKG_INSTALL:=1
 PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id
 
index 30c74789a445812db5e6b52b80083de879aa0ffa..aed9f43f802f79dae6fd32abea9073263317586f 100644 (file)
@@ -18,7 +18,6 @@ PKG_SOURCE_URL:=\
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_HASH:=a42f53570f669eaf10af68e98d65b531015ff9e12be7a62d9269ea684652f648
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
 
 PKG_INSTALL:=1
index c8016dc619470d42015cb04599522b2f3085ad8f..10e7656ea490a5bcc6a7cf8895dbfbedce56ab09 100644 (file)
@@ -23,8 +23,6 @@ PKG_CPE_ID:=cpe:/a:samba:ppp
 PKG_RELEASE_VERSION:=2.4.7
 PKG_VERSION:=$(PKG_RELEASE_VERSION).git-$(PKG_SOURCE_DATE)
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
 PKG_BUILD_DEPENDS:=libpcap
 
 PKG_BUILD_PARALLEL:=1
index 837ef251714dc37b31ff7d576559d4b16b08751d..e26a4df81df6f640aa056ad670fe91d27a3f454b 100644 (file)
@@ -19,8 +19,6 @@ PKG_BUILD_DEPENDS:=iptables
 PKG_LICENSE:=GPL-2.0
 PKG_CPE_ID:=cpe:/a:iproute2_project:iproute2
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
 include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
index 58cf8319f52a3d21560a44a455d64da7f30b20de..64438a1931f44ffe522269f7912464e705872b6a 100644 (file)
@@ -15,7 +15,6 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/software/network/iw
 PKG_HASH:=1e38ea794a223525b2ea7fe78fd14f2a56121e62e21ba5f9dbe8c494b35b5c0d
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/iw-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
 PKG_LICENSE:=GPL-2.0
 
index 712617fd25fd5418e33c0673c71e332511f842d3..74ef2cd2049d99c3bdd0480e89b35a8e52f9a72e 100644 (file)
@@ -16,7 +16,6 @@ PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \
        http://www.tcpdump.org/release/
 PKG_HASH:=798b3536a29832ce0cbb07fafb1ce5097c95e308a6f592d14052e1ef1505fe79
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_BUILD_PARALLEL:=1
 
 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
index 0bcd89de890829a1f79dd493017ba0256a07a20a..6c1db9390dbeaf453d33470a38363b4e486c1820 100644 (file)
@@ -17,8 +17,6 @@ PKG_LICENSE_FILES:=COPYING
 
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/cmake.mk
index 7b5748425ddf4efddc9e825427a9a52c0a2c7a0a..592d19663dbfd94baaf23f8b3c56f56a3f98036c 100644 (file)
@@ -10,7 +10,6 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=px5g
 PKG_RELEASE:=8
 PKG_LICENSE:=LGPL-2.1
-PKG_BUILD_DIR:=$(BUILD_DIR)/px5g-$(BUILD_VARIANT)
 
 PKG_USE_MIPS16:=0