13998e2a0SBruce Richardson# SPDX-License-Identifier: BSD-3-Clause 23998e2a0SBruce Richardson# Copyright(c) 2010-2014 Intel Corporation 3e107e82eSAnatoly Burakov# 4e107e82eSAnatoly Burakov 50eba4adeSBruce Richardson# binary name 60eba4adeSBruce RichardsonAPP = ip_fragmentation 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 1222119c45SBruce Richardson$(shell pkg-config --exists libdpdk) 1322119c45SBruce Richardsonifeq ($(.SHELLSTATUS),0) 1422119c45SBruce Richardson 15*1842d194SBruce Richardsonall: shared 16*1842d194SBruce Richardson.PHONY: shared static 17*1842d194SBruce Richardsonshared: build/$(APP)-shared 18*1842d194SBruce Richardson ln -sf $(APP)-shared build/$(APP) 19*1842d194SBruce Richardsonstatic: build/$(APP)-static 20*1842d194SBruce Richardson ln -sf $(APP)-static build/$(APP) 2122119c45SBruce Richardson 22*1842d194SBruce RichardsonPC_FILE := $(shell pkg-config --path libdpdk) 23*1842d194SBruce RichardsonCFLAGS += -O3 $(shell pkg-config --cflags libdpdk) 24*1842d194SBruce RichardsonLDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) 25*1842d194SBruce RichardsonLDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) 26*1842d194SBruce Richardson 27*1842d194SBruce Richardsonbuild/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build 28*1842d194SBruce Richardson $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) 29*1842d194SBruce Richardson 30*1842d194SBruce Richardsonbuild/$(APP)-static: $(SRCS-y) Makefile $(PC_FILE) | build 31*1842d194SBruce Richardson $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC) 3222119c45SBruce Richardson 3322119c45SBruce Richardsonbuild: 3422119c45SBruce Richardson @mkdir -p $@ 3522119c45SBruce Richardson 3622119c45SBruce Richardson.PHONY: clean 3722119c45SBruce Richardsonclean: 38*1842d194SBruce Richardson rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared 3922119c45SBruce Richardson rmdir --ignore-fail-on-non-empty build 4022119c45SBruce Richardson 4122119c45SBruce Richardsonelse 4222119c45SBruce Richardson 43e107e82eSAnatoly Burakovifeq ($(RTE_SDK),) 44e107e82eSAnatoly Burakov$(error "Please define RTE_SDK environment variable") 45e107e82eSAnatoly Burakovendif 46e107e82eSAnatoly Burakov 4798a7ea33SJerin Jacob# Default target, can be overridden by command line or environment 48e107e82eSAnatoly BurakovRTE_TARGET ?= x86_64-native-linuxapp-gcc 49e107e82eSAnatoly Burakov 50e107e82eSAnatoly Burakovinclude $(RTE_SDK)/mk/rte.vars.mk 51e107e82eSAnatoly Burakov 52e107e82eSAnatoly BurakovCFLAGS += -O3 53e107e82eSAnatoly BurakovCFLAGS += $(WERROR_FLAGS) 54e107e82eSAnatoly Burakov 55e107e82eSAnatoly Burakov# workaround for a gcc bug with noreturn attribute 56e107e82eSAnatoly Burakov# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603 57e107e82eSAnatoly Burakovifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) 58e107e82eSAnatoly BurakovCFLAGS_main.o += -Wno-return-type 59e107e82eSAnatoly Burakovendif 60e107e82eSAnatoly Burakov 61e107e82eSAnatoly Burakovinclude $(RTE_SDK)/mk/rte.extapp.mk 6222119c45SBruce Richardson 6322119c45SBruce Richardsonendif 64