From fe5f738174a2a055082331ffcad952eac859b07f Mon Sep 17 00:00:00 2001 From: Jun Lyu <71107931+Meiye-lj@users.noreply.github.com> Date: Tue, 3 Mar 2026 05:37:59 +0800 Subject: [PATCH] Fixing missing dependencies in Makefile (#1230) --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index ee9f541..1c63e5d 100644 --- a/Makefile +++ b/Makefile @@ -97,6 +97,13 @@ N2N_OBJS=\ src/tuntap_osx.o \ src/wire.o \ +DEPFILES = $(N2N_OBJS:.o=.d) + +%.o: %.c + $(CC) $(CFLAGS) -MMD -MP -c -o $@ $< + +-include $(DEPFILES) + N2N_DEPS=$(wildcard include/*.h) $(wildcard src/*.c) config.mak # As source files pass the linter, they can be added here (If all the source @@ -273,6 +280,7 @@ clean: rm -f src/edge.o src/supernode.o rm -rf $(N2N_OBJS) $(N2N_LIB) $(APPS) $(DOCS) $(COVERAGEDIR)/ *.dSYM *~ rm -f tests/*.out src/*.gcno src/*.gcda + rm -f $(DEPFILES) for dir in $(SUBDIRS); do $(MAKE) -C $$dir clean; done .PHONY: distclean