linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Kacur <jkacur@redhat.com>
To: linux-rt-users@vger.kernel.org
Cc: Clark Williams <williams@redhat.com>
Subject: Makefile: Only call cc -dumpmachine once in the makefile
Date: Tue, 6 Oct 2015 09:07:49 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.20.1510060906500.14006@riemann> (raw)

>From 1054004fbb3cb913717f5729f916e9cb1201505c Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Mon, 5 Oct 2015 22:37:46 +0200
Subject: [PATCH 1/2] 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>
---
 Makefile | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 6ce2ecc7fc30..4c4a06e1fc6e 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"

                 reply	other threads:[~2015-10-06  7:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.20.1510060906500.14006@riemann \
    --to=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).