Makefile revision a633eec7
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
14TLDK_ROOT := $(CURDIR)
15export TLDK_ROOT
16
17DPDK_VERSION=16.04
18LOCAL_RTE_SDK=$(TLDK_ROOT)/dpdk/_build/dpdk-$(DPDK_VERSION)/
19
20ifeq ($(RTE_SDK),)
21	export RTE_SDK=$(LOCAL_RTE_SDK)
22endif
23
24# Default target, can be overriden by command line or environment
25RTE_TARGET ?= x86_64-native-linuxapp-gcc
26
27DIRS-y += lib
28DIRS-y += examples
29DIRS-y += test
30
31MAKEFLAGS += --no-print-directory
32
33# output directory
34O ?= $(TLDK_ROOT)/${RTE_TARGET}
35BASE_OUTPUT ?= $(abspath $(O))
36
37.PHONY: all
38all: $(DIRS-y)
39
40.PHONY: clean
41clean: $(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:
56ifeq ($(RTE_SDK),$(LOCAL_RTE_SDK)) 
57	@make RTE_TARGET=$(RTE_TARGET) config all -C $(TLDK_ROOT)/dpdk/
58endif
59
60