-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconf.mk
More file actions
23 lines (21 loc) · 813 Bytes
/
conf.mk
File metadata and controls
23 lines (21 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CC ?= cc
CFLAGS += -pipe -I. -D_POSIX_C_SOURCE=200809 -D_XOPEN_SOURCE=500 -std=c99 -pedantic -Wall -Wextra \
-fstrict-aliasing -fstrict-overflow -foptimize-sibling-calls \
-fdata-sections -ffunction-sections -fno-exceptions \
-fno-unwind-tables -fno-asynchronous-unwind-tables \
-fno-stack-protector
LDFLAGS += -lc -Wl,--sort-section=alignment -Wl,--sort-common
SRC := $(wildcard *.c */*.c)
OBJ := $(SRC:.c=.c.o)
DEP := $(wildcard *.d */*.d)
BIN := $(patsubst %.c, %, $(filter %-test.c, $(SRC)))
TESTS := $(patsubst %.c, %, $(filter test-%.c, $(SRC)))
ifndef NDEBUG
CFLAGS += -O0 -ggdb3 -Werror
CFLAGS += -Wunreachable-code \
-Wno-missing-field-initializers -Wno-unused-parameter \
-Warray-bounds -Wno-missing-braces -Wno-parentheses
else
LDFLAGS += -Wl,--gc-section
CFLAGS += -O3
endif