X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fvmdq%2FMakefile;h=8edda6cd636957317eb131fea4fdae443f0872bf;hb=309b553c26fa1820d6a38272d8b3e2a2e54ca082;hp=dc1bc82d06f8ee57db77c9f045443328303ce60f;hpb=ca9268529d2be1764054591ad57a7aac008e16b4;p=dpdk.git diff --git a/examples/vmdq/Makefile b/examples/vmdq/Makefile index dc1bc82d06..8edda6cd63 100644 --- a/examples/vmdq/Makefile +++ b/examples/vmdq/Makefile @@ -8,8 +8,9 @@ APP = vmdq_app SRCS-y := main.c # Build using pkg-config variables if possible -$(shell pkg-config --exists libdpdk) -ifeq ($(.SHELLSTATUS),0) +ifneq ($(shell pkg-config --exists libdpdk && echo 0),0) +$(error "no installation of DPDK found") +endif all: shared .PHONY: shared static @@ -18,12 +19,22 @@ shared: build/$(APP)-shared static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PKGCONF=pkg-config --define-prefix +PKGCONF ?= pkg-config -PC_FILE := $(shell $(PKGCONF) --path libdpdk) +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --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 += -DALLOW_EXPERIMENTAL_API build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) @@ -38,21 +49,3 @@ build: clean: rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared test -d build && rmdir -p build || true - -else # Build using legacy build system - -ifeq ($(RTE_SDK),) -$(error "Please define RTE_SDK environment variable") -endif - -# Default target, detect a build directory, by looking for a path with a .config -RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.config))))) - -include $(RTE_SDK)/mk/rte.vars.mk - -CFLAGS += $(WERROR_FLAGS) - -EXTRA_CFLAGS += -O3 - -include $(RTE_SDK)/mk/rte.extapp.mk -endif