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