13998e2a0SBruce Richardson# SPDX-License-Identifier: BSD-3-Clause 23998e2a0SBruce Richardson# Copyright(c) 2010-2014 Intel Corporation 3af75078fSIntel# 4af75078fSIntel 50eba4adeSBruce Richardson# binary name 60eba4adeSBruce RichardsonAPP = ipv4_multicast 70eba4adeSBruce Richardson 80eba4adeSBruce Richardson# all source are stored in SRCS-y 90eba4adeSBruce RichardsonSRCS-y := main.c 100eba4adeSBruce Richardson 1122119c45SBruce Richardson# Build using pkg-config variables if possible 12fda34680SCiara Powerifneq ($(shell pkg-config --exists libdpdk && echo 0),0) 13fda34680SCiara Power$(error "no installation of DPDK found") 14fda34680SCiara Powerendif 1522119c45SBruce Richardson 161842d194SBruce Richardsonall: shared 171842d194SBruce Richardson.PHONY: shared static 181842d194SBruce Richardsonshared: build/$(APP)-shared 191842d194SBruce Richardson ln -sf $(APP)-shared build/$(APP) 201842d194SBruce Richardsonstatic: build/$(APP)-static 211842d194SBruce Richardson ln -sf $(APP)-static build/$(APP) 2222119c45SBruce Richardson 2312a652a0SBruce RichardsonPKGCONF ?= pkg-config 24ca926852SBruce Richardson 2569b1bb49SBruce RichardsonPC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) 26ca926852SBruce RichardsonCFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) 27ca926852SBruce RichardsonLDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) 288549295dSBruce RichardsonLDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) 291842d194SBruce Richardson 30*bc8e3247SDavid MarchandCFLAGS += -DALLOW_EXPERIMENTAL_API 31*bc8e3247SDavid Marchand 321842d194SBruce Richardsonbuild/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build 331842d194SBruce Richardson $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) 341842d194SBruce Richardson 351842d194SBruce Richardsonbuild/$(APP)-static: $(SRCS-y) Makefile $(PC_FILE) | build 361842d194SBruce Richardson $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC) 3722119c45SBruce Richardson 3822119c45SBruce Richardsonbuild: 3922119c45SBruce Richardson @mkdir -p $@ 4022119c45SBruce Richardson 4122119c45SBruce Richardson.PHONY: clean 4222119c45SBruce Richardsonclean: 431842d194SBruce Richardson rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared 447e9562a1SBruce Richardson test -d build && rmdir -p build || true 45