From 9fddfbda619f7bc3b8d7c19bbcb95fb6bc6215be Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Sun, 23 Jan 2022 19:37:40 -0500 Subject: [PATCH] Simplify Makefile --- Makefile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 71e6dcd..c66179f 100644 --- a/Makefile +++ b/Makefile @@ -3,13 +3,16 @@ NDHC_OBJS = $(NDHC_SRCS:.c=.o) NDHC_DEP = $(NDHC_SRCS:.c=.d) INCL = -I. -CC ?= gcc 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 -DNK_USE_CAPABILITY -Wno-discarded-qualifiers - --include $(NDHC_DEP) +CPPFLAGS += $(INCL) all: ragel ndhc +ndhc: $(NDHC_OBJS) + $(CC) $(CFLAGS) $(INCL) -o $@ $^ + +-include $(NDHC_DEP) + clean: rm -f $(NDHC_OBJS) $(NDHC_DEP) ndhc @@ -24,11 +27,5 @@ cfg.c: ragel: ifchd-parse.c cfg.c -%.o: %.c - $(CC) $(CFLAGS) $(INCL) -c -o $@ $^ - -ndhc: $(NDHC_OBJS) - $(CC) $(CFLAGS) $(INCL) -o $@ $^ - .PHONY: all clean cleanragel