-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.sh
executable file
·48 lines (37 loc) · 1.08 KB
/
build.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
#!/bin/bash
THREADS=1
# Check for core numbers.
if [ -n "$1" ]; then
if [ "$1" -eq 0 ]; then
THREADS=$(nproc)
elif [ "$1" -gt 0 ]; then
THREADS=$1
fi
fi
echo "Building Packet Batch (AF_XDP) using $THREADS threads..."
# First, we want to build our common objects which includes LibYAML. Read the PB-Common directory for more information.
echo "Building Common Repository..."
echo "Building JSON-C..."
make -j $THREADS -C modules/common jsonc
echo "Done..."
echo "Installing JSON-C..."
sudo make -j $THREADS -C modules/common jsonc_install
echo "Building Common Main..."
make -j $THREADS common
echo "Done..."
echo "Installing Common..."
sudo make -j $THREADS common_install
echo "Done..."
echo "Building AF_XDP Version..."
# Next, build LibBPF objects.
echo "Building LibBPF..."
make -j $THREADS libbpf
echo "Done..."
# Now build our primary objects and executables.
echo "Building Main..."
make -j $THREADS
echo "Done..."
# Finally, install our binary. This must be ran by root or with sudo.
echo "Installing Main..."
sudo make -j $THREADS install
echo "Done..."