2012-09-04 12:54:00 +00:00
|
|
|
# BSD LICENSE
|
2014-06-03 23:42:50 +00:00
|
|
|
#
|
2014-02-10 11:46:50 +00:00
|
|
|
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
|
2015-12-01 11:47:48 +00:00
|
|
|
# Copyright 2015 6WIND S.A.
|
2012-09-04 12:54:00 +00:00
|
|
|
# All rights reserved.
|
2014-06-03 23:42:50 +00:00
|
|
|
#
|
2013-09-18 10:00:00 +00:00
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
2012-09-04 12:54:00 +00:00
|
|
|
# are met:
|
2014-06-03 23:42:50 +00:00
|
|
|
#
|
2013-09-18 10:00:00 +00:00
|
|
|
# * Redistributions of source code must retain the above copyright
|
2012-09-04 12:54:00 +00:00
|
|
|
# notice, this list of conditions and the following disclaimer.
|
2013-09-18 10:00:00 +00:00
|
|
|
# * Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in
|
|
|
|
# the documentation and/or other materials provided with the
|
2012-09-04 12:54:00 +00:00
|
|
|
# distribution.
|
2013-09-18 10:00:00 +00:00
|
|
|
# * Neither the name of Intel Corporation nor the names of its
|
|
|
|
# contributors may be used to endorse or promote products derived
|
2012-09-04 12:54:00 +00:00
|
|
|
# from this software without specific prior written permission.
|
2014-06-03 23:42:50 +00:00
|
|
|
#
|
2013-09-18 10:00:00 +00:00
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
2012-09-04 12:54:00 +00:00
|
|
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
2015-12-01 07:36:00 +00:00
|
|
|
# Configuration, compilation and installation can be done at once
|
|
|
|
# with make install T=<config>
|
2012-09-04 12:54:00 +00:00
|
|
|
|
2015-12-01 14:04:01 +00:00
|
|
|
ifdef T # config, build and install combined
|
2015-12-01 07:36:00 +00:00
|
|
|
# The build directory is T and may be prepended with O
|
|
|
|
O ?= .
|
|
|
|
RTE_OUTPUT := $O/$T
|
2015-12-01 14:04:01 +00:00
|
|
|
else # standard install
|
|
|
|
# Build directory is given with O=
|
|
|
|
O ?= build
|
|
|
|
RTE_OUTPUT := $O
|
|
|
|
endif
|
2012-09-04 12:54:00 +00:00
|
|
|
|
2015-12-01 22:37:52 +00:00
|
|
|
ifneq ($(MAKECMDGOALS),pre_install)
|
|
|
|
include $(RTE_SDK)/mk/rte.vars.mk
|
|
|
|
endif
|
|
|
|
|
2015-12-01 14:04:01 +00:00
|
|
|
ifdef T # defaults with T= will install an almost flat staging tree
|
|
|
|
export prefix ?=
|
2015-12-01 22:37:52 +00:00
|
|
|
kerneldir ?= $(prefix)/kmod
|
|
|
|
else
|
|
|
|
ifeq ($(RTE_EXEC_ENV),linuxapp)
|
|
|
|
kerneldir ?= /lib/modules/$(shell uname -r)/extra/dpdk
|
2015-12-01 14:04:01 +00:00
|
|
|
else
|
2015-12-01 22:37:52 +00:00
|
|
|
kerneldir ?= /boot/modules
|
|
|
|
endif
|
2015-12-01 11:47:48 +00:00
|
|
|
prefix ?= /usr/local
|
2015-12-01 14:04:01 +00:00
|
|
|
endif
|
2015-12-01 11:47:48 +00:00
|
|
|
exec_prefix ?= $(prefix)
|
|
|
|
bindir ?= $(exec_prefix)/bin
|
2015-12-01 22:59:18 +00:00
|
|
|
sbindir ?= $(exec_prefix)/sbin
|
2015-12-01 11:47:48 +00:00
|
|
|
libdir ?= $(exec_prefix)/lib
|
|
|
|
includedir ?= $(prefix)/include/dpdk
|
|
|
|
datarootdir ?= $(prefix)/share
|
2015-12-01 22:59:26 +00:00
|
|
|
docdir ?= $(datarootdir)/doc/dpdk
|
2015-12-01 11:47:48 +00:00
|
|
|
datadir ?= $(datarootdir)/dpdk
|
|
|
|
sdkdir ?= $(datadir)
|
|
|
|
targetdir ?= $(datadir)/$(RTE_TARGET)
|
|
|
|
|
|
|
|
# The install directories may be staged in DESTDIR
|
|
|
|
|
|
|
|
# Create the directory $1 if not exists
|
|
|
|
rte_mkdir = test -d $1 || mkdir -p $1
|
|
|
|
|
|
|
|
# Create the relative symbolic link $2 -> $1
|
|
|
|
# May be replaced with --relative option of ln from coreutils-8.16
|
|
|
|
rte_symlink = ln -snf $$($(RTE_SDK)/scripts/relpath.sh $1 $(dir $2)) $2
|
|
|
|
|
2015-12-01 08:27:37 +00:00
|
|
|
.PHONY: pre_install
|
|
|
|
pre_install:
|
2015-12-01 14:04:01 +00:00
|
|
|
ifdef T
|
2015-12-01 07:36:00 +00:00
|
|
|
$(Q)if [ ! -f $(RTE_OUTPUT)/.config ]; then \
|
|
|
|
$(MAKE) config O=$(RTE_OUTPUT); \
|
|
|
|
elif cmp -s $(RTE_OUTPUT)/.config.orig $(RTE_OUTPUT)/.config; then \
|
|
|
|
$(MAKE) config O=$(RTE_OUTPUT); \
|
mk: allow updates to build config on make install
When running "make config", an additional config.orig file is also
generated, which is intended to hold the original, clean configuration
from the template.
When running make install, we first check if there is no existing
.config file, and run make config if not. If there is a file, we then
check if it's unmodified, in which case we regenerate a new .config to
take account of any possible updates to the template. Finally, in the
case where there is an existing .config file, and it HAS been modified,
we then do a check to see if the template has had further updates, and
throw an error if so. If no updates, we continue with the build using
the existing, user-modified config.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
2014-05-14 15:55:10 +00:00
|
|
|
else \
|
2015-12-01 07:36:00 +00:00
|
|
|
if [ -f $(RTE_OUTPUT)/.config.orig ] ; then \
|
|
|
|
tmp_build=$(RTE_OUTPUT)/.config.tmp; \
|
|
|
|
$(MAKE) config O=$$tmp_build; \
|
|
|
|
if ! cmp -s $(RTE_OUTPUT)/.config.orig $$tmp_build/.config ; then \
|
mk: allow updates to build config on make install
When running "make config", an additional config.orig file is also
generated, which is intended to hold the original, clean configuration
from the template.
When running make install, we first check if there is no existing
.config file, and run make config if not. If there is a file, we then
check if it's unmodified, in which case we regenerate a new .config to
take account of any possible updates to the template. Finally, in the
case where there is an existing .config file, and it HAS been modified,
we then do a check to see if the template has had further updates, and
throw an error if so. If no updates, we continue with the build using
the existing, user-modified config.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
2014-05-14 15:55:10 +00:00
|
|
|
echo "Conflict: local config and template config have both changed"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
|
|
|
echo "Using local configuration"; \
|
2013-01-30 15:30:19 +00:00
|
|
|
fi
|
2015-12-01 07:36:00 +00:00
|
|
|
$(Q)$(MAKE) all O=$(RTE_OUTPUT)
|
2015-12-01 14:04:01 +00:00
|
|
|
endif
|
2015-12-01 08:27:37 +00:00
|
|
|
|
|
|
|
.PHONY: install
|
|
|
|
install:
|
2015-12-01 11:47:48 +00:00
|
|
|
ifeq ($(DESTDIR)$(if $T,,+),)
|
|
|
|
@echo Installation cannot run with T defined and DESTDIR undefined
|
|
|
|
else
|
|
|
|
@echo ================== Installing $(DESTDIR)$(prefix)/
|
2015-12-01 22:29:48 +00:00
|
|
|
$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-runtime
|
2015-12-01 22:37:52 +00:00
|
|
|
$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-kmod
|
2015-12-01 22:29:48 +00:00
|
|
|
$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-sdk
|
2015-12-01 22:59:26 +00:00
|
|
|
$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-doc
|
2015-12-01 22:29:48 +00:00
|
|
|
@echo Installation in $(DESTDIR)$(prefix)/ complete
|
|
|
|
endif
|
|
|
|
|
|
|
|
install-runtime:
|
2015-12-01 11:47:48 +00:00
|
|
|
$(Q)$(call rte_mkdir, $(DESTDIR)$(libdir))
|
2015-12-01 22:29:48 +00:00
|
|
|
$(Q)cp -a $O/lib/* $(DESTDIR)$(libdir)
|
2015-12-01 11:47:48 +00:00
|
|
|
$(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
|
2015-12-01 22:29:48 +00:00
|
|
|
$(Q)tar -cf - -C $O app --exclude 'app/*.map' \
|
2015-12-01 11:47:48 +00:00
|
|
|
--exclude 'app/cmdline*' --exclude app/test \
|
|
|
|
--exclude app/testacl --exclude app/testpipeline | \
|
|
|
|
tar -xf - -C $(DESTDIR)$(bindir) --strip-components=1 \
|
|
|
|
--keep-newer-files --warning=no-ignore-newer
|
|
|
|
$(Q)$(call rte_mkdir, $(DESTDIR)$(datadir))
|
|
|
|
$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
|
2015-12-01 22:59:18 +00:00
|
|
|
$(Q)$(call rte_mkdir, $(DESTDIR)$(sbindir))
|
|
|
|
$(Q)$(call rte_symlink, $(DESTDIR)$(datadir)/tools/dpdk_nic_bind.py, \
|
|
|
|
$(DESTDIR)$(sbindir)/dpdk_nic_bind)
|
2015-12-01 22:29:48 +00:00
|
|
|
|
2015-12-01 22:37:52 +00:00
|
|
|
install-kmod:
|
|
|
|
ifneq ($(wildcard $O/kmod/*),)
|
|
|
|
$(Q)$(call rte_mkdir, $(DESTDIR)$(kerneldir))
|
|
|
|
$(Q)cp -a $O/kmod/* $(DESTDIR)$(kerneldir)
|
|
|
|
endif
|
|
|
|
|
2015-12-01 22:29:48 +00:00
|
|
|
install-sdk:
|
2015-12-01 11:47:48 +00:00
|
|
|
$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
|
2015-12-01 22:29:48 +00:00
|
|
|
$(Q)tar -chf - -C $O include | \
|
2015-12-01 11:47:48 +00:00
|
|
|
tar -xf - -C $(DESTDIR)$(includedir) --strip-components=1 \
|
|
|
|
--keep-newer-files --warning=no-ignore-newer
|
|
|
|
$(Q)$(call rte_mkdir, $(DESTDIR)$(sdkdir))
|
2015-12-09 07:58:11 +00:00
|
|
|
$(Q)cp -a $(RTE_SDK)/mk $(DESTDIR)$(sdkdir)
|
|
|
|
$(Q)cp -a $(RTE_SDK)/scripts $(DESTDIR)$(sdkdir)
|
2015-12-01 11:47:48 +00:00
|
|
|
$(Q)$(call rte_mkdir, $(DESTDIR)$(targetdir))
|
2015-12-01 22:29:48 +00:00
|
|
|
$(Q)cp -a $O/.config $(DESTDIR)$(targetdir)
|
2015-12-01 11:47:48 +00:00
|
|
|
$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include)
|
|
|
|
$(Q)$(call rte_symlink, $(DESTDIR)$(libdir), $(DESTDIR)$(targetdir)/lib)
|
2015-12-01 22:59:26 +00:00
|
|
|
|
|
|
|
install-doc:
|
|
|
|
ifneq ($(wildcard $O/doc),)
|
|
|
|
$(Q)$(call rte_mkdir, $(DESTDIR)$(docdir))
|
|
|
|
$(Q)tar -cf - -C $O/doc html --exclude 'html/guides/.*' | \
|
|
|
|
tar -xf - -C $(DESTDIR)$(docdir) --strip-components=1 \
|
|
|
|
--keep-newer-files --warning=no-ignore-newer
|
|
|
|
endif
|
|
|
|
ifneq ($(wildcard $O/doc/*/*/*pdf),)
|
|
|
|
$(Q)$(call rte_mkdir, $(DESTDIR)$(docdir)/guides)
|
|
|
|
$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
|
|
|
|
endif
|
2015-12-01 23:11:28 +00:00
|
|
|
$(Q)cp -a $(RTE_SDK)/examples $(DESTDIR)$(datadir)
|