aboutsummaryrefslogtreecommitdiff
path: root/example/Makefile.in
diff options
context:
space:
mode:
authorPhilippe Antoine <contact@catenacyber.fr>2020-01-13 16:49:45 +0100
committerPhilippe Antoine <contact@catenacyber.fr>2020-01-14 08:20:15 +0100
commitfe312ffbe153a3ce16264d68f19bdb164ed57a5c (patch)
treea322c38489f291df2c71ea9db78dcfd4f8c767c2 /example/Makefile.in
parentda5208ee68c1281095e62abb820780fbe7b29bdc (diff)
Compile libndpireader
Diffstat (limited to 'example/Makefile.in')
-rw-r--r--example/Makefile.in10
1 files changed, 8 insertions, 2 deletions
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 $@