File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ exec { tar -a -cf "bin\$filename" -C "build\picotool-install\$msysEnv" '*' }
265265if ($env: SKIP_OPENOCD -ne ' 1' ) {
266266 # Package OpenOCD separately as well
267267
268- $version = (cmd / c " .\build\openocd-install\$msysEnv \bin \openocd.exe" -- version ' 2>&1' )[0 ]
268+ $version = (cmd / c " .\build\openocd-install\openocd \openocd.exe" -- version ' 2>&1' )[0 ]
269269 if (-not ($version -match ' Open On-Chip Debugger (?<version>[a-zA-Z0-9\.\-+]+) \((?<timestamp>[0-9\-:]+)\)' )) {
270270 Write-Error ' Could not determine openocd version'
271271 }
@@ -276,10 +276,10 @@ if ($env:SKIP_OPENOCD -ne '1') {
276276
277277 # Removing files with special char in their names
278278 # they cause issues with some decompression libraries
279- Remove-Item " build\openocd-install\$msysEnv \share\ openocd\scripts\target\1986*.cfg"
279+ Remove-Item " build\openocd-install\openocd\scripts\target\1986*.cfg"
280280
281281 Write-Host " Saving OpenOCD package to $filename "
282- exec { tar - a - cf " bin\$filename " - C " build\openocd-install\$msysEnv \bin " ' *' - C " ..\share\openocd " " scripts " }
282+ exec { tar - a - cf " bin\$filename " - C " build\openocd-install\openocd " ' *' }
283283}
284284
285285if ($env: SKIP_RISCV -ne ' 1' ) {
Original file line number Diff line number Diff line change 8484if [[ " $SKIP_OPENOCD " != 1 ]]; then
8585 # Package OpenOCD separately as well
8686
87- version=($( " ./$builddir /openocd-install/usr/local/bin /openocd" --version 2>&1 ) )
87+ version=($( " ./$builddir /openocd-install/openocd /openocd" --version 2>&1 ) )
8888 version=${version[0]}
8989 version=${version[3]}
9090 version=$( echo $version | cut -d " -" -f 1)
@@ -94,8 +94,8 @@ if [[ "$SKIP_OPENOCD" != 1 ]]; then
9494 filename=" openocd-${version} -${suffix} .tar.gz"
9595
9696 echo " Saving OpenOCD package to $filename "
97- pushd " $builddir /openocd-install/usr/local/bin "
98- tar -a -cf " $topd /bin/$filename " * -C " ../share/openocd " " scripts "
97+ pushd " $builddir /openocd-install/openocd "
98+ tar -a -cf " $topd /bin/$filename " *
9999 popd
100100fi
101101
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ if [[ "$SKIP_OPENOCD" != 1 ]]; then
6464 echo " Packaging OpenOCD"
6565 # Package OpenOCD separately as well
6666
67- version=($( " ./$builddir /openocd-install/usr/local/bin /openocd" --version 2>&1 ) )
67+ version=($( " ./$builddir /openocd-install/openocd /openocd" --version 2>&1 ) )
6868 version=${version[0]}
6969 version=${version[3]}
7070 version=$( echo $version | cut -d " -" -f 1)
@@ -74,8 +74,8 @@ if [[ "$SKIP_OPENOCD" != 1 ]]; then
7474 filename=" openocd-${version} -${suffix} .zip"
7575
7676 echo " Saving OpenOCD package to $filename "
77- pushd " $builddir /openocd-install/usr/local/bin "
78- tar -a -cf " $topd /bin/$filename " * -C " ../share/openocd " " scripts "
77+ pushd " $builddir /openocd-install/openocd "
78+ tar -a -cf " $topd /bin/$filename " *
7979 popd
8080fi
8181
Original file line number Diff line number Diff line change @@ -5,17 +5,22 @@ set -euo pipefail
55export CFLAGS=-static
66export LDFLAGS=-static
77
8+ BUILDDIR=$( pwd)
9+ INSTALLDIR=" openocd-install"
10+ BINDIR=" /openocd"
11+ DATADIR=" /"
12+
813cd openocd
914./bootstrap
10- ./configure --disable-werror --enable-internal-jimtcl
15+ ./configure --disable-werror --enable-internal-jimtcl --bindir= " $BINDIR " --datadir= " $DATADIR "
1116make clean
1217make
13- INSTALLDIR=" $PWD /../openocd-install/usr/local/bin"
14- rm -rf " $PWD /../openocd-install"
15- DESTDIR=" $PWD /../openocd-install" make install
18+ rm -rf " $BUILDDIR /$INSTALLDIR "
19+ DESTDIR=" $BUILDDIR /$INSTALLDIR " make install
1620
1721# Add libraries that may be different versions on the system
18- cd $INSTALLDIR
22+ cd " $BUILDDIR /$INSTALLDIR /$BINDIR "
23+ find . -maxdepth 1 ! -name . ! -name .. ! -name openocd ! -name scripts -exec rm -r {} +
1924if [[ $( uname -m) == ' aarch64' ]]; then
2025 cp $( ldd openocd | egrep -o " (/.*/libgpiod\.so\.\S*)" ) ./
2126fi
Original file line number Diff line number Diff line change 22
33set -euo pipefail
44
5+ BUILDDIR=$( pwd)
6+ INSTALLDIR=" openocd-install-$( uname -m) "
7+ BINDIR=" /openocd"
8+ DATADIR=" /"
9+
510cd openocd
611
712./bootstrap
813# See https://github.com/raspberrypi/openocd/issues/30
914# ./configure --disable-werror CAPSTONE_CFLAGS="$(pkg-config capstone --cflags | sed s/.capstone\$//)"
10- ./configure --disable-werror --enable-internal-jimtcl
15+ ./configure --disable-werror --enable-internal-jimtcl --bindir= " $BINDIR " --datadir= " $DATADIR "
1116make clean
1217make
13- INSTALLDIR=" $PWD /../openocd-install-$( uname -m) /usr/local/bin"
14- rm -rf " $PWD /../openocd-install-$( uname -m) "
15- DESTDIR=" $PWD /../openocd-install-$( uname -m) " make install
18+ rm -rf " $BUILDDIR /$INSTALLDIR "
19+ DESTDIR=" $BUILDDIR /$INSTALLDIR " make install
20+
21+ cd " $BUILDDIR /$INSTALLDIR /$BINDIR "
22+ find . -maxdepth 1 ! -name . ! -name .. ! -name openocd ! -name scripts -exec rm -r {} +
Original file line number Diff line number Diff line change @@ -4,14 +4,17 @@ set -euo pipefail
44
55BUILDDIR=$( pwd)
66INSTALLDIR=" openocd-install"
7+ BINDIR=" /openocd"
8+ DATADIR=" /"
79
810cd openocd
911
1012./bootstrap
11- ./configure --disable-werror --enable-internal-jimtcl
13+ ./configure --disable-werror --enable-internal-jimtcl --bindir= " $BINDIR " --datadir= " $DATADIR "
1214make clean
1315make
1416DESTDIR=" $BUILDDIR /$INSTALLDIR " make install
1517
16- cd " $BUILDDIR /$INSTALLDIR /${MSYSTEM,,} /bin"
18+ cd " $BUILDDIR /$INSTALLDIR /$BINDIR "
19+ find . -maxdepth 1 ! -name . ! -name .. ! -name openocd.exe ! -name scripts -exec rm -r {} +
1720" $BUILDDIR /../packages/windows/copy-deps.sh"
You can’t perform that action at this time.
0 commit comments