-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (21 loc) · 1.1 KB
/
Makefile
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
29
30
31
NDHS_C_SRCS = $(sort attach_bpf.c cfg.c dhcp4.c dhcp6.c dhcp_state.c duid.c dynlease.c multicast6.c ndhs.c nl.c nlsocket.c options.c radv6.c nk/hwrng.c nk/random.c nk/io.c nk/privs.c)
NDHS_OBJS = $(NDHS_C_SRCS:.c=.o)
NDHS_DEP = $(NDHS_C_SRCS:.c=.d)
INCL = -I.
CFLAGS = -MMD -Os -s -flto -DNDEBUG -std=gnu99 -Wall -Wextra -Wimplicit-fallthrough=0 -Wformat=2 -Wformat-nonliteral -Wformat-security -Wshadow -Wpointer-arith -Wmissing-prototypes -Wcast-qual -Wsign-conversion -Wno-discarded-qualifiers -DNDHS_BUILD
#CFLAGS = -MMD -Og -g -std=gnu99 -fsanitize=address,undefined -Wall -Wextra -Wimplicit-fallthrough=0 -Wformat=2 -Wformat-nonliteral -Wformat-security -Wshadow -Wpointer-arith -Wmissing-prototypes -Wcast-qual -Wsign-conversion -Wno-discarded-qualifiers -DNDHS_BUILD
CPPFLAGS += $(INCL)
all: ragel ndhs
ndhs: $(NDHS_OBJS)
$(CC) $(CFLAGS) $(INCL) -o $@ $^
-include $(NDHS_DEP)
clean:
rm -f $(NDHS_OBJS) $(NDHS_DEP) ndhs
cleanragel:
rm -f dynlease.c cfg.c
dynlease.c: dynlease.rl
ragel -T0 -o dynlease.c dynlease.rl
cfg.c: cfg.rl
ragel -T0 -o cfg.c cfg.rl
ragel: dynlease.c cfg.c
.PHONY: all clean cleanragel