summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSuzuki K. Poulose <suzuki@in.ibm.com>2012-02-13 09:14:58 +0900
committerAtsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>2012-02-13 09:14:58 +0900
commit96f24dc77dc48e4c8f4c3527f4f5b4d27845393c (patch)
tree3b8b131c0357851ffde69d3005b066049f3c8020 /Makefile
parent7ccf93312266eb4b2e4f9ac701875eb926a861f3 (diff)
[PATCH v1 1/3] Support for cross building.
Support cross building of makedumpfile. This would be useful for building the makedumpfile for embedded PPC boards. Support for PPC32 would be added in the later patches. Use TARGET variable to set the arch to build for. Also honour the value of CC if set. Signed-off-by: Suzuki K. Poulose <suzuki@in.ibm.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index e6b7b89..159f69d 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,11 @@
VERSION=1.4.2
DATE=25 January 2012
+# Honour the environment variable CC
+ifeq ($(strip $CC),)
CC = gcc
+endif
+
CFLAGS = -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
-DVERSION='"$(VERSION)"' -DRELEASE_DATE='"$(DATE)"'
@@ -11,7 +15,13 @@ CFLAGS_ARCH = -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
# LDFLAGS = -L/usr/local/lib -I/usr/local/include
-ARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/sun4u/sparc64/ \
+# Use TARGET as the target architecture if specified.
+# Defaults to uname -m
+ifeq ($(strip($TARGET)),)
+TARGET := $(shell uname -m)
+endif
+
+ARCH := $(shell echo ${TARGET} | sed -e s/i.86/x86/ -e s/sun4u/sparc64/ \
-e s/arm.*/arm/ -e s/sa110/arm/ \
-e s/s390x/s390/ -e s/parisc64/parisc/ \
-e s/ppc64/powerpc/ )