[PATCH] Add make verbose handling to sigrok-cross-linux
Also adds small make/gmake adaption for FreeBSD
This script works fine for FreeBSD - with the only exception that
gmake should be used in favour of make.
With such a small change - I don't think that is serves any purpose
to create a separate build script for FreeBSD
What is your opinion ?
/Uffe
>From 2a13fc8c9b202ce6cb160c74b9a0aa7149904adb Mon Sep 17 00:00:00 2001
From: Uffe Jakobsen <u...@uffe.org>
Date: Fri, 6 Feb 2015 17:53:30 +0100
Subject: [PATCH] Add make verbose handling to sigrok-cross-linux
Also add small make/gmake adaption for FreeBSD
This script works fine for FreeBSD - with the only exception that
gmake should be used in favour of make.
With such a small change - I don't think that is serves any purpose
to create a separate build script for FreeBSD
---
cross-compile/linux/sigrok-cross-linux | 61 ++++++++++++++++++++++++----------
1 file changed, 44 insertions(+), 17 deletions(-)
diff --git a/cross-compile/linux/sigrok-cross-linux b/cross-compile/linux/sigrok-cross-linux
index a01173a..b001617 100755
--- a/cross-compile/linux/sigrok-cross-linux
+++ b/cross-compile/linux/sigrok-cross-linux
@@ -3,6 +3,7 @@
## This file is part of the sigrok-util project.
##
## Copyright (C) 2014 Uwe Hermann <u...@hermann-uwe.de>
+## Copyright (C) 2015 Uffe Jakobsen <u...@uffe.org>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -27,6 +28,18 @@ set -e
# C="--host=$TOOLCHAIN_TRIPLET"
# export PATH=$TOOLCHAIN/bin:$PATH
+OSNAME=$(uname -s)
+
+case "${OSNAME}" in
+FreeBSD)
+ # GNUmake is named gmake on FreeBSD
+ MAKE=gmake;;
+*)
+ MAKE=make;;
+esac
+
+echo "INFO: Building on ${OSNAME}: using ${MAKE}"
+
# The path where the compiled packages will be installed.
PREFIX=$HOME/sr
@@ -36,6 +49,9 @@ BUILDDIR=./build
# The path where the libsigrok Python bindings will be installed.
PYPATH=$PREFIX/lib/python2.7/site-packages
+# Edit this to control verbose build output (VERBOSE=1)
+VERBOSE=0
+
# Edit this to enable/disable/modify parallel compiles.
PARALLEL="-j 2"
@@ -51,6 +67,16 @@ PARALLEL="-j 2"
P="$PREFIX/lib/pkgconfig"
C="$C --prefix=$PREFIX"
+MAKE_V_OPT="V=${VERBOSE}"
+
+# CMake generated makefiles uses VERBOSE switch to control verbose output
+# The VERBOSE option itself enables the output mode - not its value
+if test ${VERBOSE} -ne 0; then
+MAKE_VERBOSE_OPT="VERBOSE=${VERBOSE}"
+else
+MAKE_VERBOSE_OPT=""
+fi
+
# Remove build directory contents (if any) and create a new build dir.
rm -rf $BUILDDIR
mkdir $BUILDDIR
@@ -67,8 +93,8 @@ cd libserialport
mkdir build
cd build
../configure $C
-$SB make $PARALLEL
-make install
+$SB $MAKE $MAKE_V_OPT $PARALLEL
+$MAKE $MAKE_V_OPT install
cd ../..
# libsigrok
@@ -78,10 +104,11 @@ cd libsigrok
./autogen.sh
mkdir build
cd build
-PKG_CONFIG_PATH=$P ../configure $C
-$SB make $PARALLEL
-PYTHONPATH=$PYPATH $SB make install
-$SB make check
+#PKG_CONFIG_PATH=$P ../configure $C
+PKG_CONFIG_PATH=$P ../configure $C --enable-cxx --disable-python --disable-java
+$SB $MAKE $MAKE_V_OPT $PARALLEL
+PYTHONPATH=$PYPATH $SB $MAKE $MAKE_V_OPT install
+$SB $MAKE $MAKE_V_OPT check
cd ../..
# libsigrokdecode
@@ -91,9 +118,9 @@ cd libsigrokdecode
mkdir build
cd build
PKG_CONFIG_PATH=$P ../configure $C
-$SB make $PARALLEL
-make install
-$SB make check
+$SB $MAKE $MAKE_V_OPT $PARALLEL
+$MAKE $MAKE_V_OPT install
+$SB $MAKE $MAKE_V_OPT check
cd ../..
# sigrok-firmware
@@ -104,7 +131,7 @@ mkdir build
cd build
# Nothing gets cross-compiled here, we just need 'make install' basically.
../configure $C
-make install
+$MAKE $MAKE_V_OPT install
cd ../..
# sigrok-firmware-fx2lafw
@@ -115,8 +142,8 @@ mkdir build
cd build
# We're building the fx2lafw firmware on the host, no need to cross-compile.
../configure $C
-make $PARALLEL
-make install
+$MAKE $MAKE_V_OPT $PARALLEL
+$MAKE $MAKE_V_OPT install
cd ../..
# sigrok-cli
@@ -126,8 +153,8 @@ cd sigrok-cli
mkdir build
cd build
PKG_CONFIG_PATH=$P ../configure $C
-$SB make $PARALLEL
-make install
+$SB $MAKE $MAKE_V_OPT $PARALLEL
+$MAKE $MAKE_V_OPT install
cd ../..
# PulseView
@@ -136,8 +163,8 @@ cd pulseview
mkdir build
cd build
PKG_CONFIG_PATH=$P $SB cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DDISABLE_WERROR=y -DENABLE_TESTS=y ..
-$SB make $PARALLEL
-make install
-$SB make test
+$SB $MAKE $MAKE_VERBOSE_OPT $PARALLEL
+$MAKE $MAKE_VERBOSE_OPT install
+$SB $MAKE $MAKE_VERBOSE_OPT test
cd ../..
--
2.3.0
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel