target/sdk: use .config instead of unconditionally enabling all build dirs
target/sdk: use .config instead of unconditionally enabling all build dirs

Call make defconfig on every build to catch newly added packages

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39913 3c298f89-4303-0410-b956-a3cf2f4a3e73

--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -156,6 +156,15 @@
 	@+$(MAKE) -r -s tmp/.prereq-build $(PREP_MK)
 	@+$(NO_TRACE_MAKE) -r -s $@
 
+ifeq ($(SDK),1)
+
+%::
+	@+$(PREP_MK) $(NO_TRACE_MAKE) -r -s prereq
+	@./scripts/config/conf --defconfig=.config Config.in
+	@+$(ULIMIT_FIX) $(SUBMAKE) -r $@
+
+else
+
 %::
 	@+$(PREP_MK) $(NO_TRACE_MAKE) -r -s prereq
 	@( \
@@ -167,6 +176,8 @@
 	)
 	@+$(ULIMIT_FIX) $(SUBMAKE) -r $@
 
+endif
+
 help:
 	cat README
 

--- a/package/Makefile
+++ b/package/Makefile
@@ -10,11 +10,8 @@
 -include $(TMP_DIR)/.packagedeps
 $(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m))
 $(curdir)/builddirs-install:=.
-ifeq ($(SDK),1)
-else
-  $(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m))
-  $(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m))
-endif
+$(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m))
+$(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m))
 ifneq ($(IGNORE_ERRORS),)
   package-y-filter := $(package-y)
   package-m-filter := $(filter-out $(package-y),$(package-m))

--- a/target/sdk/convert-config.pl
+++ b/target/sdk/convert-config.pl
@@ -1,5 +1,12 @@
 #!/usr/bin/env perl
 use strict;
+
+print <<EOF;
+config ALL
+	bool
+	default y
+
+EOF
 
 while (<>) {
 	chomp;
@@ -8,6 +15,8 @@
 	my $var = $1;
 	my $val = $2;
 	my $type;
+
+	next if $var eq 'ALL';
 
 	if ($val eq 'y') {
 		$type = "bool";

comments