aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2013-09-20 13:29:01 +0200
committerGerd Hoffmann <kraxel@redhat.com>2013-09-25 09:18:29 +0200
commit18140146b05f910e757dcc950e94935d084c72e3 (patch)
treeba4fc1e59e397356d25f5d1eac90987f73848f0f /Makefile
parent0b3607f89ac24f84f8b22ffaadb4f0fd111bda24 (diff)
downloadseabios-hppa-18140146b05f910e757dcc950e94935d084c72e3.zip
seabios-hppa-18140146b05f910e757dcc950e94935d084c72e3.tar.gz
seabios-hppa-18140146b05f910e757dcc950e94935d084c72e3.tar.bz2
build: simplify cross builds
This patch simplifies seabios cross-builds on !x86 platforms. It adds a CROSS_PREFIX variable which is used to set CC, LD & friends to the cross build binaries. It also moves the common command definitions up in the Makefile to make sure CC is set correctly when probing compiler flags using $(call cc-option ...) Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 18 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 3984d35..229fe54 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,24 @@
# Output directory
OUT=out/
+# Common command definitions
+export HOSTCC := $(CC)
+export CONFIG_SHELL := sh
+export KCONFIG_AUTOHEADER := autoconf.h
+export KCONFIG_CONFIG := $(CURDIR)/.config
+CROSS_PREFIX=
+ifneq ($(CROSS_PREFIX),)
+CC=$(CROSS_PREFIX)gcc
+endif
+AS=$(CROSS_PREFIX)as
+LD=$(CROSS_PREFIX)ld
+OBJCOPY=$(CROSS_PREFIX)objcopy
+OBJDUMP=$(CROSS_PREFIX)objdump
+STRIP=$(CROSS_PREFIX)strip
+PYTHON=python
+CPP=cpp
+IASL:=iasl
+
# Source files
SRCBOTH=misc.c stacks.c output.c string.c x86.c block.c cdrom.c mouse.c kbd.c \
serial.c clock.c resume.c pnpbios.c vgahooks.c pcibios.c apm.c \
@@ -61,19 +79,6 @@ Q=@
MAKEFLAGS += --no-print-directory
endif
-# Common command definitions
-export HOSTCC := $(CC)
-export CONFIG_SHELL := sh
-export KCONFIG_AUTOHEADER := autoconf.h
-export KCONFIG_CONFIG := $(CURDIR)/.config
-AS=as
-OBJCOPY=objcopy
-OBJDUMP=objdump
-STRIP=strip
-PYTHON=python
-CPP=cpp
-IASL:=iasl
-
# Default targets
-include $(KCONFIG_CONFIG)