-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompile_linux.sh
More file actions
executable file
·46 lines (32 loc) · 847 Bytes
/
compile_linux.sh
File metadata and controls
executable file
·46 lines (32 loc) · 847 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
38
39
40
41
42
43
44
45
46
#!/bin/bash
# People like colors
YELLOW='\033[1;33m'
GREEN='\033[1;32m'
NC='\033[0m'
COMPILER_FLAGS="-std=c++17 -O2"
WARN_FLAGS="-Wall -Wextra -pedantic"
# Exit on error
set -e
echo -e "${YELLOW}Removing old build.${NC}"
rm -rf build
echo -e "${YELLOW}Creating build directory.${NC}"
mkdir build
echo -e "${YELLOW}Compiling executables.${NC}"
g++ -c PrintInfo.cpp \
$WARN_FLAGS $COMPILER_FLAGS \
-o build/PrintInfo.o
g++ -c ParseArgv.cpp \
$WARN_FLAGS $COMPILER_FLAGS \
-o build/ParseArgv.o
g++ -c TableParse.cpp \
$WARN_FLAGS $COMPILER_FLAGS \
-o build/TableParse.o
g++ -c main.cpp \
$WARN_FLAGS $COMPILER_FLAGS \
-o build/main.o
echo -e "${YELLOW}Basically linking everything together at this point!${NC}"
cd build
g++ -s PrintInfo.o ParseArgv.o TableParse.o main.o -o sa_to_binary
cd ../
echo -e "${GREEN}Done!${NC}"
exit