summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2014-11-16 10:30:21 +0000
committerJohn-Mark Bell <jmb@netsurf-browser.org>2014-11-16 10:30:21 +0000
commitd4f667575aeffc5f3e10a7c1593a221a7b55cef3 (patch)
tree6875311d8f912ec3c1b58122184527736a329b42
parentb07864e66a48adfab83052db94c962a261a53eb4 (diff)
downloadbuildsystem-d4f667575aeffc5f3e10a7c1593a221a7b55cef3.tar.gz
buildsystem-d4f667575aeffc5f3e10a7c1593a221a7b55cef3.tar.bz2
Migrate to target triplets
-rw-r--r--makefiles/Makefile.clang2
-rw-r--r--makefiles/Makefile.gcc4
-rw-r--r--makefiles/Makefile.norcroft2
-rw-r--r--makefiles/Makefile.tools371
-rw-r--r--makefiles/Makefile.top18
5 files changed, 114 insertions, 283 deletions
diff --git a/makefiles/Makefile.clang b/makefiles/Makefile.clang
index 9f14547..b48c490 100644
--- a/makefiles/Makefile.clang
+++ b/makefiles/Makefile.clang
@@ -32,7 +32,7 @@ CFLAGS := $(CFLAGS) -D_ALIGNED="__attribute__((aligned))"
# Mac OS X Universal Binaries
###############################################################################
-ifeq ($(TARGET),Darwin)
+ifeq ($(findstring darwin,$(BUILD)),darwin)
ifneq ($(UNIVERSAL),)
UNIVERSAL_FLAGS := $(foreach arch,$(UNIVERSAL),-arch $(arch) )
diff --git a/makefiles/Makefile.gcc b/makefiles/Makefile.gcc
index abe4f28..d469651 100644
--- a/makefiles/Makefile.gcc
+++ b/makefiles/Makefile.gcc
@@ -51,7 +51,7 @@ endif
# RISC OS module extensions
ifeq ($(COMPONENT_TYPE),riscos-module)
- ifneq ($(TARGET),riscos)
+ ifneq ($(BUILD),arm-unknown-riscos)
$(error Attempting to build a RISC OS module for a non-RISC OS target)
endif
@@ -64,7 +64,7 @@ endif
# Mac OS X Universal Binaries
###############################################################################
-ifeq ($(TARGET),Darwin)
+ifeq ($(findstring darwin,$(BUILD)),darwin)
ifneq ($(UNIVERSAL),)
UNIVERSAL_FLAGS := $(foreach arch,$(UNIVERSAL),-arch $(arch) )
CC_CAN_BUILD_AND_DEP := no
diff --git a/makefiles/Makefile.norcroft b/makefiles/Makefile.norcroft
index 93344f9..5acb7c4 100644
--- a/makefiles/Makefile.norcroft
+++ b/makefiles/Makefile.norcroft
@@ -38,7 +38,7 @@ endif
# RISC OS module extensions
ifeq ($(COMPONENT_TYPE),riscos-module)
- ifneq ($(TARGET),riscos)
+ ifneq ($(BUILD),arm-unknown-riscos)
$(error Attempting to build a RISC OS module for a non-RISC OS target)
endif
diff --git a/makefiles/Makefile.tools b/makefiles/Makefile.tools
index 08cd64a..febfe8c 100644
--- a/makefiles/Makefile.tools
+++ b/makefiles/Makefile.tools
@@ -10,13 +10,14 @@
#
# Optional inputs:
#
-# BUILD Type of build to perform:
+# HOST Platform we're building on
+# BUILD Target platform (defaults to host)
+# VARIANT Type of build to perform:
# release - Release build (default)
# debug - Debug build
-# OPTCFLAGS Optional C compiler flags for $(BUILD)
-# OPTCXXFLAGS Optional C++ compiler flags for $(BUILD)
-# OPTLDFLAGS Optional linker flags for $(BUILD)
-# TARGET Target platform (defaults to host)
+# OPTCFLAGS Optional C compiler flags for $(VARIANT)
+# OPTCXXFLAGS Optional C++ compiler flags for $(VARIANT)
+# OPTLDFLAGS Optional linker flags for $(VARIANT)
# PREFIX Absolute installation path prefix
# (defaults to /usr/local)
# LIBDIR Library installation directory in ${PREFIX}
@@ -31,9 +32,9 @@ ifeq ($(COMPONENT_TYPE),)
$(error COMPONENT_TYPE not set)
endif
-# Default build to release
-ifeq ($(BUILD),)
- BUILD := release
+# Default variant to release
+ifeq ($(VARIANT),)
+ VARIANT := release
endif
###############################################################################
@@ -45,258 +46,134 @@ NSSHARED := $(patsubst %/,%,$(dir $(NSBUILD)))
NSTESTTOOLS := $(NSSHARED)/testtools
###############################################################################
-# Host/target platform detection
+# Bootstrap default tooling
###############################################################################
-# Autodetect host if necessary
-ifeq ($(HOST),)
- HOST := $(shell uname -s)
-endif
+HOST_CC ?= cc
-# Simple host sanitisation
-ifeq ($(HOST),)
- # Don't ask
- HOST := riscos
-else
- ifeq ($(HOST),RISC OS)
- HOST := riscos
- endif
+###############################################################################
+# Host/build platform detection
+###############################################################################
- ifeq ($(HOST),BeOS)
- HOST := beos
+# Autodetect build or CC
+CC__ := $(CC)
+ifeq ($(BUILD),)
+ BUILD := $(shell $(CC) -dumpmachine)
+ ifeq ($(BUILD),)
+ $(error "Failed to guess BUILD")
endif
- ifeq ($(HOST),Haiku)
- HOST := haiku
+else
+ ifeq ($(origin CC),default)
+ CC__ := $(BUILD)-gcc
endif
+endif
- ifeq ($(HOST),AmigaOS)
- HOST := amiga
+# Autodetect host if necessary
+ifeq ($(HOST),)
+ HOST := $(shell $(HOST_CC) -dumpmachine)
+ ifeq ($(HOST),)
+ $(error "Failed to guess HOST")
endif
+endif
- ifeq ($(findstring MINGW,$(HOST)),MINGW)
- HOST := windows
- endif
+ifeq ($(HOST),$(BUILD))
+ # Native build
- ifeq ($(HOST),FreeMiNT)
- HOST := atari
- endif
-endif
+ ifeq ($(BUILD),i586-pc-haiku)
+ # Building on+for Haiku
-ifeq ($(TARGET),)
- # Default target to host. Please add exceptions as required.
- TARGET := $(HOST)
+ # Default prefix
+ BEOS_INSTALL_ENV ?= /boot/common
- ifeq ($(HOST),haiku)
- # This isn't necessarily correct -- they have differences. However, in the
- # general case, this will work. If there are differences that are actually
- # important wrt the target platform (as opposed to the build host) then
- # we'll just have to introduce a haiku target, too.
- TARGET := beos
- endif
-endif
+ # TODO: this assumes GCC
+ CFLAGS := $(CFLAGS) -I$(BEOS_INSTALL_ENV)/include
+ CXXFLAGS := $(CXXFLAGS) -I$(BEOS_INSTALL_ENV)/include
+ LDFLAGS := $(LDFLAGS) -L$(BEOS_INSTALL_ENV)/lib
-# Sanitise HOST and TARGET
-# TODO: Ideally, we want the equivalent of s/[^A-Za-z0-9]/_/g here
-HOST := $(subst .,_,$(subst -,_,$(subst /,_,$(HOST))))
-TARGET := $(subst .,_,$(subst -,_,$(subst /,_,$(TARGET))))
+ PREFIX ?= $(BEOS_INSTALL_ENV)
+ endif
-# Now setup our tooling
-ifeq ($(TARGET),riscos)
- ifeq ($(HOST),riscos)
- # Building on native RISC OS
- GCCSDK_INSTALL_ENV ?= <NSLibs$$Dir>
+ ifeq ($(findstring openbsd,$(BUILD)),openbsd)
+ # Building on+for OpenBSD
+ CFLAGS := $(CFLAGS) -I$(GCCSDK_INSTALL_ENV)/include -I/usr/local/include
+ CXXFLAGS := $(CXXFLAGS) -I$(GCCSDK_INSTALL_ENV)/include -I/usr/local/include
+ LDFLAGS := $(LDFLAGS) -L$(GCCSDK_INSTALL_ENV)/lib -L/usr/local/lib
- CC__ := gcc
- CXX__ := g++
- CMHG ?= cmunge
- GENHTML ?= echo
- LCOV ?= echo
- PKGCONFIG ?=
- # On certain versions of RISC OS (<>4 || kernel < 8.75),
- # the kernel will clean up the current redirection on
- # OS_Exit, including closing the associated file handles.
- # This is problematic for UnixLib, as it's invariably using
- # those filehandles in a pipe between parent and child processes.
- # This affects us as, anywhere where we shell out and want to
- # capture the output of the child process may fail.
- # Fortunately, if we know the child process is built against
- # UnixLib, then we also know that it won't call OS_Exit when it
- # exits, instead returning directly to our exit handler (and thus
- # preserving the redirection). This only works, however, if the
- # child application is specified using its absolute path, or
- # found in Run$Path. In the case of Perl, it does not appear in
- # Run$Path, so we must invoke it using its absolute path so that
- # the SharedUnixLibrary successfully detects it as a child process.
- PERL ?= <Perl$$Dir>.bin.perl
-
- # This is nasty, but needed because $(CURDIR) will
- # contain colons, and thus confuse make mightily
- $(shell SetMacro Alias$$$(COMPONENT)pwd Set %0 <FileSwitch$$CurrentFilingSystem>:|<FileSwitch$$<FileSwitch$$CurrentFilingSystem>$$CSD>|mUnset Alias$$$(COMPONENT)pwd)
- $(shell $(COMPONENT)pwd $(COMPONENT)$$Dir)
- CURDIR := <$(COMPONENT)$$Dir>
+ FLEX ?= gflex
+ endif
+else
+ # Cross compiling
+
+ # Search the path for the compiler
+ toolpath_ := $(shell /bin/which $(CC__))
+ ifeq ($(toolpath_),)
+ toolpath_ := /opt/netsurf/$(BUILD)/cross/bin/
+ CC__ := $(toolpath_)$(BUILD)-gcc
+ AR__ := $(toolpath_)$(BUILD)-ar
+ CXX__ := $(toolpath_)$(BUILD)-g++
else
- # Cross compiling for RISC OS
- ifeq ($(origin GCCSDK_INSTALL_ENV),undefined)
- ifneq ($(realpath /opt/netsurf/arm-unknown-riscos/env),)
- GCCSDK_INSTALL_ENV := /opt/netsurf/arm-unknown-riscos/env
- else
- GCCSDK_INSTALL_ENV := /home/riscos/env
- endif
+ CC__ := $(realpath $(toolpath_))
+ toolpath_ := $(dir $(CC__))
+ toolprefix_ := $(subst :,/,$(dir $(subst -,/,$(subst /,:,$(CC__)))))
+ ifeq ($(origin AR),default)
+ AR__ := $(toolprefix_)-ar
endif
-
- ifeq ($(origin GCCSDK_INSTALL_CROSSBIN),undefined)
- ifneq ($(realpath /opt/netsurf/arm-unknown-riscos/cross/bin),)
- GCCSDK_INSTALL_CROSSBIN := /opt/netsurf/arm-unknown-riscos/cross/bin
- else
- GCCSDK_INSTALL_CROSSBIN := /home/riscos/cross/bin
- endif
+ ifeq ($(origin CXX),default)
+ CXX__ := $(toolprefix_)-g++
endif
+ endif
+
+ # Compute default SDK path
+ ifeq ($(origin GCCSDK_INSTALL_ENV),undefined)
+ GCCSDK_INSTALL_ENV := $(realpath $(toolpath_)../../env)
+ endif
- AR__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*ar)
- CC__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
- CXX__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*g++)
+ ifeq ($(BUILD),arm-unknown-riscos)
+ # Cross compiling for RISC OS
CMHG ?= PATH="$(GCCSDK_INSTALL_CROSSBIN):$(PATH)" $(GCCSDK_INSTALL_CROSSBIN)/cmunge
GENHTML ?= echo
LCOV ?= echo
PKGCONFIG ?= PKG_CONFIG_LIBDIR="$(PREFIX)/lib/pkgconfig:$(GCCSDK_INSTALL_ENV)/lib/pkgconfig:$(GCCSDK_INSTALL_ENV)/share/pkgconfig" pkg-config
ifneq ($(COMPONENT_TYPE),riscos-module)
- ifeq ($(origin CC),default)
- ifneq ($(findstring arm-unknown-riscos-gcc,$(CC__)),)
- EXEEXT := ,e1f
- else
- EXEEXT := ,ff8
- endif
+ ifneq ($(findstring arm-unknown-riscos-gcc,$(CC__)),)
+ EXEEXT := ,e1f
else
- ifneq ($(findstring arm-unknown-riscos-gcc,$(CC)),)
- EXEEXT := ,e1f
- else
- EXEEXT := ,ff8
- endif
+ EXEEXT := ,ff8
endif
else
EXEEXT := ,ffa
endif
- endif
-
- # TODO: this assumes GCC
- CFLAGS := $(CFLAGS) -mpoke-function-name -I$(GCCSDK_INSTALL_ENV)/include
- CXXFLAGS := $(CXXFLAGS) -mpoke-function-name -I$(GCCSDK_INSTALL_ENV)/include
- LDFLAGS := $(LDFLAGS) -L$(GCCSDK_INSTALL_ENV)/lib
-
- CMHGFLAGS := -p -tgcc -32bit -apcs 3/32/nonreent/fpe2/noswst/nofpr/nofp
- # Default prefix
- PREFIX ?= $(GCCSDK_INSTALL_ENV)
-endif
-
-# BeOS-like targets
-ifeq ($(TARGET),beos)
- ifeq ($(HOST),beos)
- # Building on BeOS
- CC__ := gcc
+ # TODO: this assumes GCC
+ CFLAGS := $(CFLAGS) -mpoke-function-name -I$(GCCSDK_INSTALL_ENV)/include
+ CXXFLAGS := $(CXXFLAGS) -mpoke-function-name -I$(GCCSDK_INSTALL_ENV)/include
+ LDFLAGS := $(LDFLAGS) -L$(GCCSDK_INSTALL_ENV)/lib
- # No pkg-config
- PKGCONFIG ?=
+ CMHGFLAGS := -p -tgcc -32bit -apcs 3/32/nonreent/fpe2/noswst/nofpr/nofp
# Default prefix
- BEOS_INSTALL_ENV ?= /boot/home/config
- else
- ifeq ($(HOST),haiku)
- # Building on Haiku
-
- # Default prefix
- BEOS_INSTALL_ENV ?= /boot/common
- else
- # TODO: more sensible default
- BEOS_INSTALL_ENV ?= /home/jmb/haiku/env
- BEOS_INSTALL_CROSSBIN ?= /home/jmb/haiku/haiku/generated/cross-tools/bin
-
- CC__ := $(wildcard $(BEOS_INSTALL_CROSSBIN)/*gcc)
- CXX__ := $(wildcard $(BEOS_INSTALL_CROSSBIN)/*g++)
- AR__ := $(wildcard $(BEOS_INSTALL_CROSSBIN)/*ar)
-
- PKGCONFIG := PKG_CONFIG_LIBDIR="$(PREFIX)/lib/pkgconfig:$(BEOS_INSTALL_ENV)/lib/pkgconfig:$(BEOS_INSTALL_ENV)/share/pkgconfig" pkg-config
- endif
+ PREFIX ?= $(GCCSDK_INSTALL_ENV)
endif
- # TODO: this assumes GCC
- CFLAGS := $(CFLAGS) -I$(BEOS_INSTALL_ENV)/include
- CXXFLAGS := $(CXXFLAGS) -I$(BEOS_INSTALL_ENV)/include
- LDFLAGS := $(LDFLAGS) -L$(BEOS_INSTALL_ENV)/lib
-
- PREFIX ?= $(BEOS_INSTALL_ENV)
-endif
-
-# Windows
-ifeq ($(TARGET),windows)
- ifeq ($(HOST),windows)
- # Building on Windows
- CC__ := gcc
- CXX__ := g++
- AR__ := ar
-
- PKGCONFIG ?=
- else
+ ifeq ($(BUILD),i686-w64-mingw32)
# Cross compiling for Windows -- assumes mingw toolchain
-
- ifeq ($(origin GCCSDK_INSTALL_ENV),undefined)
- ifneq ($(realpath /opt/netsurf/i686-w64-mingw32/env),)
- GCCSDK_INSTALL_ENV := /opt/netsurf/i686-w64-mingw32/env
- else
- GCCSDK_INSTALL_ENV := /usr/local/mingw
- endif
- endif
-
- ifeq ($(origin GCCSDK_INSTALL_CROSSBIN),undefined)
- ifneq ($(realpath /opt/netsurf/i686-w64-mingw32/cross/bin),)
- GCCSDK_INSTALL_CROSSBIN := /opt/netsurf/i686-w64-mingw32/cross/bin
- AR__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*ar)
- CC__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
- CXX__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*g++)
- else
- GCCSDK_INSTALL_CROSSBIN := /usr/local/mingw/bin
- CC__ := i586-mingw32msvc-gcc
- CXX__ := i586-mingw32msvc-g++
- AR__ := i586-mingw32msvc-ar
- endif
- endif
-
GENHTML ?= echo
LCOV ?= echo
PKGCONFIG ?= PKG_CONFIG_LIBDIR="$(PREFIX)/lib/pkgconfig:$(GCCSDK_INSTALL_ENV)/lib/pkgconfig:$(GCCSDK_INSTALL_ENV)/share/pkgconfig" pkg-config
- endif
-
- # TODO: this assumes GCC
- CFLAGS := $(CFLAGS) -U__STRICT_ANSI__ -I$(GCCSDK_INSTALL_ENV)/include
- CXXFLAGS := $(CXXFLAGS) -U__STRICT_ANSI__ -I$(GCCSDK_INSTALL_ENV)/include
- LDFLAGS := $(LDFLAGS) -L$(GCCSDK_INSTALL_ENV)/lib
+ # TODO: this assumes GCC
+ CFLAGS := $(CFLAGS) -U__STRICT_ANSI__ -I$(GCCSDK_INSTALL_ENV)/include
+ CXXFLAGS := $(CXXFLAGS) -U__STRICT_ANSI__ -I$(GCCSDK_INSTALL_ENV)/include
+ LDFLAGS := $(LDFLAGS) -L$(GCCSDK_INSTALL_ENV)/lib
- # Default prefix
- PREFIX ?= $(GCCSDK_INSTALL_ENV)
-endif
+ # Default prefix
+ PREFIX ?= $(GCCSDK_INSTALL_ENV)
+ endif
-# AmigaOS (3/4; m68k/ppc: we can treat them identically)
-ifeq ($(findstring amiga,$(TARGET)),amiga)
- ifeq ($(findstring amiga,$(HOST)),amiga)
- # Building on AmigaOS
- # Nothing to do, as we assume the default tooling works
- else
+ # AmigaOS (3/4; m68k/ppc: we can treat them identically)
+ ifeq ($(findstring amigaos,$(BUILD)),amigaos)
# Cross compiling for AmigaOS
-
- ifeq ($(TARGET),amigaos3)
- GCCSDK_INSTALL_ENV ?= /opt/netsurf/m68k-unknown-amigaos/env
- GCCSDK_INSTALL_CROSSBIN ?= /opt/netsurf/m68k-unknown-amigaos/cross/bin
- else
- GCCSDK_INSTALL_ENV ?= /opt/netsurf/ppc-amigaos/env
- GCCSDK_INSTALL_CROSSBIN ?= /opt/netsurf/ppc-amigaos/cross/bin
- endif
-
- AR__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*ar)
- CC__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc)
- CXX__ := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*g++)
-
PKGCONFIG ?= PKG_CONFIG_LIBDIR="$(PREFIX)/lib/pkgconfig:$(GCCSDK_INSTALL_ENV)/lib/pkgconfig:$(GCCSDK_INSTALL_ENV)/share/pkgconfig" pkg-config
# TODO: this assumes GCC
@@ -306,24 +183,12 @@ ifeq ($(findstring amiga,$(TARGET)),amiga)
PREFIX ?= $(GCCSDK_INSTALL_ENV)
endif
-endif
-# FreeMiNT / atari
-ifeq ($(TARGET),atari)
- ifeq ($(HOST),atari)
- # Building on FreeMiNT
- # Nothing to do, as we assume the default tooling works
- else
+ ifeq ($(BUILD),m68k-atari-mint)
# Cross compiling for FreeMiNT
ATARIARCH ?= 68020-60
- GCCSDK_INSTALL_ENV ?= /opt/netsurf/m68k-atari-mint/env
- GCCSDK_INSTALL_CROSSBIN ?= /opt/netsurf/m68k-atari-mint/cross/bin
- CC__ := $(GCCSDK_INSTALL_CROSSBIN)/m68k-atari-mint-gcc
- CXX__ := $(GCCSDK_INSTALL_CROSSBIN)/m68k-atari-mint-g++
- AR__ := $(GCCSDK_INSTALL_CROSSBIN)/m68k-atari-mint-ar
-
ifeq ($(ATARIARCH),68000)
ARCHFLAGS :=
ARCHDIR :=
@@ -343,22 +208,9 @@ ifeq ($(TARGET),atari)
PREFIX ?= $(GCCSDK_INSTALL_ENV)
endif
-endif
-
-# FreeMiNT / m5475_atari
-ifeq ($(TARGET),m5475_atari)
- ifeq ($(HOST),m5475_atari)
- # Building on FreeMiNT
- # Nothing to do, as we assume the default tooling works
- else
- # Cross compiling for FreeMiNT
-
- GCCSDK_INSTALL_ENV ?= /opt/netsurf/m5475-atari-mint/env
- GCCSDK_INSTALL_CROSSBIN ?= /opt/netsurf/m5475-atari-mint/cross/bin
- CC__ := $(GCCSDK_INSTALL_CROSSBIN)/m5475-atari-mint-gcc
- CXX__ := $(GCCSDK_INSTALL_CROSSBIN)/m5475-atari-mint-g++
- AR__ := $(GCCSDK_INSTALL_CROSSBIN)/m5475-atari-mint-ar
+ ifeq ($(BUILD),m5475-atari-mint)
+ # Cross compiling for FreeMiNT (m5475)
CFLAGS := $(CFLAGS) -U__STRICT_ANSI__ -I$(GCCSDK_INSTALL_ENV)/include $(ARCHFLAGS)
CXXFLAGS := $(CXXFLAGS) -U__STRICT_ANSI__ -I$(GCCSDK_INSTALL_ENV)/include $(ARCHFLAGS)
LDFLAGS := $(LDFLAGS) -L$(GCCSDK_INSTALL_ENV)/lib/m5475
@@ -367,17 +219,6 @@ ifeq ($(TARGET),m5475_atari)
endif
endif
-# OpenBSD
-ifeq ($(TARGET),OpenBSD)
- ifeq ($(HOST),OpenBSD)
- CFLAGS := $(CFLAGS) -I$(GCCSDK_INSTALL_ENV)/include -I/usr/local/include
- CXXFLAGS := $(CXXFLAGS) -I$(GCCSDK_INSTALL_ENV)/include -I/usr/local/includ
- LDFLAGS := $(LDFLAGS) -L$(GCCSDK_INSTALL_ENV)/lib -L/usr/local/lib
-
- FLEX := gflex
- endif
-endif
-
# Default prefix
PREFIX ?= /usr/local
@@ -396,15 +237,7 @@ ECHO ?= echo
GENHTML ?= genhtml
-ifeq ($(HOST),$(TARGET))
- HOST_CC ?= $(CC)
-
- HOST_CXX ?= $(CXX)
-else
- HOST_CC ?= cc
-
- HOST_CXX ?= c++
-endif
+HOST_CXX ?= c++
INSTALL ?= install
@@ -498,7 +331,7 @@ else
ccvsn := $(shell $(CC) --version 2>&1)
ifeq ($(ccvsn),)
# Version string is blank
- ifeq ($(HOST),riscos)
+ ifeq ($(HOST),arm-unknown-riscos)
# For some reason we never see the output of SCL apps, so might be
# Norcroft. However it might also be a GCC linked against a buggy
# UnixLib.
@@ -541,7 +374,7 @@ include $(NSBUILD)/Makefile.$(toolchain)
# Default assembler/compiler/linker/archiver flags
###############################################################################
-ifeq ($(BUILD),release)
+ifeq ($(VARIANT),release)
OPTCFLAGS ?= $(CCDEF)NDEBUG $(CCOPT)
OPTCXXFLAGS ?= $(CXXDEF)NDEBUG $(CXXOPT)
else
@@ -557,10 +390,8 @@ endif
# TODO: This assumes that the C compiler can cope with assembler
ASFLAGS ?= $(CCAS)
-CFLAGS := $(CFLAGS) $(OPTCFLAGS) $(CCDEF)BUILD_TARGET_$(TARGET) $(CCDEF)BUILD_HOST_$(HOST)
-CXXFLAGS := $(CXXFLAGS) $(OPTCXXFLAGS) \
- $(CXXDEF)BUILD_TARGET_$(TARGET) $(CXXDEF)BUILD_HOST_$(HOST)
-
+CFLAGS := $(CFLAGS) $(OPTCFLAGS)
+CXXFLAGS := $(CXXFLAGS) $(OPTCXXFLAGS)
ASFLAGS := $(ASFLAGS) $(CFLAGS)
LDFLAGS := $(LDFLAGS) $(OPTLDFLAGS)
diff --git a/makefiles/Makefile.top b/makefiles/Makefile.top
index 6329c47..89a040d 100644
--- a/makefiles/Makefile.top
+++ b/makefiles/Makefile.top
@@ -2,7 +2,7 @@
#
# Expected inputs:
#
-# BUILD Type of build to perform:
+# VARIANT Type of build to perform:
# release - Release build
# debug - Debug build
# COMPONENT Name of the component (sans leading "lib" iff a library)
@@ -12,12 +12,12 @@
# lib-static - Static library
# lib-shared - Shared library
# riscos-module - RISC OS module
-# TARGET Target platform identifier
+# BUILD Target platform identifier
#
# Optional inputs:
#
# BUILDDIR Directory to build into (defaults to
-# build-$(HOST)-$(TARGET)-$(BUILD)-$(COMPONENT_TYPE))
+# build-$(HOST)-$(BUILD)-$(VARIANT)-$(COMPONENT_TYPE))
# CC_CAN_BUILD_AND_DEP Flag whether $(CC) is capable of calculating dependency
# information at the same time as compiling sources.
# Set to "yes" if it can.
@@ -80,15 +80,15 @@ ifeq ($(COMPONENT_TYPE),)
endif
# Target platform must be defined by the client
-ifeq ($(TARGET),)
- $(error TARGET not defined)
-endif
-
-# Build type, too
ifeq ($(BUILD),)
$(error BUILD not defined)
endif
+# Build variant, too
+ifeq ($(VARIANT),)
+ $(error VARIANT not defined)
+endif
+
##############################################################################
# Makefile variables
##############################################################################
@@ -109,7 +109,7 @@ patch-version := $(word 3,$(subst ., ,$(COMPONENT_VERSION)))
##############################################################################
# Build directory
-BUILDDIR ?= build-$(HOST)-$(TARGET)-$(BUILD)-$(COMPONENT_TYPE)
+BUILDDIR ?= build-$(HOST)-$(BUILD)-$(VARIANT)-$(COMPONENT_TYPE)
# Build tree subdirs
COVERAGEDIR := $(BUILDDIR)/coverage