summaryrefslogtreecommitdiff
path: root/build.sh
blob: 2bd3964c6192e13cbed3b61f6d1767d99c9ab2ee (plain)
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
#!/bin/sh
set -e

DEBUG_FLAGS=""
LIB="-Ilibs/iceys-c-libs -Ilibs/socket"

mkdir -p bin
mkdir -p obj

while getopts "d" opt; do
    case "$opt" in
        d) DEBUG_FLAGS="-Wall -fsanitize=address -g"
            ;;
    esac
done

shift $((OPTIND-1))
[ "${1:-}" = "--" ] && shift

printf "\n\nmaking project\n"
clang -Ilibs/iceys-c-libs -c libs/iceys-c-libs/iceys-utils.c -o obj/iceys-utils.o
clang -Ilibs/socket -c libs/socket/Server.c -o obj/Server.o
clang -Ilibs/iceys-c-libs -Ilibs/socket -c libs/socket/launch-web.c -o obj/launch-web.o

clang obj/iceys-utils.o obj/Server.o obj/launch-web.o -o bin/Server src/main.c $LIB $DEBUG_FLAGS -lm