summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClark Williams <williams@redhat.com>2011-09-26 14:49:36 -0500
committerClark Williams <williams@redhat.com>2011-09-26 14:49:36 -0500
commitcb1540450329d745f528e38f54a4906dab91eb96 (patch)
treea3305cc83a63a305796b14459690a39fba739032
parente1fab5b28076ec1f61601498f393c08a0cb817cd (diff)
downloadrt-tests-cb1540450329d745f528e38f54a4906dab91eb96.tar.gz
Modified Makefile to be smarter about turning on/off NUMA compile
Combined Uwe Kleine-König and Frank Rowand's suggestions into a Makefile modification that tries to be smart about turning on NUMA, while allowing it to be explicitly enabled/disabled via command line options Signed-off-by: Clark Williams <williams@redhat.com>
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 4f51154..4776391 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,11 @@ bindir ?= $(prefix)/bin
mandir ?= $(prefix)/share/man
srcdir ?= $(prefix)/src
-NUMA := 1
+machinetype = $(shell uname -m | \
+ sed -e 's/i.86/i386/' -e 's/mips.*/mips/' -e 's/ppc.*/powerpc/')
+ifneq ($(filter x86_64 i386 ia64 mips powerpc,$(machinetype)),)
+NUMA := 1
+endif
CFLAGS = -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include
@@ -26,7 +30,7 @@ else
CFLAGS += -O0 -g
endif
-ifdef NUMA
+ifeq ($(NUMA),1)
CFLAGS += -DNUMA
NUMA_LIBS = -lnuma
endif