Просмотр исходного кода

build: avoid including profiles/*.mk

Generate the active profile name in menuconfig context

Signed-off-by: Felix Fietkau <[email protected]>
Felix Fietkau 9 лет назад
Родитель
Сommit
4a31037a34
2 измененных файлов с 15 добавлено и 6 удалено
  1. 3 6
      include/target.mk
  2. 12 0
      scripts/metadata.pl

+ 3 - 6
include/target.mk

@@ -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

+ 12 - 0
scripts/metadata.pl

@@ -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