-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-examples.sh
executable file
·28 lines (24 loc) · 1.25 KB
/
build-examples.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
#!/bin/bash
mkdir -p bin
COMPILER="g++" # Change this to your favorite compiler
ALLFLAGS="-I./spitz-include/ccpp/"
SFLAGS="-DSPITZ_SERIAL_DEBUG" # Flags for serial build
RFLAGS="-fPIC -shared" # Flags for building a shared object
# Getting Started
mkdir -p bin/getting-started
echo Building getting-started as module...
$COMPILER $ALLFLAGS -o ./bin/getting-started/getting-started-module ./examples/getting-started/main.cpp $RFLAGS || exit 1
echo Building getting-started as serial...
$COMPILER $ALLFLAGS -o ./bin/getting-started/getting-started-serial ./examples/getting-started/main.cpp $SFLAGS || exit 1
# spitz-pi
mkdir -p bin/spitz-pi
echo Building first pi example as module...
$COMPILER $ALLFLAGS -o ./bin/spitz-pi/spitz-pi-module ./examples/spitz-pi/main.cpp $RFLAGS || exit 1
echo Building first pi example as serial...
$COMPILER $ALLFLAGS -o ./bin/spitz-pi/spitz-pi-serial ./examples/spitz-pi/main.cpp $SFLAGS || exit 1
# spitz-pi-2
mkdir -p bin/spitz-pi-2
echo Building second pi example as module...
$COMPILER $ALLFLAGS -o ./bin/spitz-pi-2/spitz-pi-2-module ./examples/spitz-pi-2/main.cpp $RFLAGS || exit 1
echo Building second pi example as serial...
$COMPILER $ALLFLAGS -o ./bin/spitz-pi-2/spitz-pi-2-serial ./examples/spitz-pi-2/main.cpp $SFLAGS || exit 1