scripts/build.sh: Added build script to facilitate CI

The build script invokes configure and make with different
parameters depending on the environment variables PLATFORM
and TESTS. PLATFORM currently must be one of 'posix', 'contiki', or
'lwip'. If TESTS is set to 'yes' or 'true', the option --enable-tests
will be passed to configure and tests/testdriver will be invoked
after configuration and make.
This commit is contained in:
Olaf Bergmann committed 2016-02-15 16:04:59 +01:00
1 parent 8a8790cfc3
commit 641b8ed196
1 file changed
+25
+25
View File
@@ -0,0 +1,25 @@
#! /bin/sh
if test "x$TESTS" = "xyes" -o "x$TESTS" = "xtrue" ; then
WITH_TESTS=--enable-tests
fi
config() {
echo "./configure $*"
./configure $*
}
case "${PLATFORM}" in
contiki) config "--disable-tests --disable-documentation --disable-examples" && \
(cd examples/contiki && make V=1 contiki all)
;;
lwip) config "--disable-tests --disable-documentation --disable-examples" && \
(cd examples/lwip && make lwip lwip-contrib all)
;;
posix|*) config "$WITH_TESTS --enable-documentation --enable-examples" && make
;;
esac
if test -n "$WITH_TESTS" ; then
tests/testdriver
fi