blob: 7d59b24dc75f4b818ef04d89443c3bc144e9e38f [file] [log] [blame]
xNombred07bb0d2020-03-10 20:17:12 +01001#!/bin/bash
2
3set -e
4
5if [[ $ENABLE_SANITIZERS ]]; then
6 LOCAL_CMAKE_EXTRA_ARGS="-DCMAKE_C_FLAGS=-fsanitize=$ENABLE_SANITIZERS"
7 LOCAL_MAKE_EXTRA_ARGS="CFLAGS=-fsanitize=$ENABLE_SANITIZERS LDFLAGS=-fsanitize=$ENABLE_SANITIZERS"
8fi
9
10if [[ $USE_CMAKE ]]; then
11 echo "$0: using cmake + make:" $LOCAL_CMAKE_EXTRA_ARGS $EXTRA_ARGS
12 mkdir build-cmake
13 cd build-cmake
14 cmake $LOCAL_CMAKE_EXTRA_ARGS $EXTRA_ARGS ..
15 make
16 [[ $DISABLE_TESTS ]] || make test
17 make clean
18fi
19
20if [[ $USE_CONFIGURE ]]; then
21 mkdir build-configure
22 cd build-configure
23 echo "$0: using configure + make:" $LOCAL_MAKE_EXTRA_ARGS $EXTRA_ARGS
24 ../configure $LOCAL_MAKE_EXTRA_ARGS $EXTRA_ARGS
25 make
26 [[ $DISABLE_TESTS ]] || make test
27 make clean
28 make distclean
29fi
30
31if [[ $USE_LEGACY_MAKEFILES ]]; then
32 echo "$0: using scripts/makefile.$CC:" $LOCAL_MAKE_EXTRA_ARGS $EXTRA_ARGS
33 make -f scripts/makefile.$CC $LOCAL_MAKE_EXTRA_ARGS $EXTRA_ARGS
34 [[ $DISABLE_TESTS ]] || make -f scripts/makefile.$CC $LOCAL_MAKE_EXTRA_ARGS $EXTRA_ARGS test
35 make -f scripts/makefile.$CC $LOCAL_MAKE_EXTRA_ARGS $EXTRA_ARGS clean
36 # TODO: use scripts/makefile.std, etc.
37fi