[v3,1/3] buildscript: Do not use target-dependent build directory

Submitted by Adrian Schmutzler on Oct. 7, 2019, 12:28 p.m.

Details

Message ID 20191007122807.1918-1-freifunk@adrianschmutzler.de
State Accepted
Headers show

Commit Message

Adrian Schmutzler Oct. 7, 2019, 12:28 p.m.
So far, building the firmware happens in parallel subdirectories
of "build", one for each subtarget. However, OpenWrt itself is
capable of hosting several target builds in its directory, so
there is no need for this extra separation.

This patch thus build all targets/subtargets directly in the
"build" folder.

Since most of the time during build is spent for the toolchain,
this will also significantly boost build time if more than one
target is used.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

---

v2/v3: no change
---
 bsp/board_ar71xx.bsp  | 1 -
 bsp/board_mt7621.bsp  | 1 -
 bsp/board_wdr4900.bsp | 1 -
 buildscript           | 3 ++-
 4 files changed, 2 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/bsp/board_ar71xx.bsp b/bsp/board_ar71xx.bsp
index 37130d05..f84b10a1 100644
--- a/bsp/board_ar71xx.bsp
+++ b/bsp/board_ar71xx.bsp
@@ -1,7 +1,6 @@ 
 machine=ar71xx
 chipset=ar71xx
 subtarget=tiny
-target=$builddir/$machine
 images=("openwrt-${chipset}-${subtarget}-archer-c25-v1-squashfs-sysupgrade.bin"
         "openwrt-${chipset}-${subtarget}-archer-c60-v1-squashfs-sysupgrade.bin"
         "openwrt-${chipset}-${subtarget}-archer-c7-v2-squashfs-sysupgrade.bin"
diff --git a/bsp/board_mt7621.bsp b/bsp/board_mt7621.bsp
index e9f67765..340ec0b6 100644
--- a/bsp/board_mt7621.bsp
+++ b/bsp/board_mt7621.bsp
@@ -1,7 +1,6 @@ 
 machine=mt7621
 chipset=ramips
 subtarget=mt7621
-target=$builddir/$machine
 
 images=(
         "openwrt-ramips-mt7621-ubnt-erx-squashfs-sysupgrade.tar"
diff --git a/bsp/board_wdr4900.bsp b/bsp/board_wdr4900.bsp
index 8520c6e5..8671c26e 100644
--- a/bsp/board_wdr4900.bsp
+++ b/bsp/board_wdr4900.bsp
@@ -1,7 +1,6 @@ 
 machine=wdr4900
 chipset=mpc85xx
 subtarget=generic
-target=$builddir/$machine
 
 images=(
         "openwrt-${chipset}-${subtarget}-tl-wdr4900-v1-squashfs-sysupgrade.bin"
diff --git a/buildscript b/buildscript
index 81974a97..767403af 100755
--- a/buildscript
+++ b/buildscript
@@ -169,7 +169,7 @@  prepare() {
 
     #saves ~200MB for each build
     test -d ./src/dl || mkdir ./src/dl
-    ln -s ../../src/dl "$target"/dl
+    ln -s ../src/dl "$target"/dl
 }
 
 prebuild() {
@@ -347,6 +347,7 @@  loadBSP()
 {
     echo "Working with $(/bin/ls -l selected_bsp | awk '{ print $11 }')"
     . selected_bsp
+    target=$builddir
 }
 
 loadVariant()

Comments

Fabian Blaese Nov. 10, 2019, 12:57 p.m.
Es müssten soweit alle drei Patches passen.

Reviewed-by: Fabian Bläse <fabian@blaese.de>

On 07.10.19 14:28, Adrian Schmutzler wrote:
> So far, building the firmware happens in parallel subdirectories
> of "build", one for each subtarget. However, OpenWrt itself is
> capable of hosting several target builds in its directory, so
> there is no need for this extra separation.
> 
> This patch thus build all targets/subtargets directly in the
> "build" folder.
> 
> Since most of the time during build is spent for the toolchain,
> this will also significantly boost build time if more than one
> target is used.
> 
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> 
> ---
> 
> v2/v3: no change
> ---
>  bsp/board_ar71xx.bsp  | 1 -
>  bsp/board_mt7621.bsp  | 1 -
>  bsp/board_wdr4900.bsp | 1 -
>  buildscript           | 3 ++-
>  4 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/bsp/board_ar71xx.bsp b/bsp/board_ar71xx.bsp
> index 37130d05..f84b10a1 100644
> --- a/bsp/board_ar71xx.bsp
> +++ b/bsp/board_ar71xx.bsp
> @@ -1,7 +1,6 @@
>  machine=ar71xx
>  chipset=ar71xx
>  subtarget=tiny
> -target=$builddir/$machine
>  images=("openwrt-${chipset}-${subtarget}-archer-c25-v1-squashfs-sysupgrade.bin"
>          "openwrt-${chipset}-${subtarget}-archer-c60-v1-squashfs-sysupgrade.bin"
>          "openwrt-${chipset}-${subtarget}-archer-c7-v2-squashfs-sysupgrade.bin"
> diff --git a/bsp/board_mt7621.bsp b/bsp/board_mt7621.bsp
> index e9f67765..340ec0b6 100644
> --- a/bsp/board_mt7621.bsp
> +++ b/bsp/board_mt7621.bsp
> @@ -1,7 +1,6 @@
>  machine=mt7621
>  chipset=ramips
>  subtarget=mt7621
> -target=$builddir/$machine
>  
>  images=(
>          "openwrt-ramips-mt7621-ubnt-erx-squashfs-sysupgrade.tar"
> diff --git a/bsp/board_wdr4900.bsp b/bsp/board_wdr4900.bsp
> index 8520c6e5..8671c26e 100644
> --- a/bsp/board_wdr4900.bsp
> +++ b/bsp/board_wdr4900.bsp
> @@ -1,7 +1,6 @@
>  machine=wdr4900
>  chipset=mpc85xx
>  subtarget=generic
> -target=$builddir/$machine
>  
>  images=(
>          "openwrt-${chipset}-${subtarget}-tl-wdr4900-v1-squashfs-sysupgrade.bin"
> diff --git a/buildscript b/buildscript
> index 81974a97..767403af 100755
> --- a/buildscript
> +++ b/buildscript
> @@ -169,7 +169,7 @@ prepare() {
>  
>      #saves ~200MB for each build
>      test -d ./src/dl || mkdir ./src/dl
> -    ln -s ../../src/dl "$target"/dl
> +    ln -s ../src/dl "$target"/dl
>  }
>  
>  prebuild() {
> @@ -347,6 +347,7 @@ loadBSP()
>  {
>      echo "Working with $(/bin/ls -l selected_bsp | awk '{ print $11 }')"
>      . selected_bsp
> +    target=$builddir
>  }
>  
>  loadVariant()
>
Fabian Blaese Nov. 10, 2019, 1:30 p.m.
applied.