Skip to content

Commit

Permalink
examples: fix pkg-config override
Browse files Browse the repository at this point in the history
[ upstream commit 11e0270 ]

Move pkg-config override to beginning in the Makefile to allow
use PKGCONF variable to detect the libdpdk availability.

Fixes: fda3468 ("examples: remove legacy sections of makefiles")

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  • Loading branch information
jerinjacobk authored and steevenlee committed Jun 8, 2021
1 parent 8ff5598 commit 10ddae7
Show file tree
Hide file tree
Showing 57 changed files with 171 additions and 170 deletions.
6 changes: 3 additions & 3 deletions examples/bbdev_app/Makefile
Expand Up @@ -7,8 +7,10 @@ APP = bbdev
# all source are stored in SRCS-y
SRCS-y := main.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

Expand All @@ -19,8 +21,6 @@ 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)
Expand Down
6 changes: 3 additions & 3 deletions examples/bond/Makefile
Expand Up @@ -7,8 +7,10 @@ APP = bond_app
# all source are stored in SRCS-y
SRCS-y := main.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

Expand All @@ -21,8 +23,6 @@ static: build/$(APP)-static

LDFLAGS += -lrte_net_bond

PKGCONF ?= pkg-config

PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
Expand Down
6 changes: 3 additions & 3 deletions examples/cmdline/Makefile
Expand Up @@ -7,8 +7,10 @@ APP = cmdline
# all source are stored in SRCS-y
SRCS-y := main.c commands.c parse_obj_list.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

Expand All @@ -19,8 +21,6 @@ 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)
Expand Down
6 changes: 3 additions & 3 deletions examples/distributor/Makefile
Expand Up @@ -7,8 +7,10 @@ APP = distributor_app
# all source are stored in SRCS-y
SRCS-y := main.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

Expand All @@ -19,8 +21,6 @@ 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)
Expand Down
6 changes: 3 additions & 3 deletions examples/ethtool/ethtool-app/Makefile
Expand Up @@ -12,8 +12,10 @@ LDFLAGS += -L../lib/build
LDFLAGS_STATIC = -l:librte_ethtool.a
LDFLAGS_SHARED = -lrte_ethtool

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

Expand All @@ -24,8 +26,6 @@ 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)
Expand Down
6 changes: 3 additions & 3 deletions examples/ethtool/lib/Makefile
Expand Up @@ -2,15 +2,15 @@
# Copyright(c) 2015-2020 Intel Corporation


ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
PKGCONF ?= pkg-config

ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
$(error "no installation of DPDK found")
endif
ifneq ($(shell uname),Linux)
$(error This application can only operate in a linux environment)
endif

PKGCONF ?= pkg-config

# library name
LIB = librte_ethtool.so
LIB_STATIC = librte_ethtool.a
Expand Down
6 changes: 3 additions & 3 deletions examples/eventdev_pipeline/Makefile
Expand Up @@ -9,8 +9,10 @@ SRCS-y := main.c
SRCS-y += pipeline_worker_generic.c
SRCS-y += pipeline_worker_tx.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

Expand All @@ -21,8 +23,6 @@ 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)
Expand Down
6 changes: 3 additions & 3 deletions examples/fips_validation/Makefile
Expand Up @@ -17,8 +17,10 @@ SRCS-y += fips_dev_self_test.c
SRCS-y += fips_validation_xts.c
SRCS-y += main.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

Expand All @@ -29,8 +31,6 @@ 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)
Expand Down
6 changes: 3 additions & 3 deletions examples/flow_classify/Makefile
Expand Up @@ -7,8 +7,10 @@ APP = flow_classify
# all source are stored in SRCS-y
SRCS-y := flow_classify.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

Expand All @@ -19,8 +21,6 @@ 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)
Expand Down
6 changes: 3 additions & 3 deletions examples/flow_filtering/Makefile
Expand Up @@ -5,8 +5,10 @@ APP = flow

SRCS-y := main.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

Expand All @@ -17,8 +19,6 @@ 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)
Expand Down
6 changes: 3 additions & 3 deletions examples/helloworld/Makefile
Expand Up @@ -7,8 +7,10 @@ APP = helloworld
# all source are stored in SRCS-y
SRCS-y := main.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

Expand All @@ -19,8 +21,6 @@ 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)
Expand Down
6 changes: 3 additions & 3 deletions examples/ioat/Makefile
Expand Up @@ -7,8 +7,10 @@ APP = ioatfwd
# all source are stored in SRCS-y
SRCS-y := ioatfwd.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

Expand All @@ -19,8 +21,6 @@ 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)
Expand Down
6 changes: 3 additions & 3 deletions examples/ip_fragmentation/Makefile
Expand Up @@ -8,8 +8,10 @@ APP = ip_fragmentation
# all source are stored in SRCS-y
SRCS-y := main.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

Expand All @@ -20,8 +22,6 @@ 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)
CFLAGS += -DALLOW_EXPERIMENTAL_API
Expand Down
6 changes: 3 additions & 3 deletions examples/ip_pipeline/Makefile
Expand Up @@ -20,8 +20,10 @@ SRCS-y += thread.c
SRCS-y += tmgr.c
SRCS-y += cryptodev.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

Expand All @@ -32,8 +34,6 @@ 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)
Expand Down
6 changes: 3 additions & 3 deletions examples/ip_reassembly/Makefile
Expand Up @@ -8,8 +8,10 @@ APP = ip_reassembly
# all source are stored in SRCS-y
SRCS-y := main.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

Expand All @@ -20,8 +22,6 @@ 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)
Expand Down
6 changes: 3 additions & 3 deletions examples/ipsec-secgw/Makefile
Expand Up @@ -22,8 +22,10 @@ SRCS-y += flow.c

CFLAGS += -gdwarf-2

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

Expand All @@ -34,8 +36,6 @@ 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)
Expand Down
6 changes: 3 additions & 3 deletions examples/ipv4_multicast/Makefile
Expand Up @@ -8,8 +8,10 @@ APP = ipv4_multicast
# all source are stored in SRCS-y
SRCS-y := main.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

Expand All @@ -20,8 +22,6 @@ 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)
Expand Down
6 changes: 3 additions & 3 deletions examples/kni/Makefile
Expand Up @@ -7,8 +7,10 @@ APP = kni
# all source are stored in SRCS-y
SRCS-y := main.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

Expand All @@ -19,8 +21,6 @@ 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)
CFLAGS += -DALLOW_EXPERIMENTAL_API
Expand Down
6 changes: 3 additions & 3 deletions examples/l2fwd-cat/Makefile
Expand Up @@ -7,8 +7,10 @@ APP = l2fwd-cat
# all source are stored in SRCS-y
SRCS-y := l2fwd-cat.c cat.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

Expand All @@ -19,8 +21,6 @@ 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)
Expand Down

0 comments on commit 10ddae7

Please sign in to comment.