build: allow package to be built for all variants
authorEneas U de Queiroz <cotequeiroz@gmail.com>
Wed, 3 Nov 2021 18:51:32 +0000 (15:51 -0300)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 14 Nov 2021 23:38:46 +0000 (00:38 +0100)
This allows a package to be rebuilt for all different VARIANTs.
To do so, set VARIANT=*.

The wpa-cli package is not getting built after changes made by
19aae94 [build: avoid rebuilds of unset VARIANT packages], because
wpa-cli is only built when compiling a variant that includes
supplicant support, and the first selected variant may not build it.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
include/package-bin.mk
include/package-ipkg.mk
include/subdir.mk

index 77e603e42083a0efe09aa8fad8c4cad1150f5351..4ca49218e95a27229926595cfa8317ee0ded2cf6 100644 (file)
@@ -4,7 +4,7 @@
 
 ifeq ($(DUMP),)
   define BuildTarget/bin
-    TARGET_VARIANT=$(if $(ALL_VARIANTS),$(if $(VARIANT),$(VARIANT),$(firstword $(ALL_VARIANTS))))
+    TARGET_VARIANT=$(if $(ALL_VARIANTS),$(if $(VARIANT),$(filter-out *,$(VARIANT)),$(firstword $(ALL_VARIANTS))))
     ifeq ($(if $(TARGET_VARIANT),$(BUILD_VARIANT)),$(TARGET_VARIANT))
     ifdef Package/$(1)/install
       ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
index bd50edb75f72d6dc672af7629979d5a25cce2a13..362a0e2a8b5c6b4fde82865f78b21d2cad38be97 100644 (file)
@@ -105,7 +105,7 @@ ifeq ($(DUMP),)
     IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
     KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
 
-    TARGET_VARIANT:=$$(if $(ALL_VARIANTS),$$(if $$(VARIANT),$$(VARIANT),$(firstword $(ALL_VARIANTS))))
+    TARGET_VARIANT:=$$(if $(ALL_VARIANTS),$$(if $$(VARIANT),$$(filter-out *,$$(VARIANT)),$(firstword $(ALL_VARIANTS))))
     ifeq ($(BUILD_VARIANT),$$(if $$(TARGET_VARIANT),$$(TARGET_VARIANT),$(BUILD_VARIANT)))
     do_install=
     ifdef Package/$(1)/install
index 155f4935384f0f2f7ece9012b3a46267fa5a3700..95009f814e29d4cab4f74c51fd30342484f5f111 100644 (file)
@@ -69,7 +69,7 @@ define subdir
         $(if $(call diralias,$(bd)),$(call warn_eval,$(1)/$(bd),l,T,$(1)/$(call diralias,$(bd))/$(btype)/$(target): $(1)/$(bd)/$(btype)/$(target)))
       )
       $(call warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(target): $(if $(NO_DEPS)$(QUILT),,$($(1)/$(bd)/$(target)) $(call $(1)//$(target),$(1)/$(bd))))
-        $(foreach variant,$(if $(BUILD_VARIANT),$(BUILD_VARIANT),$(if $(strip $($(1)/$(bd)/variants)),$($(1)/$(bd)/variants),$(if $($(1)/$(bd)/default-variant),$($(1)/$(bd)/default-variant),__default))),
+        $(foreach variant,$(filter-out *,$(if $(BUILD_VARIANT),$(BUILD_VARIANT),$(if $(strip $($(1)/$(bd)/variants)),$($(1)/$(bd)/variants),$(if $($(1)/$(bd)/default-variant),$($(1)/$(bd)/default-variant),__default)))),
                        $(if $(BUILD_LOG),@mkdir -p $(BUILD_LOG_DIR)/$(1)/$(bd)/$(filter-out __default,$(variant)))
                        $(if $($(1)/autoremove),$(call rebuild_check,$(1)/$(bd),$(target),,$(filter-out __default,$(variant)),$($(1)/$(bd)/variants)))
                        $(call log_make,$(1)/$(bd),$(target),,$(filter-out __default,$(variant)),$($(1)/$(bd)/variants)) \