forked from linux-rdma/rdma-core
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a build.sh helper to allow for a one-stop build
This allows for a quick build instead of typing the whole mkdir, cd, cmake and ninja sequence. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
- Loading branch information
1 parent
32205ae
commit 9bf2db7
Showing
2 changed files
with
32 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,10 +36,7 @@ Additional service daemons are provided for: | |
This project uses a cmake based build system. Quick start: | ||
|
||
```sh | ||
$ mkdir build | ||
$ cd build | ||
$ cmake -GNinja .. | ||
$ ninja | ||
$ bash build.sh | ||
``` | ||
|
||
*build/bin* will contain the sample programs and *build/lib* will contain the | ||
|
@@ -76,16 +73,6 @@ Install required packages: | |
$ yum install cmake gcc libnl3-devel make pkgconfig valgrind-devel | ||
``` | ||
|
||
For end users, the package can be built using GNU Make and the old cmake | ||
included with the distro: | ||
|
||
```sh | ||
$ mkdir build | ||
$ cd build | ||
$ cmake .. | ||
$ make | ||
``` | ||
|
||
Developers are suggested to install more modern tooling for the best experience. | ||
|
||
```sh | ||
|
@@ -96,8 +83,6 @@ $ unzip ninja-linux.zip | |
$ install -m755 ninja /usr/local/bin/ninja | ||
``` | ||
|
||
Use the 'cmake3' program in place of `cmake` in the above instructions. | ||
|
||
# Reporting bugs | ||
|
||
Bugs should be reported to the <[email protected]> mailing list | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
SRCDIR=`dirname $0` | ||
BUILDDIR="$SRCDIR/build" | ||
|
||
mkdir -p "$BUILDDIR" | ||
|
||
if hash cmake3 2>/dev/null; then | ||
# CentOS users are encouraged to install cmake3 from EPEL | ||
CMAKE=cmake3 | ||
else | ||
CMAKE=cmake | ||
fi | ||
|
||
if hash ninja-build 2>/dev/null; then | ||
# Fedora uses this name | ||
NINJA=ninja-build | ||
elif hash ninja 2>/dev/null; then | ||
NINJA=ninja | ||
fi | ||
|
||
cd "$BUILDDIR" | ||
|
||
if [ "x$NINJA" == "x" ]; then | ||
cmake .. | ||
make | ||
else | ||
cmake -GNinja .. | ||
$NINJA | ||
fi |