xref: /dpdk/examples/ip_fragmentation/Makefile (revision 22119c45)
1# SPDX-License-Identifier: BSD-3-Clause
2# Copyright(c) 2010-2014 Intel Corporation
3#
4
5# binary name
6APP = ip_fragmentation
7
8# all source are stored in SRCS-y
9SRCS-y := main.c
10
11# Build using pkg-config variables if possible
12$(shell pkg-config --exists libdpdk)
13ifeq ($(.SHELLSTATUS),0)
14
15PC_FILE := $(shell pkg-config --path libdpdk)
16CFLAGS += $(shell pkg-config --cflags libdpdk)
17LDFLAGS += $(shell pkg-config --libs libdpdk)
18
19build/$(APP): $(SRCS-y) Makefile $(PC_FILE) | build
20	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS)
21
22build:
23	@mkdir -p $@
24
25.PHONY: clean
26clean:
27	rm -f build/$(APP)
28	rmdir --ignore-fail-on-non-empty build
29
30else
31
32ifeq ($(RTE_SDK),)
33$(error "Please define RTE_SDK environment variable")
34endif
35
36# Default target, can be overridden by command line or environment
37RTE_TARGET ?= x86_64-native-linuxapp-gcc
38
39include $(RTE_SDK)/mk/rte.vars.mk
40
41CFLAGS += -O3
42CFLAGS += $(WERROR_FLAGS)
43
44# workaround for a gcc bug with noreturn attribute
45# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
46ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
47CFLAGS_main.o += -Wno-return-type
48endif
49
50include $(RTE_SDK)/mk/rte.extapp.mk
51
52endif
53