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 f4342bd..868fe6b 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 f5afb1e..260d06d 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