# Copyright (C) 2005-2012 Free Software Foundation, Inc.
# Contributed by Nick Burrett (nick@sqrt.co.uk>),
# John Tytgat (John.Tytgat@aaug.net) and Lee Noar (leenoar@sky.com).
#
# This file is part of GCC.
#
# GCC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GCC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING3.  If not see
# <http://www.gnu.org/licenses/>.

# The following multilib configurations are defined:
#
# <runtime library> = "" (UnixLib), "scl" (SCL application), "scl-module" (SCL module)
# <float abi>  = "" (soft), "softfp", "hard"
# <fpu> = "" (no hw fpu), "fpa" (FPA), "vfp" (VFPv2), "neon" (VFPv3 + NEON)
#
#  . : UnixLib, soft, application
#  ./softfp/vfp : UnixLib, softfp using VFPv2, application
#  ./softfp/neon : UnixLib, softfp using VFPv3 + neon, application
#  ./scl/softfp/vfp : SCL without float API, softfp using VFPv2, application
#  ./scl/softfp/neon : SCL without float API, softfp using VFPv3 + neon, application
#  ./scl/hard/fpa : SCL, FPA, application
#  ./scl-module/softfp/vfp : SCL without float API, softfp using VFPv2, module
#  ./scl-module/softfp/neon : SCL without float API, softfp using VFPv3 + neon, module
#  ./scl-module/hard/fpa : SCL, FPA, module
#
# Expanded:
# + "" / "" / ""
# - "" / "" / "fpa"
# - "" / "" / "vfp"
# - "" / "" / "neon"
# - "" / "softfp" / ""
# - "" / "softfp" / "fpa"
# + "" / "softfp" / "vfp"
# + "" / "softfp" / "neon"
# - "" / "hard" / ""
# - "" / "hard" / "fpa"
# - "" / "hard" / "vfp"
# - "" / "hard" / "neon"
# - "scl" / "" / ""
# - "scl" / "" / "fpa"
# - "scl" / "" / "vfp"
# - "scl" / "" / "neon"
# - "scl" / "softfp" / ""
# - "scl" / "softfp" / "fpa"
# + "scl" / "softfp" / "vfp"
# + "scl" / "softfp" / "neon"
# - "scl" / "hard" / ""
# + "scl" / "hard" / "fpa"
# - "scl" / "hard" / "vfp"
# - "scl" / "hard" / "neon"
# - "scl-module" / "" / ""
# - "scl-module" / "" / "fpa"
# - "scl-module" / "" / "vfp"
# - "scl-module" / "" / "neon"
# - "scl-module" / "softfp" / ""
# - "scl-module" / "softfp" / "fpa"
# + "scl-module" / "softfp" / "vfp"
# + "scl-module" / "softfp" / "neon"
# - "scl-module" / "hard" / ""
# + "scl-module" / "hard" / "fpa"
# - "scl-module" / "hard" / "vfp"
# - "scl-module" / "hard" / "neon"

MULTILIB_OPTIONS = mlibscl/mmodule mfloat-abi=softfp/mfloat-abi=hard mfpu=fpa/mfpu=vfp/mfpu=neon
MULTILIB_DIRNAMES = scl scl-module softfp hard fpa vfp neon
MULTILIB_MATCHES = mfloat-abi?hard=mhard-float
MULTILIB_EXCEPTIONS = mfpu=fpa mfpu=vfp mfpu=neon mfloat-abi=softfp mfloat-abi=softfp/mfpu=fpa mfloat-abi=hard* mlibscl mlibscl/mfpu* mlibscl/mfloat-abi=softfp mlibscl/mfloat-abi=softfp/mfpu=fpa mlibscl/mfloat-abi=hard mlibscl/mfloat-abi=hard/mfpu=vfp* mlibscl/mfloat-abi=hard/mfpu=neon* mmodule mmodule/mfpu* mmodule/mfloat-abi=softfp mmodule/mfloat-abi=softfp/mfpu=fpa mmodule/mfloat-abi=hard mmodule/mfloat-abi=hard/mfpu=vfp* mmodule/mfloat-abi=hard/mfpu=neon*

# vvv config/arm/t-bpabi
EXTRA_HEADERS += $(srcdir)/ginclude/unwind-arm-common.h
# ^^^

# Prevents fixincludes from clobbering our otherwise correct limits.h
# and therefore allows GCC to build successfully.
LIMITS_H_TEST = true

# Make local_includedir relative to EXEC_PREFIX.  We don't want the RISC OS
# compiler picking up UNIX system header files.
local_includedir=$(exec_prefix)/include

# When compiling GCC for native RISC OS, assume that C library headers are
# contained within the application.
NATIVE_SYSTEM_HEADER_DIR = $(srcdir)/../libunixlib/include
STANDARD_INCLUDE_DIR = $(srcdir)/../libunixlib/include

riscos.o: $(srcdir)/config/arm/riscos.c $(CONFIG_H)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/riscos.c

riscos-gcc.o: $(srcdir)/config/arm/riscos-gcc.c $(CONFIG_H)
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/riscos-gcc.c
