X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fpipeline%2FMakefile;h=c19df3a48921369dc579a46750ccbe497bbd0ca1;hb=ba8a263696bbe9e27a61cdbe36ae3a1f7b142329;hp=da2f4850b7065c37943e462515794d939fbcc8d4;hpb=b77f660028127061b05a8a14cc6c93becb9e73bb;p=dpdk.git diff --git a/examples/pipeline/Makefile b/examples/pipeline/Makefile index da2f4850b7..c19df3a489 100644 --- a/examples/pipeline/Makefile +++ b/examples/pipeline/Makefile @@ -5,12 +5,16 @@ APP = pipeline # all source are stored in SRCS-y +SRCS-y += cli.c +SRCS-y += conn.c SRCS-y += main.c SRCS-y += obj.c SRCS-y += thread.c +PKGCONF ?= pkg-config + # Build using pkg-config variables if possible -ifneq ($(shell pkg-config --exists libdpdk && echo 0),0) +ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0) $(error "no installation of DPDK found") endif @@ -21,13 +25,19 @@ shared: build/$(APP)-shared static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PKGCONF ?= pkg-config - PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) +ifeq ($(MAKECMDGOALS),static) +# check for broken pkg-config +ifeq ($(shell echo $(LDFLAGS_STATIC) | grep 'whole-archive.*l:lib.*no-whole-archive'),) +$(warning "pkg-config output list does not contain drivers between 'whole-archive'/'no-whole-archive' flags.") +$(error "Cannot generate statically-linked binaries with this version of pkg-config") +endif +endif + CFLAGS += -I. -DALLOW_EXPERIMENTAL_API -D_GNU_SOURCE OBJS := $(patsubst %.c,build/%.o,$(SRCS-y))