16d239dd5SPavan Nikhilesh# SPDX-License-Identifier: BSD-3-Clause 26d239dd5SPavan Nikhilesh# Copyright(c) 2016-2017 Intel Corporation 36d239dd5SPavan Nikhilesh 40eba4adeSBruce Richardson# binary name 50eba4adeSBruce RichardsonAPP = eventdev_pipeline 60eba4adeSBruce Richardson 70eba4adeSBruce Richardson# all source are stored in SRCS-y 80eba4adeSBruce RichardsonSRCS-y := main.c 90eba4adeSBruce RichardsonSRCS-y += pipeline_worker_generic.c 100eba4adeSBruce RichardsonSRCS-y += pipeline_worker_tx.c 110eba4adeSBruce Richardson 1222119c45SBruce Richardson# Build using pkg-config variables if possible 134131ad5dSBruce Richardsonifeq ($(shell pkg-config --exists libdpdk && echo 0),0) 1422119c45SBruce Richardson 151842d194SBruce Richardsonall: shared 161842d194SBruce Richardson.PHONY: shared static 171842d194SBruce Richardsonshared: build/$(APP)-shared 181842d194SBruce Richardson ln -sf $(APP)-shared build/$(APP) 191842d194SBruce Richardsonstatic: build/$(APP)-static 201842d194SBruce Richardson ln -sf $(APP)-static build/$(APP) 211842d194SBruce Richardson 22*12a652a0SBruce RichardsonPKGCONF ?= pkg-config 23ca926852SBruce Richardson 24ca926852SBruce RichardsonPC_FILE := $(shell $(PKGCONF) --path libdpdk) 25ca926852SBruce RichardsonCFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) 26ca926852SBruce RichardsonLDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) 27ca926852SBruce RichardsonLDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) 2822119c45SBruce Richardson 291842d194SBruce Richardsonbuild/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build 301842d194SBruce Richardson $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) 311842d194SBruce Richardson 321842d194SBruce Richardsonbuild/$(APP)-static: $(SRCS-y) Makefile $(PC_FILE) | build 331842d194SBruce Richardson $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC) 3422119c45SBruce Richardson 3522119c45SBruce Richardsonbuild: 3622119c45SBruce Richardson @mkdir -p $@ 3722119c45SBruce Richardson 3822119c45SBruce Richardson.PHONY: clean 3922119c45SBruce Richardsonclean: 401842d194SBruce Richardson rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared 417e9562a1SBruce Richardson test -d build && rmdir -p build || true 4222119c45SBruce Richardson 4322119c45SBruce Richardsonelse 4422119c45SBruce Richardson 456d239dd5SPavan Nikhileshifeq ($(RTE_SDK),) 466d239dd5SPavan Nikhilesh$(error "Please define RTE_SDK environment variable") 476d239dd5SPavan Nikhileshendif 486d239dd5SPavan Nikhilesh 49e9c65942SBruce Richardson# Default target, detect a build directory, by looking for a path with a .config 50e9c65942SBruce RichardsonRTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.config))))) 516d239dd5SPavan Nikhilesh 526d239dd5SPavan Nikhileshinclude $(RTE_SDK)/mk/rte.vars.mk 536d239dd5SPavan Nikhilesh 54a6ec3159SNeil HormanCFLAGS += -DALLOW_EXPERIMENTAL_API 556d239dd5SPavan NikhileshCFLAGS += -O3 566d239dd5SPavan NikhileshCFLAGS += $(WERROR_FLAGS) 576d239dd5SPavan Nikhilesh 586d239dd5SPavan Nikhileshinclude $(RTE_SDK)/mk/rte.extapp.mk 5922119c45SBruce Richardson 6022119c45SBruce Richardsonendif 61