X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fpipeline%2FMakefile;h=c19df3a48921369dc579a46750ccbe497bbd0ca1;hb=f8d541da5184c91fdec24f1b4713e79e0f837bde;hp=097847b37fe064275a56d905339e9b10bcc3f858;hpb=5f657a7fbe8697b3c36fb2987824e803f1a6cb02;p=dpdk.git diff --git a/examples/pipeline/Makefile b/examples/pipeline/Makefile index 097847b37f..c19df3a489 100644 --- a/examples/pipeline/Makefile +++ b/examples/pipeline/Makefile @@ -5,13 +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 @@ -22,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))