summaryrefslogtreecommitdiff
path: root/build.sh
blob: cd337dd34ba2caff33361084e0a2ae760d215d2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
CC=clang

# Possible extra build flags
# these are for compiling the compiler, and NOT for compiling the program itself.
# -DNONZERO_NULL_PTRS
#   - must be set if the zero value of a pointer (as might be set by calloc/memset)
#     is not the NULL pointer.

ADDITIONAL_FLAGS=''

WARNINGS='-Wall -Wextra -Wpedantic -Wconversion -Wshadow'
DEBUG_FLAGS="-O0 -g3 $WARNINGS -std=c11"
RELEASE_FLAGS="-O3 -DNDEBUG $WARNINGS -std=c11"

$CC $DEBUG_FLAGS $ADDITIONAL_FLAGS -o toc main.c || exit 1