From fe312ffbe153a3ce16264d68f19bdb164ed57a5c Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Mon, 13 Jan 2020 16:49:45 +0100 Subject: Compile libndpireader --- example/Makefile.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'example') diff --git a/example/Makefile.in b/example/Makefile.in index bda7cbe9e..cc47b3047 100644 --- a/example/Makefile.in +++ b/example/Makefile.in @@ -11,8 +11,14 @@ PREFIX?=@prefix@ all: ndpiReader @DPDK_TARGET@ -ndpiReader: $(OBJS) $(LIBNDPI) - $(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) +EXECUTABLE_SOURCES := ndpiReader.c +COMMON_SOURCES := $(filter-out $(EXECUTABLE_SOURCES),$(wildcard *.c )) + +libndpiReader.a: $(COMMON_SOURCES:%.c=%.o) $(LIBNDPI) + ar rsv libndpiReader.a $(COMMON_SOURCES:%.c=%.o) + +ndpiReader: libndpiReader.a $(LIBNDPI) $(EXECUTABLE_SOURCES:%.c=%.o) + $(CXX) $(CFLAGS) $(EXECUTABLE_SOURCES:%.c=%.o) libndpiReader.a -o $@ $(LDFLAGS) %.o: %.c $(HEADERS) Makefile $(CC) $(CFLAGS) -c $< -o $@ -- cgit v1.2.3