-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdevBuild.sh
executable file
·37 lines (28 loc) · 1.15 KB
/
devBuild.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
#!/bin/sh
echo "Re-styling code... ----------------------------------------------"
# make the code-style consistent
for f in $(find src/ -type f -name "*.c*" | grep -v "libs"); do
clang-format-3.6 -style="{BasedOnStyle: chromium, BreakBeforeBraces: Allman, MaxEmptyLinesToKeep: 3}" -i $f
done
# AlignConsecutiveAssignments: true
for f in $(find src/ -type f -name "*.h*" | grep -v "libs"); do
clang-format-3.6 -style="{BasedOnStyle: chromium, BreakBeforeBraces: Allman, MaxEmptyLinesToKeep: 3}" -i $f
done
echo "Creating manpage... ----------------------------------------------"
#date style to match Tor's manpage
date=$(date +%m\\/%d\\/%Y)
gzip --best -c src/assets/manpage | sed "s/<DATE>/$date/g" > src/assets/onions-client.1.gz
echo "Preparing build... ----------------------------------------------"
export CXX=/usr/bin/clang++-3.6
export CC=/usr/bin/clang-3.6
mkdir -p build/
cd build
cmake ../src # -DCMAKE_BUILD_TYPE=Debug
echo "Compiling... ----------------------------------------------"
if (make -j $(grep -c ^processor /proc/cpuinfo)) then
cd ..
echo "Compilation successful!"
else
cd ..
rm -rf build/
fi