forked from andrewwutw/build-djgpp
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild-avr.sh
executable file
·83 lines (70 loc) · 2.47 KB
/
build-avr.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env bash
PACKAGE_SOURCES="avr binutils common"
source script/init.sh
TARGET="avr"
prepend BINUTILS_CONFIGURE_OPTIONS "--disable-werror
--disable-nls"
prepend GCC_CONFIGURE_OPTIONS "--disable-nls
--enable-version-specific-runtime-libs
--enable-fat"
prepend GDB_CONFIGURE_OPTIONS "--disable-werror
--disable-nls"
prepend AVRLIBC_CONFIGURE_OPTIONS "--enable-device-lib"
DEPS=""
[ ! -z ${GCC_VERSION} ] && DEPS+=" avr-libc binutils"
[ ! -z ${AVRLIBC_VERSION} ] && DEPS+=" gcc binutils"
source ${BASE}/script/check-deps-and-confirm.sh
source ${BASE}/script/download.sh
source ${BASE}/script/build-tools.sh
source ${BASE}/script/unpack-build-binutils.sh
source ${BASE}/script/build-avr-gcc.sh
cd ${BASE}/build/
if [ ! -z ${SIMULAVR_VERSION} ]; then
echo "Building simulavr"
cd simulavr/ || exit 1
[ -e .git/shallow ] && git fetch --prune --unshallow
git fetch --tags
case `uname` in
MINGW*) sed -i 's/CMAKE_CONFIG_OPTS=/CMAKE_CONFIG_OPTS=-G "MSYS Makefiles" /' Makefile ;;
esac
sed -i "s@-DCMAKE_INSTALL_PREFIX=@-DCMAKE_INSTALL_PREFIX=${DST} #@" Makefile
sed -i 's/@make/$(MAKE)/g' Makefile
sed -i 's@/bin/@@' cmake/GetGitInfo.cmake
${MAKE_J} build || exit 1
${MAKE_J} doc || exit 1
[ ! -z $MAKE_CHECK ] && ${MAKE_J} -s check | tee ${BASE}/tests/simulavr.log
echo "Installing simulavr"
${SUDO} ${MAKE} -C build install || exit 1
cd ${BASE}/build/ || exit 1
fi
if [ ! -z ${AVARICE_VERSION} ]; then
echo "Building AVaRICE"
untar ${AVARICE_ARCHIVE}
cd avarice-${AVARICE_VERSION}
cat ${BASE}/patch/avarice-${AVARICE_VERSION}/* | patch -p1 -u || exit 1
mkdir -p build-avr/
cd build-avr/ || exit 1
rm -rf *
../configure --prefix=${PREFIX} || exit 1
${MAKE_J} || exit 1
[ ! -z $MAKE_CHECK ] && ${MAKE_J} -s check | tee ${BASE}/tests/avarice.log
echo "Installing AVaRICE"
${SUDO} ${MAKE_J} install || exit 1
cd ${BASE}/build/ || exit 1
fi
if [ ! -z ${AVRDUDE_VERSION} ]; then
echo "Building AVRDUDE"
untar ${AVRDUDE_ARCHIVE}
cd avrdude-${AVRDUDE_VERSION}
mkdir -p build-avr/
cd build-avr/ || exit 1
rm -rf *
../configure --prefix=${PREFIX} || exit 1
${MAKE_J} || exit 1
[ ! -z $MAKE_CHECK ] && ${MAKE_J} -s check | tee ${BASE}/tests/avrdude.log
echo "Installing AVRDUDE"
${SUDO} ${MAKE_J} install || exit 1
cd ${BASE}/build/ || exit 1
fi
source ${BASE}/script/build-gdb.sh
source ${BASE}/script/finalize.sh