-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_linux.sh
executable file
·59 lines (43 loc) · 1.09 KB
/
build_linux.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
set -e
export MAIN_DIR=`pwd`
export OUTPUT_BINARY=$MAIN_DIR/.build/bin/onion
export RELEASE_DIR=$MAIN_DIR/.release
export RELEASE_BINARY=$MAIN_DIR/.release/onion/onion
export FILES_DIR=$MAIN_DIR/files
export BUILD_DIR=$MAIN_DIR/.build
if [ -d $RELEASE_DIR ]; then
echo Cleanup release dir...
rm -r -f $RELEASE_DIR
fi
if [ -d $RELEASE_DIR ]; then
echo Cleanup build dir...
rm -r -f $BUILD_DIR
fi
echo Build...
if [ ! -d $BUILD_DIR ]; then
mkdir $BUILD_DIR
fi
if [ ! -d $BUILD_DIR/linux ]; then
mkdir $BUILD_DIR/linux
fi
pushd $BUILD_DIR/linux
cmake ../..
cmake --build . --config Release -j `nproc`
popd
echo Sync...
if [ ! -d $RELEASE_DIR ]; then
mkdir $RELEASE_DIR
rm -r -f $RELEASE_DIR/onion
fi
git clone https://[email protected]/BareMetalEngine/onion.git $RELEASE_DIR/onion
echo Package...
cp $OUTPUT_BINARY $RELEASE_BINARY
echo Copied into '$RELEASE_BINARY'
$OUTPUT_BINARY glue -action=pack -file="$RELEASE_BINARY" -source="$FILES_DIR"
echo Submit...
pushd $RELEASE_DIR/onion
git add -f onion
git commit --allow-empty -m "Updated compiled linux binaries"
git push
popd