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