From ea7e7c753b20bfdb4edd97499362a3a331631e04 Mon Sep 17 00:00:00 2001 From: Vitaliy Ivanov Date: Wed, 28 Nov 2018 16:40:34 +0200 Subject: build: correct example dpdk linking with pcap. - take libpcap from configure information. - clean up distclean. Signed-off-by: Vitaliy Ivanov --- example/Makefile.dpdk.in | 4 ++-- example/Makefile.in | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'example') diff --git a/example/Makefile.dpdk.in b/example/Makefile.dpdk.in index 8519d7d0e..d96975483 100644 --- a/example/Makefile.dpdk.in +++ b/example/Makefile.dpdk.in @@ -14,14 +14,14 @@ RTE_TARGET ?= x86_64-native-linuxapp-gcc include $(RTE_SDK)/mk/rte.vars.mk -APP = ndpiReader +APP = ndpiReader.dpdk LIBNDPI = $(PWD)/../src/lib/libndpi.a SRCS-y := ndpi_util.c ndpiReader.c CFLAGS += -g CFLAGS += -Wno-strict-prototypes -Wno-missing-prototypes -Wno-missing-declarations -Wno-unused-parameter -I $(PWD)/../src/include @CFLAGS@ -DUSE_DPDK -LDLIBS = $(LIBNDPI) -lpthread @LDFLAGS@ +LDLIBS = $(LIBNDPI) @PCAP_LIB@ -lpthread @LDFLAGS@ include $(RTE_SDK)/mk/rte.extapp.mk diff --git a/example/Makefile.in b/example/Makefile.in index 3e0f25d91..84f3f3623 100644 --- a/example/Makefile.in +++ b/example/Makefile.in @@ -1,7 +1,7 @@ CC=@CC@ CFLAGS=-g -I../src/include @CFLAGS@ LIBNDPI=../src/lib/libndpi.a -LDFLAGS=$(LIBNDPI) -lpcap -lpthread @LDFLAGS@ +LDFLAGS=$(LIBNDPI) @PCAP_LIB@ -lpthread @LDFLAGS@ OBJS=ndpiReader.o ndpi_util.o PREFIX?=/usr/local @@ -21,4 +21,8 @@ dpdk: clean: /bin/rm -f *.o ndpiReader + /bin/rm -rf build +distclean: clean + /bin/rm -f Makefile.dpdk + /bin/rm -f Makefile -- cgit v1.2.3 From 8df6b5c1bf453939a2d84cfa76b46dff6a3a6a42 Mon Sep 17 00:00:00 2001 From: Vitaliy Ivanov Date: Wed, 28 Nov 2018 17:39:14 +0200 Subject: build: install example binaries to dst dir. make install DESTDIR=/build/nDPI/ Signed-off-by: Vitaliy Ivanov --- example/Makefile.in | 2 ++ 1 file changed, 2 insertions(+) (limited to 'example') diff --git a/example/Makefile.in b/example/Makefile.in index 84f3f3623..96be6eacf 100644 --- a/example/Makefile.in +++ b/example/Makefile.in @@ -14,7 +14,9 @@ ndpiReader: $(OBJS) $(LIBNDPI) $(CC) $(CFLAGS) -c $< -o $@ install: ndpiReader + mkdir -p $(DESTDIR)$(PREFIX)/bin/ cp ndpiReader $(DESTDIR)$(PREFIX)/bin/ + [ -f build/app/ndpiReader.dpdk ] && cp build/app/ndpiReader.dpdk $(DESTDIR)$(PREFIX)/bin/ dpdk: make -f Makefile.dpdk -- cgit v1.2.3 From a3abbc3ebb851c7316b6694efc5036d40324d103 Mon Sep 17 00:00:00 2001 From: Vitaliy Ivanov Date: Wed, 28 Nov 2018 19:23:27 +0200 Subject: build: do not fail if example app is not present. Signed-off-by: Vitaliy Ivanov --- example/Makefile.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'example') diff --git a/example/Makefile.in b/example/Makefile.in index 96be6eacf..050cac8e1 100644 --- a/example/Makefile.in +++ b/example/Makefile.in @@ -16,7 +16,8 @@ ndpiReader: $(OBJS) $(LIBNDPI) install: ndpiReader mkdir -p $(DESTDIR)$(PREFIX)/bin/ cp ndpiReader $(DESTDIR)$(PREFIX)/bin/ - [ -f build/app/ndpiReader.dpdk ] && cp build/app/ndpiReader.dpdk $(DESTDIR)$(PREFIX)/bin/ + [ -f build/app/ndpiReader.dpdk ] && cp build/app/ndpiReader.dpdk $(DESTDIR)$(PREFIX)/bin/ || true + [ -f ndpiReader.dpdk ] && cp ndpiReader.dpdk $(DESTDIR)$(PREFIX)/bin/ || true dpdk: make -f Makefile.dpdk -- cgit v1.2.3