2015-09-21 21:48:40 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-11-02 15:49:40 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright (C) 2015 Intel Corporation
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
2015-09-21 21:48:40 +00:00
|
|
|
|
2015-10-08 19:40:44 +00:00
|
|
|
rootdir=$(readlink -f $(dirname $0))
|
2023-03-15 10:52:05 +00:00
|
|
|
source "$rootdir/test/common/autobuild_common.sh"
|
2015-09-21 21:48:40 +00:00
|
|
|
|
|
|
|
MAKEFLAGS=${MAKEFLAGS:--j16}
|
2015-10-08 19:40:44 +00:00
|
|
|
cd $rootdir
|
|
|
|
|
2019-05-01 23:56:42 +00:00
|
|
|
timing_enter porcelain_check
|
2022-12-01 13:49:50 +00:00
|
|
|
if [[ -e $rootdir/mk/config.mk ]]; then
|
|
|
|
$MAKE clean
|
|
|
|
fi
|
2015-09-21 21:48:40 +00:00
|
|
|
|
2019-07-03 15:12:39 +00:00
|
|
|
if [ $(git status --porcelain --ignore-submodules | wc -l) -ne 0 ]; then
|
2015-09-21 21:48:40 +00:00
|
|
|
echo make clean left the following files:
|
2019-01-13 22:28:03 +00:00
|
|
|
git status --porcelain --ignore-submodules
|
2015-09-21 21:48:40 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2019-05-01 23:56:42 +00:00
|
|
|
timing_exit porcelain_check
|
|
|
|
|
2021-02-24 15:28:36 +00:00
|
|
|
if [[ $SPDK_TEST_RELEASE_BUILD -eq 1 ]]; then
|
2023-03-15 10:52:05 +00:00
|
|
|
build_packaging
|
2021-04-22 14:05:09 +00:00
|
|
|
$MAKE clean
|
2021-02-24 15:28:36 +00:00
|
|
|
fi
|
|
|
|
|
2022-09-19 12:50:03 +00:00
|
|
|
if [[ $RUN_NIGHTLY -eq 0 || $SPDK_TEST_UNITTEST -eq 0 ]]; then
|
2019-05-01 23:56:42 +00:00
|
|
|
timing_finish
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2020-04-01 07:50:01 +00:00
|
|
|
timing_enter build_release
|
2015-09-21 21:48:40 +00:00
|
|
|
|
2020-10-16 08:38:15 +00:00
|
|
|
config_params="$(get_config_params | sed 's/--enable-debug//g')"
|
2020-04-27 20:50:05 +00:00
|
|
|
if [ $(uname -s) = Linux ]; then
|
2021-11-16 13:14:12 +00:00
|
|
|
# LTO needs a special compiler to work under clang. See detect_cc.sh for details.
|
|
|
|
if [[ $CC == *clang* ]]; then
|
|
|
|
LD=$(type -P ld.gold)
|
|
|
|
export LD
|
|
|
|
fi
|
2022-10-28 15:35:03 +00:00
|
|
|
$rootdir/configure $config_params --enable-lto
|
2020-04-27 20:50:05 +00:00
|
|
|
else
|
|
|
|
# LTO needs a special compiler to work on BSD.
|
2022-10-28 15:35:03 +00:00
|
|
|
$rootdir/configure $config_params
|
2020-04-27 20:50:05 +00:00
|
|
|
fi
|
2020-04-01 07:50:01 +00:00
|
|
|
$MAKE ${MAKEFLAGS}
|
|
|
|
$MAKE ${MAKEFLAGS} clean
|
2015-09-21 21:48:40 +00:00
|
|
|
|
2020-04-01 07:50:01 +00:00
|
|
|
timing_exit build_release
|
2015-10-08 19:40:44 +00:00
|
|
|
|
|
|
|
timing_finish
|