From 48c151aa1683de94e42f4410fb9312936e030adf Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Sat, 7 May 2022 02:38:08 -0300 Subject: makefiles: deduplicate main target name into new PROG var Put the main target name into a new PROG variable, put PROG into a new TARGET variable, make "all" depend on `$(TARGET)` and replace every other occurrence of the main target name with `$(PROG)`. On the makefiles that build non-shared objects, to make them more similar. With this commit, all of their targets are identical (except for the extra "lib" target on src/lib/Makefile). --- src/fnetfilter/Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/fnetfilter') diff --git a/src/fnetfilter/Makefile b/src/fnetfilter/Makefile index 7d26ca39e..32d6e761d 100644 --- a/src/fnetfilter/Makefile +++ b/src/fnetfilter/Makefile @@ -1,22 +1,25 @@ ROOT = ../.. -include $(ROOT)/config.mk +PROG = fnetfilter +TARGET = $(PROG) + MOD_HDRS = ../include/common.h ../include/syscall.h MOD_OBJS = ../lib/common.o .PHONY: all -all: fnetfilter +all: $(TARGET) include $(ROOT)/src/common.mk %.o : %.c $(HDRS) $(ROOT)/config.mk $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@ -fnetfilter: $(OBJS) $(ROOT)/config.mk +$(PROG): $(OBJS) $(ROOT)/config.mk $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS) .PHONY: clean -clean:; rm -fr *.o fnetfilter *.gcov *.gcda *.gcno *.plist +clean:; rm -fr *.o $(PROG) *.gcov *.gcda *.gcno *.plist .PHONY: distclean distclean: clean -- cgit v1.2.3-54-g00ecf