Skip to content

Commit 444f812

Browse files
committed
Added overall build script.
1 parent e2f7adf commit 444f812

3 files changed

Lines changed: 81 additions & 1 deletion

File tree

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
*.deb
2+
*.tar.gz
3+
*.dsc
4+
*.changes
5+
*.buildinfo
6+
7+
*/debian/tmp*
8+
*/debian/files
9+
*/debian/*.substvars
10+
*/debian/.debhelper
11+
12+
prerequisites/*-*
13+
*/build
14+
*/build_*
15+
*/binutils
16+
*/debian/binutils-*/
17+
*/gcc
18+
*/debian/gcc-*/
19+
*/gdb
20+
*/debian/gdb-*/
21+
*/newlib
22+
*/debian/libnewlib*/
23+
*/debian/newlib-*/
24+
25+
*-stamp
26+
**/stamp
27+
*.log
28+
29+
*~
30+
*.*~
31+
.*.swp
32+

build-toolchain

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
cwd=$(pwd)
4+
script_path=$(cd $(dirname $0); pwd)
5+
6+
set -e
7+
8+
cd ${script_path}
9+
10+
if [ ! -e ./prerequisites/build-stamp ]; then
11+
pushd prerequisites
12+
./build-prerequisites
13+
touch build-stamp
14+
popd
15+
fi
16+
17+
packages="binutils-microblaze \
18+
gcc-microblaze-bootstrap \
19+
newlib-microblaze \
20+
gcc-microblaze \
21+
gdb-microblaze"
22+
23+
ncores=$(grep -c ^processor /proc/cpuinfo || echo 1)
24+
arch=$(dpkg --print-architecture)
25+
26+
for pkg in ${packages}; do
27+
grep ^${pkg}\$ ./build-stamp >/dev/null 2>&1 && continue
28+
29+
pushd ${pkg}
30+
nice -n 19 dpkg-buildpackage -rfakeroot -uc -us -j${ncores}
31+
pkg_version=$(dpkg-parsechangelog | sed -n 's/^Version: //p')
32+
popd
33+
34+
case ${pkg} in
35+
newlib-*)
36+
echo sudo dpkg -i $(ls -1 lib${pkg}*${pkg_version}*.deb | grep -v doc_)
37+
;;
38+
*)
39+
echo sudo dpkg -i ${pkg}_${pkg_version}_${arch}.deb
40+
;;
41+
esac
42+
43+
echo ${pkg} >> build-stamp
44+
done
45+
46+
echo "Build succeded."
47+
48+
# vim: set filetype=sh ts=4 sw=4 sts=4 et:

prerequisites/build-prerequisites

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ umask 022
99

1010
exec < /dev/null
1111

12-
TARGET=arm-none-eabi
12+
TARGET=microblaze-xilinx-elf
1313

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

0 commit comments

Comments
 (0)