From c165a7a77e1e86263b7a4afdcdf23b810235b92b Mon Sep 17 00:00:00 2001 From: giorgiopapini Date: Wed, 25 Jun 2025 09:44:16 +0200 Subject: [PATCH] Updated Makefile. Changed SRC definition based on platform --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6ed5501..087c600 100644 --- Makefile +++ Makefile @@ -42,8 +42,15 @@ UNAME_S := $(shell uname -s) # Source files (recursive find using shell, for portability) -SRC != find . -name '*.c' | grep -v 'libs/libnetdump/protocol.c' | grep -v 'libs/libnetdump/visualizer.c' -OBJ = ${SRC:.c=.o} +ifeq ($(origin MAKE_VERSION), undefined) + # BSD Make + SRC != find . -name '*.c' | grep -v 'utils/protocol.c' | grep -v 'utils/visualizer.c' + OBJ = ${SRC:.c=.o} +else + # GNU Make + SRC := $(shell find . -name '*.c' | grep -v 'utils/protocol.c' | grep -v 'utils/visualizer.c') + OBJ = $(SRC:%.c=%.o) +endif LIB_SRC = libs/libnetdump/protocol.c libs/libnetdump/visualizer.c LIB_OBJ = ${LIB_SRC:.c=.o}