-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconf.mk
More file actions
28 lines (24 loc) · 863 Bytes
/
conf.mk
File metadata and controls
28 lines (24 loc) · 863 Bytes
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
CC ?= cc
CFLAGS += -pipe -I. -D_POSIX_C_SOURCE=200809 -D_XOPEN_SOURCE=600 \
-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)
OBJ := $(SRC:.c=.c.o)
DEP := $(wildcard *.d)
TESTS := $(wildcard test-*.c)
BIN := tmc $(TESTS:.c=)
$(foreach test,$(TESTS),$(eval $(test:.c=): $(test:.c=.c.o)))
tmc: tmc.c.o
ifndef NDEBUG
CFLAGS += -O1 -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