summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Kacur <jkacur@redhat.com>2015-10-05 22:37:46 +0200
committerJohn Kacur <jkacur@redhat.com>2015-10-06 11:27:10 +0200
commit8d26afdc2d2fd495e701b56adac44ac9eecf151f (patch)
treebb18b0e5e69289e2ef0dca53bfb46b8118f65c87
parent6f3c1ba9e8403cff6ca12351c43bde68e0fbca25 (diff)
downloadrt-tests-8d26afdc2d2fd495e701b56adac44ac9eecf151f.tar.gz
Makefile: Only call cc -dumpmachine once in the makefile
- Store the result of cc -dumpmachine in the dumpmachine variable - Use makefile parsing to obtain the ostype - Use shell and sed functions to obtain the machinetype - Turn on the bionic functionality if the ostype=android Signed-off-by: John Kacur <jkacur@redhat.com> Tested-by: Henrik Austad <haustad@cisco.com>
-rw-r--r--Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index f64b23f..ef52616 100644
--- a/Makefile
+++ b/Makefile
@@ -40,8 +40,13 @@ else
endif
# We make some gueses on how to compile rt-tests based on the machine type
-# These can often be overridden
-machinetype = $(shell $(CC) -dumpmachine | \
+# and the ostype. These can often be overridden.
+dumpmachine := $(shell $(CC) -dumpmachine)
+
+# The ostype is typically something like linux or android
+ostype := $(lastword $(subst -, ,$(dumpmachine)))
+
+machinetype := $(shell echo $(dumpmachine)| \
sed -e 's/-.*//' -e 's/i.86/i386/' -e 's/mips.*/mips/' -e 's/ppc.*/powerpc/')
# The default is to assume you have libnuma installed, which is fine to do
@@ -70,8 +75,7 @@ endif
# - pthread_[gs]etaffinity
#
# Typically see something like "aarch64-linux-android"
-
-ifneq ($(shell $(CC) -dumpmachine | grep -i android),)
+ifeq (android,$(ostype))
USE_BIONIC := 1
CFLAGS += -DNO_PTHREAD_BARRIER
CFLAGS += -DNO_PTHREAD_SETAFFINITY