aboutsummaryrefslogtreecommitdiffstats
path: root/build/external/packages
diff options
context:
space:
mode:
Diffstat (limited to 'build/external/packages')
-rw-r--r--build/external/packages/dpdk.mk60
-rw-r--r--build/external/packages/rdma-core.mk46
2 files changed, 74 insertions, 32 deletions
diff --git a/build/external/packages/dpdk.mk b/build/external/packages/dpdk.mk
index 68c27678931..ae9d9c5df95 100644
--- a/build/external/packages/dpdk.mk
+++ b/build/external/packages/dpdk.mk
@@ -167,9 +167,7 @@ define set
fi
endef
-all: build
-
-$(B)/custom-config: $(B)/.patch.ok Makefile
+$(B)/custom-config: $(B)/.dpdk-patch.ok Makefile
@echo --- generating custom config from $(DPDK_SOURCE)/config/defconfig_$(DPDK_TARGET) ---
@cpp -undef -ffreestanding -x assembler-with-cpp $(DPDK_SOURCE)/config/defconfig_$(DPDK_TARGET) $@
$(call set,RTE_MACHINE,$(DPDK_MACHINE))
@@ -230,18 +228,19 @@ $(B)/custom-config: $(B)/.patch.ok Makefile
$(call set,RTE_LIBRTE_DPAA_PMD,n)
$(call set,RTE_LIBRTE_PMD_DPAA_SEC,n)
$(call set,RTE_LIBRTE_PMD_DPAA_EVENTDEV,n)
- @rm -f .config.ok
+ @rm -f .dpdk-config.ok
+
+DPDK_DOWNLOADS = $(CURDIR)/downloads/$(DPDK_TARBALL)
-$(CURDIR)/$(DPDK_TARBALL):
+$(DPDK_DOWNLOADS):
+ mkdir -p downloads
@if [ -e $(DPDK_DOWNLOAD_DIR)/$(DPDK_TARBALL) ] ; \
- then cp $(DPDK_DOWNLOAD_DIR)/$(DPDK_TARBALL) $(CURDIR) ; \
- else curl -o $(CURDIR)/$(DPDK_TARBALL) -LO $(DPDK_TAR_URL) ; \
+ then cp $(DPDK_DOWNLOAD_DIR)/$(DPDK_TARBALL) $@ ; \
+ else curl -o $@ -LO $(DPDK_TAR_URL) ; \
fi
- @rm -f $(B)/.download.ok
+ @rm -f $(B)/.dpdk-download.ok
-DPDK_DOWNLOADS = $(CURDIR)/$(DPDK_TARBALL)
-
-$(B)/.download.ok: $(DPDK_DOWNLOADS)
+$(B)/.dpdk-download.ok: $(DPDK_DOWNLOADS)
@mkdir -p $(B)
@openssl md5 $< | cut -f 2 -d " " - > $(B)/$(DPDK_TARBALL).md5sum
@([ "$$(<$(B)/$(DPDK_TARBALL).md5sum)" = "$(DPDK_$(DPDK_VERSION)_TARBALL_MD5_CKSUM)" ] || \
@@ -249,18 +248,18 @@ $(B)/.download.ok: $(DPDK_DOWNLOADS)
rm $(B)/$(DPDK_TARBALL).md5sum && false ))
@touch $@
-.PHONY: download
-download: $(B)/.download.ok
+.PHONY: dpdk-download
+dpdk-download: $(B)/.dpdk-download.ok
-$(B)/.extract.ok: $(B)/.download.ok
+$(B)/.dpdk-extract.ok: $(B)/.dpdk-download.ok
@echo --- extracting $(DPDK_TARBALL) ---
- @tar --directory $(B) --extract --file $(CURDIR)/$(DPDK_TARBALL)
+ @tar --directory $(B) --extract --file $(DPDK_DOWNLOADS)
@touch $@
-.PHONY: extract
-extract: $(B)/.extract.ok
+.PHONY: dpdk-extract
+dpdk-extract: $(B)/.dpdk-extract.ok
-$(B)/.patch.ok: $(B)/.extract.ok
+$(B)/.dpdk-patch.ok: $(B)/.dpdk-extract.ok
ifneq ($(wildcard $(CURDIR)/patches/dpdk_$(DPDK_VERSION)/*.patch),)
@echo --- patching ---
@for f in $(CURDIR)/patches/dpdk_$(DPDK_VERSION)/*.patch ; do \
@@ -270,26 +269,23 @@ ifneq ($(wildcard $(CURDIR)/patches/dpdk_$(DPDK_VERSION)/*.patch),)
endif
@touch $@
-.PHONY: patch
-patch: $(B)/.patch.ok
+.PHONY: dpdk-patch
+dpdk-patch: $(B)/.dpdk-patch.ok
-$(B)/.config.ok: $(B)/.patch.ok $(B)/custom-config
+$(B)/.dpdk-config.ok: $(B)/.dpdk-patch.ok $(B)/custom-config
@make $(DPDK_MAKE_ARGS) config
@touch $@
-.PHONY: config
-config: $(B)/.config.ok
+.PHONY: dpdk-config
+dpdk-config: $(B)/.dpdk-config.ok
-.PHONY: build-dpdk
-build-dpdk: $(DPDK_BUILD_DEPS)
- @if [ ! -e $(B)/.config.ok ] ; then echo 'Please run "make config" first' && false ; fi
+$(B)/.dpdk-build.ok: dpdk-config $(DPDK_BUILD_DEPS)
+ @if [ ! -e $(B)/.dpdk-config.ok ] ; then echo 'Please run "make config" first' && false ; fi
@make $(DPDK_MAKE_ARGS) install
-
-$(B)/.build.ok: build-dpdk
@touch $@
-.PHONY: build
-build: $(B)/.build.ok
+.PHONY: dpdk-build
+dpdk-build: $(B)/.dpdk-build.ok
-.PHONY: install
-install: $(B)/.build.ok
+.PHONY: dpdk-install
+dpdk-install: $(B)/.dpdk-build.ok
diff --git a/build/external/packages/rdma-core.mk b/build/external/packages/rdma-core.mk
new file mode 100644
index 00000000000..0e8c878034e
--- /dev/null
+++ b/build/external/packages/rdma-core.mk
@@ -0,0 +1,46 @@
+# Copyright (c) 2018 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+rdma-core_version := 23
+rdma-core_tarball := rdma-core-$(rdma-core_version).tar.gz
+rdma-core_tarball_md5sum_22.1 := dde4d30e3db20893408ae51041117034
+rdma-core_tarball_md5sum_23 := c78575735c4a71609c1a214ea16cd8dc
+rdma-core_tarball_md5sum := $(rdma-core_tarball_md5sum_$(rdma-core_version))
+rdma-core_tarball_strip_dirs := 1
+rdma-core_url := http://github.com/linux-rdma/rdma-core/releases/download/v$(rdma-core_version)/$(rdma-core_tarball)
+
+RDMA_FILES := include/infiniband/verbs.h \
+ include/infiniband/verbs_api.h \
+ include/infiniband/ib_user_ioctl_verbs.h \
+ include/rdma/ib_user_verbs.h \
+ lib/statics/libibverbs.a \
+ lib/statics/libmlx5.a
+
+define rdma-core_config_cmds
+ cd $(rdma-core_build_dir) && \
+ cmake -G Ninja $(rdma-core_src_dir) \
+ -DENABLE_STATIC=1 -DENABLE_RESOLVE_NEIGH=0 -DNO_PYVERBS=1 -DENABLE_VALGRIND=0 \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_C_FLAGS=-fPIC > $(rdma-core_config_log)
+endef
+
+define rdma-core_build_cmds
+ cmake --build $(rdma-core_build_dir) -- libibverbs.a libmlx5.a > $(rdma-core_build_log)
+endef
+
+define rdma-core_install_cmds
+ mkdir -p $(rdma-core_install_dir)
+ tar -C $(rdma-core_build_dir) --xform='s|/statics/|/|' -hc $(RDMA_FILES) | tar -C $(rdma-core_install_dir) -xv > $(rdma-core_install_log)
+endef
+
+$(eval $(call package,rdma-core))