Commit 2e7fe8e8 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

build: add 'make install' rule



For now, this only installs libraries and headers; we will need to
consider which binaries should be installed and what they should be
named before we add them to the install rule.

Change-Id: I78dc8631f793d0df88cd884b0ac66406df9e4427
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/387637


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 09fec7f0
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
# Changelog

## v18.01
## v18.01: (Upcoming Release)

### Build System

The build system now includes a `make install` rule, including support for the common
`DESTDIR` and `prefix` variables as used in other build systems.  Additionally, the prefix
may be set via the configure `--prefix` option.  Example: `make install prefix=/usr`.

### RPC

+3 −0
Original line number Diff line number Diff line
@@ -31,6 +31,9 @@
#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

# Installation prefix
CONFIG_PREFIX?=/usr/local

# Build with debug logging. Turn off for performance testing and normal usage
CONFIG_DEBUG?=n

+4 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ S :=
SPDK_ROOT_DIR := $(CURDIR)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk

DIRS-y += lib test examples app
DIRS-y += lib test examples app include

.PHONY: all clean $(DIRS-y) config.h CONFIG.local mk/cc.mk

@@ -50,6 +50,9 @@ clean: $(DIRS-y)
	$(Q)rm -f mk/cc.mk
	$(Q)rm -f config.h

install: all
	$(Q)echo "Installed to $(DESTDIR)$(CONFIG_PREFIX)"

lib: $(DPDKBUILD)
app: lib
test: lib
+6 −0
Original line number Diff line number Diff line
@@ -74,6 +74,12 @@ if [ "$STAT1" == "$STAT2" ]; then
	exit 1
fi

# Test 'make install'
rm -rf /tmp/spdk
mkdir /tmp/spdk
$MAKE $MAKEFLAGS install DESTDIR=/tmp/spdk prefix=/usr
ls -lR /tmp/spdk
rm -rf /tmp/spdk

timing_enter doxygen
if [ $SPDK_BUILD_DOC -eq 1 ] && hash doxygen; then
+9 −0
Original line number Diff line number Diff line
@@ -12,6 +12,9 @@ function usage()
	echo ""
	echo "General:"
	echo " -h, --help                Display this help and exit"
	echo ""
	echo " --prefix=path             Configure installation prefix (default: /usr/local)"
	echo ""
	echo " --enable-debug            Configure for debug builds"
	echo " --enable-werror           Treat compiler warnings as errors"
	echo " --enable-asan             Enable address sanitizer"
@@ -50,6 +53,9 @@ for i in "$@"; do
			usage
			exit 0
			;;
		--prefix=*)
			CONFIG_PREFIX="${i#*=}"
			;;
		--enable-debug)
			CONFIG_DEBUG=y
			;;
@@ -199,6 +205,9 @@ echo -n "Creating CONFIG.local..."

# Write the configuration file
rm -f CONFIG.local
if [ -n "$CONFIG_PREFIX" ]; then
	echo "CONFIG_PREFIX?=$CONFIG_PREFIX" >> CONFIG.local
fi
if [ -n "$CONFIG_DEBUG" ]; then
	echo "CONFIG_DEBUG?=$CONFIG_DEBUG" >> CONFIG.local
fi
Loading