build: only install packages for selected variants, fixes building multiple variant...
authorFelix Fietkau <nbd@openwrt.org>
Thu, 13 Dec 2012 13:07:01 +0000 (13:07 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 13 Dec 2012 13:07:01 +0000 (13:07 +0000)
SVN-Revision: 34656

package/Makefile

index e88efdfe9f692e6061b3843041af6c4a1bfb6fc8..df7cf79f2ec736e9315d13b08496adc5e35d7469 100644 (file)
@@ -70,8 +70,19 @@ OPKG:= \
        --add-arch all:100 \
        --add-arch $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(BOARD)):200
 
-PACKAGE_INSTALL:=$(sort $(foreach pkg,$(package-y),$(lastword $(subst /,$(space),$(pkg)))))
-PACKAGE_INSTALL_FILES:=$(patsubst %,$(PKG_INFO_DIR)/%.*.install,$(PACKAGE_INSTALL))
+PACKAGE_INSTALL_FILES:= \
+       $(foreach pkg,$(sort $(package-y)), \
+               $(foreach variant, \
+                       $(if $(package/$(pkg)/variants), \
+                               $(package/$(pkg)/variants), \
+                               $(if $(package/$(pkg)/default-variant), \
+                                       $(package/$(pkg)/default-variant), \
+                                       default \
+                               ) \
+                       ), \
+                       $(PKG_INFO_DIR)/$(lastword $(subst /,$(space),$(pkg))).$(variant).install \
+               ) \
+       )
 
 $(curdir)/cleanup: $(TMP_DIR)/.build
        rm -rf $(STAGING_DIR_ROOT)