Changing default target

I am building a firmware for an hardware and would like to have my target ramips- mt7621- selected by default in my source code. I tried to find the place to make this change but it's not obvious to me which file needs to be changed. Can someone tell me the file one needs to change to set default target?

Modify scripts/

diff --git a/scripts/ b/scripts/
index ee0ab5a718..591decda1f 100755
--- a/scripts/
+++ b/scripts/
@@ -174,7 +174,7 @@ EOF
        print <<EOF;
        prompt "Target System"
-       default TARGET_ath79
+       default TARGET_ramips
        reset if !DEVEL
@@ -191,6 +191,7 @@ choice
        prompt "Subtarget" if HAS_SUBTARGETS
        foreach my $target (@target) {
+               $target->{def_subtarget} = "mt7621" if $target->{conf} eq "ramips";
                next unless $target->{def_subtarget};
                print <<EOF;
        default TARGET_$target->{conf}_$target->{def_subtarget} if TARGET_$target->{conf}

You need to clear the temporary data (rm -r tmp/) for the change to take effect. After moving away any existing .config and invoking make menuconfig, ramips/mt7621 should be selected by default.

1 Like