-
Notifications
You must be signed in to change notification settings - Fork 5
/
build-gcc-rpi.sh
executable file
·40 lines (31 loc) · 1 KB
/
build-gcc-rpi.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
#!/bin/sh
# Output path (relative to build sh file)
OutputPath="./build/arm32"
# Assets path (relative to output folder)
AssetsPath="../../assets"
# Include path (relative to output folder)
IncludePath="../../deps/include"
# Lib path (relative to output folder)
LibPath="../../deps/lib/arm32"
# Compiler flags
# ProfilerFlags="-pg"
# OptimizeFlags="-O2"
# AssemblyFlags="-g -Wa,-ahl"
# DebugFlags="-g -D __DEBUG__"
CommonCompilerFlags="-std=c99 -Wall -x c $ProfilerFlags $OptimizeFlags $AssemblyFlags $DebugFlags -I $IncludePath"
CommonLinkerFlags="-L $LibPath -lglfw -lm -lpthread -ldl"
# Create output path if doesn't exists
mkdir -p $OutputPath
cd $OutputPath
# Empty the build folder
rm -f *
# Compile the project
if gcc $CommonCompilerFlags $CommonLinkerFlags ../../src/war1.c ../../deps/include/glad/glad.c -o war1; then
# Copy assets
cp $AssetsPath/* ./
# Generate ctags
cd ../../
echo "Generating ctags - Start";
ctags --tag-relative --extra=f --language-force=C --recurse=yes
echo "Generating ctags - Done";
fi