2022-01-23 18:31:04 -05:00
|
|
|
NDHC_SRCS = $(sort $(wildcard *.c) $(wildcard nk/*.c) ifchd-parse.c cfg.c)
|
2011-07-12 04:09:05 -04:00
|
|
|
NDHC_OBJS = $(NDHC_SRCS:.c=.o)
|
2022-01-23 18:31:04 -05:00
|
|
|
NDHC_DEP = $(NDHC_SRCS:.c=.d)
|
2022-01-22 18:39:41 -05:00
|
|
|
INCL = -I.
|
2011-07-12 04:09:05 -04:00
|
|
|
|
2022-08-10 11:32:30 -04:00
|
|
|
CFLAGS = -MMD -O2 -s -std=gnu99 -pedantic -Wall -Wextra -Wimplicit-fallthrough=0 -Wformat=2 -Wformat-nonliteral -Wformat-security -Wshadow -Wpointer-arith -Wmissing-prototypes -Wunused-const-variable=0 -Wcast-qual -Wsign-conversion -D_GNU_SOURCE -Wno-discarded-qualifiers -Wstrict-overflow=5
|
2022-01-23 19:37:40 -05:00
|
|
|
CPPFLAGS += $(INCL)
|
2011-07-12 04:09:05 -04:00
|
|
|
|
2022-01-22 18:39:41 -05:00
|
|
|
all: ragel ndhc
|
2011-07-12 04:09:05 -04:00
|
|
|
|
2022-01-23 19:37:40 -05:00
|
|
|
ndhc: $(NDHC_OBJS)
|
|
|
|
$(CC) $(CFLAGS) $(INCL) -o $@ $^
|
|
|
|
|
|
|
|
-include $(NDHC_DEP)
|
|
|
|
|
2011-07-12 04:09:05 -04:00
|
|
|
clean:
|
2022-01-23 18:31:04 -05:00
|
|
|
rm -f $(NDHC_OBJS) $(NDHC_DEP) ndhc
|
|
|
|
|
|
|
|
cleanragel:
|
|
|
|
rm -f ifchd-parse.c cfg.c
|
2011-07-12 04:09:05 -04:00
|
|
|
|
2022-01-22 18:39:41 -05:00
|
|
|
ifchd-parse.c:
|
|
|
|
ragel -G2 -o ifchd-parse.c ifchd-parse.rl
|
2011-07-12 04:09:05 -04:00
|
|
|
|
2022-01-22 18:39:41 -05:00
|
|
|
cfg.c:
|
|
|
|
ragel -G2 -o cfg.c cfg.rl
|
2013-05-08 09:08:47 -04:00
|
|
|
|
2022-01-22 18:39:41 -05:00
|
|
|
ragel: ifchd-parse.c cfg.c
|
2014-04-15 20:50:54 -04:00
|
|
|
|
2022-01-23 18:31:04 -05:00
|
|
|
.PHONY: all clean cleanragel
|
2011-07-12 04:09:05 -04:00
|
|
|
|