On Mon, Oct 10, 2016 at 10:47:58AM -0600, Jason Gunthorpe wrote: > On Mon, Oct 10, 2016 at 09:17:11AM -0700, Bart Van Assche wrote: > > On 10/10/16 08:59, Christoph Hellwig wrote: > > >On Mon, Oct 10, 2016 at 08:56:33AM -0700, Bart Van Assche wrote: > > >>Have you considered to make this script stop immediately if one of the > > >>steps fails, e.g. as follows? > > > > > >How about just ading a > > > > > >set -e > > > > > >to the beginning to get this automatically? > > > > That would also work. But if there is a space anywhere in the path in which > > the rdma-core repository exists, mkdir $BUILDDIR will have to be changed > > into mkdir "$BUILDDIR". > > Is this OK? > > From 6362ec4c1ddec0f6b2a1bf052cdfde63cbf73d90 Mon Sep 17 00:00:00 2001 > From: Jason Gunthorpe > Date: Mon, 10 Oct 2016 10:46:47 -0600 > Subject: [PATCH] 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 > Signed-off-by: Jason Gunthorpe > --- > README.md | 17 +---------------- > build.sh | 33 +++++++++++++++++++++++++++++++++ > 2 files changed, 34 insertions(+), 16 deletions(-) > create mode 100755 build.sh > > diff --git a/README.md b/README.md > index 98ec5a7d695f..66aee3f49f00 100644 > --- a/README.md > +++ b/README.md > @@ -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 mailing list > diff --git a/build.sh b/build.sh > new file mode 100755 > index 000000000000..76205e6af921 > --- /dev/null > +++ b/build.sh > @@ -0,0 +1,33 @@ > +#!/bin/bash > +set -e > + > +SRCDIR=`dirname $0` > +BUILDDIR="$SRCDIR/build" > + > +if [ ! -d "$BUILDDIR" ]; then > + mkdir "$BUILDDIR" > +fi What do you think about following code, instead of 3 lines above? + mkdir -p "$BUILDDIR"