Skip to content

Commit

Permalink
Added overall build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdednev committed Nov 8, 2021
1 parent e2f7adf commit 444f812
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
*.deb
*.tar.gz
*.dsc
*.changes
*.buildinfo

*/debian/tmp*
*/debian/files
*/debian/*.substvars
*/debian/.debhelper

prerequisites/*-*
*/build
*/build_*
*/binutils
*/debian/binutils-*/
*/gcc
*/debian/gcc-*/
*/gdb
*/debian/gdb-*/
*/newlib
*/debian/libnewlib*/
*/debian/newlib-*/

*-stamp
**/stamp
*.log

*~
*.*~
.*.swp

48 changes: 48 additions & 0 deletions build-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

cwd=$(pwd)
script_path=$(cd $(dirname $0); pwd)

set -e

cd ${script_path}

if [ ! -e ./prerequisites/build-stamp ]; then
pushd prerequisites
./build-prerequisites
touch build-stamp
popd
fi

packages="binutils-microblaze \
gcc-microblaze-bootstrap \
newlib-microblaze \
gcc-microblaze \
gdb-microblaze"

ncores=$(grep -c ^processor /proc/cpuinfo || echo 1)
arch=$(dpkg --print-architecture)

for pkg in ${packages}; do
grep ^${pkg}\$ ./build-stamp >/dev/null 2>&1 && continue

pushd ${pkg}
nice -n 19 dpkg-buildpackage -rfakeroot -uc -us -j${ncores}
pkg_version=$(dpkg-parsechangelog | sed -n 's/^Version: //p')
popd

case ${pkg} in
newlib-*)
echo sudo dpkg -i $(ls -1 lib${pkg}*${pkg_version}*.deb | grep -v doc_)
;;
*)
echo sudo dpkg -i ${pkg}_${pkg_version}_${arch}.deb
;;
esac

echo ${pkg} >> build-stamp
done

echo "Build succeded."

# vim: set filetype=sh ts=4 sw=4 sts=4 et:
2 changes: 1 addition & 1 deletion prerequisites/build-prerequisites
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ umask 022

exec < /dev/null

TARGET=arm-none-eabi
TARGET=microblaze-xilinx-elf

# Set variables according to real environment
uname_string=`uname | sed 'y/LINUXDARWIN/linuxdarwin/'`
Expand Down

0 comments on commit 444f812

Please sign in to comment.