add an optimized release build
Haldean Brown
4 years ago
6 | 6 | |
7 | 7 | UBIK_CFLAGS := -std=c11 -Werror -Wall -Wextra -Wswitch-enum \ |
8 | 8 | -fno-strict-aliasing -pedantic -ggdb -rdynamic -I$(top)/include/ \ |
9 | -O0 -D_GNU_SOURCE -fstack-protector-strong $(CFLAGS) | |
9 | -D_GNU_SOURCE -fstack-protector-strong $(CFLAGS) | |
10 | 10 | |
11 | ifneq ($(release),yes) | |
12 | UBIK_CFLAGS := $(UBIK_CFLAGS) -O0 | |
11 | 13 | ifneq ($(CC), musl-gcc) |
12 | 14 | ifneq ($(sanitize),no) |
13 | 15 | UBIK_CFLAGS := $(UBIK_CFLAGS) -fsanitize=address -fsanitize=leak -fsanitize=undefined |
14 | 16 | endif |
15 | 17 | endif |
18 | else | |
19 | UBIK_CFLAGS := $(UBIK_CFLAGS) -O3 | |
20 | endif | |
21 | ||
16 | 22 | |
17 | 23 | UBIK_LDFLAGS := -rdynamic -ldl -pthread $(LDFLAGS) |
18 | 24 | LINK_LIBUBIK = -Wl,--whole-archive $(top)/libubik/libubik.a -Wl,--no-whole-archive |