fix segfault on input packets with invalid checksum
[tldk.git] / Makefile
1 # Copyright (c) 2016 Intel Corporation.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 TLDK_ROOT := $(CURDIR)
15 export TLDK_ROOT
16
17 DPDK_VERSION=16.04
18 LOCAL_RTE_SDK=$(TLDK_ROOT)/dpdk/_build/dpdk-$(DPDK_VERSION)/
19
20 ifeq ($(RTE_SDK),)
21         export RTE_SDK=$(LOCAL_RTE_SDK)
22 endif
23
24 # Default target, can be overriden by command line or environment
25 RTE_TARGET ?= x86_64-native-linuxapp-gcc
26
27 DIRS-y += lib
28 DIRS-y += examples
29 DIRS-y += test
30
31 MAKEFLAGS += --no-print-directory
32
33 # output directory
34 O ?= $(TLDK_ROOT)/${RTE_TARGET}
35 BASE_OUTPUT ?= $(abspath $(O))
36
37 .PHONY: all
38 all: $(DIRS-y)
39
40 .PHONY: clean
41 clean: $(DIRS-y)
42
43 .PHONY: $(DIRS-y)
44 $(DIRS-y): $(RTE_SDK)/mk/rte.vars.mk
45         @echo "== $@"
46         $(Q)$(MAKE) -C $(@) \
47                 M=$(CURDIR)/$(@)/Makefile \
48                 O=$(BASE_OUTPUT) \
49                 BASE_OUTPUT=$(BASE_OUTPUT) \
50                 CUR_SUBDIR=$(CUR_SUBDIR)/$(@) \
51                 S=$(CURDIR)/$(@) \
52                 RTE_TARGET=$(RTE_TARGET) \
53                 $(filter-out $(DIRS-y),$(MAKECMDGOALS))
54
55 $(RTE_SDK)/mk/rte.vars.mk:
56 ifeq ($(RTE_SDK),$(LOCAL_RTE_SDK)) 
57         @make RTE_TARGET=$(RTE_TARGET) config all -C $(TLDK_ROOT)/dpdk/
58 endif
59