summaryrefslogtreecommitdiff
path: root/rules/cross-compiling.mk
blob: 520b5c13cf178e323489ebd7c2f9053d380bfd2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -----------------------------------------------------------------------------
#
# (c) 2012 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
#      http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
#      http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------

define cross-compiling # $1 = then, $2 = else, $3 = then, ...
ifneq "$(TARGETPLATFORM)" "$(HOSTPLATFORM)"
ifneq "$(BUILDPLATFORM)" "$(HOSTPLATFORM)"
$(warning When cross-compiling, the build and host platforms must be equal (--build=$(BUILDPLATFORM) --host=$(HOSTPLATFORM) --target=$(TARGETPLATFORM)))
endif
$1
$3
else
$2
$4
endif
endef