forked from intel/xpumanager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·39 lines (35 loc) · 870 Bytes
/
build.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
#!/usr/bin/env bash
#
# Copyright (C) 2021-2023 Intel Corporation
# SPDX-License-Identifier: MIT
# @file build.sh
#
WORK=`dirname "$0"`
WORK_DIR=`cd ${WORK} && pwd`
echo "build distribution package"
cd ${WORK_DIR}
if [ -d build ]; then
for f in $( ls -a build )
do
if [ x"$f" != x"." ] && [ x"$f" != x".." ] \
&& [ x"$f" != x"hwloc" ] \
&& [ x"$f" != x"third_party" ] \
&& [ x"$f" != x"lib" ]; then
rm -rf build/$f
fi
done
echo "build folder exist."
else
mkdir build
fi
cd build
ccache_opts=
if command -v ccache &> /dev/null
then
ccache_opts="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
fi
prefix_default="-DCMAKE_INSTALL_PREFIX=/usr"
cmake .. $ccache_opts $prefix_default $@
make -j4
echo "---------Create installation package-----------"
cpack