-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·37 lines (32 loc) · 751 Bytes
/
build.sh
File metadata and controls
executable file
·37 lines (32 loc) · 751 Bytes
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
#!/bin/bash
# Run from project root.
BUILDDIR=build
SRCDIR=src
if [[ ! -d $BUILDDIR ]]
then
mkdir $BUILDDIR
fi
for subdir in `ls ${SRCDIR}`
do
pushd ${SRCDIR}/$subdir > /dev/null
for srcfile in `ls *.cpp`
do
srcfile_basename=$(basename ${srcfile} .cpp)
output_name="${subdir}-${srcfile_basename}"
echo -n "building ${srcfile} to ${output_name} ... "
clang++ \
-ggdb3 -Wall -Wpedantic -O1 --std=c++1y \
-I../../${SRCDIR} \
-o ../../${BUILDDIR}/${output_name} \
${srcfile}
rc=$?
if [ "$rc" -ne "0" ]
then
popd > /dev/null
exit $rc
fi
echo "done"
done
popd > /dev/null
done
exit 0