1 # makefile to manage dpdk package
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
20 # Aihua Li, Huawei Technologies.
22 include ../mk/master.mk
23 include ../package-list.mk
25 .PHONY: install force_make
28 TAG_DONE_FLAG = $(WORK_DIR)/.$(DPDK_TAG).tag.done
30 # the name has been changed from version to version
31 ifeq ($(DPDK_TAG),v1.6.0r0)
32 DPDK_TARGET = x86_64-default-linuxapp-gcc
33 CONFIG_FILE = $(WORK_DIR)/config/defconfig_x86_64-default-linuxapp-gcc
35 DPDK_TARGET = x86_64-native-linuxapp-gcc
36 CONFIG_FILE = $(WORK_DIR)/config/common_linuxapp
40 @echo "Finished making $(WORK_DIR) "
42 INSTALL_TARGET = force_make
44 force_make: $(TAG_DONE_FLAG)
45 $(AT)cd $(WORK_DIR); make config T=$(DPDK_TARGET) && make
48 install: $(INSTALL_TARGET)
49 $(AT)sudo cp -a $(WORK_DIR)/$(DPDK_TARGET)/kmod $(INSTALL_DIR)/lib/modules/$(KERNEL_VERSION)
52 # hard way to clean and clobber
55 $(AT)rm -rf $(WORK_DIR)
57 # cleanse is for developer who would like to keep the
58 # clone git repo, saving time to fetch again from url
60 $(AT)cd $(WORK_DIR) && git clean -xfd && git checkout -f
63 @echo "Make test in $(WORK_DIR) (stub) "
66 @echo "Make sanity in $(WORK_DIR) (stub) "
69 $(AT)git clone $(DPDK_URL)
71 $(TAG_DONE_FLAG): $(WORK_DIR)
72 $(AT)cd $(WORK_DIR); git checkout $(DPDK_TAG)
73 $(AT)sed -i 's/CONFIG_RTE_BUILD_COMBINE_LIBS=n/CONFIG_RTE_BUILD_COMBINE_LIBS=y/g' $(CONFIG_FILE)
74 $(AT)sed -i 's/CONFIG_RTE_LIBRTE_VHOST=n/CONFIG_RTE_LIBRTE_VHOST=y/g' $(CONFIG_FILE)
75 $(AT)sed -i 's/CONFIG_RTE_LIBRTE_KNI=y /CONFIG_RTE_LIBRTE_KNI=n/g' $(CONFIG_FILE)