build: avoid including profiles/*.mk
authorFelix Fietkau <nbd@nbd.name>
Wed, 11 May 2016 18:13:58 +0000 (20:13 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 11 May 2016 18:14:00 +0000 (20:14 +0200)
Generate the active profile name in menuconfig context

Signed-off-by: Felix Fietkau <nbd@nbd.name>
include/target.mk
scripts/metadata.pl

index f4342bdbb532d40ece8e8892c789c466aaa3daa1..868fe6b3758e2c80b893facd80bc956cb4e9a72e 100644 (file)
@@ -84,9 +84,6 @@ define Profile
        echo "$$$$$$$$$(call shvar,Profile/$(1)/Description)"; \
        echo "@@"; \
        echo;
-  ifeq ($(CONFIG_TARGET_$(call target_conf,$(BOARD)_$(if $(SUBTARGET),$(SUBTARGET)_))$(1)),y)
-    PROFILE=$(1)
-  endif
 endef
 endif
 
@@ -101,10 +98,10 @@ else
   endef
 endif
 
+PROFILE:=$(call qstrip,$(CONFIG_TARGET_PROFILE))
+
 ifeq ($(TARGET_BUILD),1)
-  $(eval $(call IncludeProfiles))
-else
-  ifeq ($(DUMP),)
+  ifneq ($(DUMP),)
     $(eval $(call IncludeProfiles))
   endif
 endif
index f5afb1e47b49a60d696afc42705d706e1f39c7c7..260d06d712f28b98efc9173c8da173343e37a33e 100755 (executable)
@@ -337,6 +337,18 @@ EOF
                }
        }
        print <<EOF;
+config TARGET_PROFILE
+       string
+EOF
+       foreach my $target (@target) {
+               my $profiles = $target->{profiles};
+               foreach my $profile (@$profiles) {
+                       print "\tdefault \"$profile->{id}\" if TARGET_$target->{conf}_$profile->{id}\n";
+               }
+       }
+
+       print <<EOF;
+
 config TARGET_ARCH_PACKAGES
        string