From 641b8ed196a402afe43a2e0d68c6a151ead1740b Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Mon, 15 Feb 2016 16:04:59 +0100 Subject: [PATCH] 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. --- scripts/build.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 scripts/build.sh diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 00000000..9d5f5746 --- /dev/null +++ b/scripts/build.sh @@ -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