2005-10-29 20:27:43 +04:00
|
|
|
|
|
|
|
# Variable naming conventions:
|
|
|
|
# TARGET_*: A build system variable specifying a property for building for
|
|
|
|
# the target platform (usually Haiku). E.g. TARGET_CC specifies the
|
|
|
|
# compiler when building a target for the target platform.
|
|
|
|
# HOST_*: A build system variable specifying a property of the platform
|
|
|
|
# hosting the build. E.g. HOST_CC specifies the compiler when
|
|
|
|
# building a target for the host platform (a build tool for
|
|
|
|
# instance).
|
|
|
|
# HAIKU_*: A build system variable specifying a build system property. Usually
|
|
|
|
# directory paths and the like.
|
|
|
|
|
|
|
|
|
2007-07-18 03:37:40 +04:00
|
|
|
#pragma mark - container settings
|
|
|
|
|
|
|
|
# Haiku image
|
|
|
|
HAIKU_IMAGE_CONTAINER_NAME = haiku-image-container ;
|
|
|
|
HAIKU_CONTAINER_GRIST on $(HAIKU_IMAGE_CONTAINER_NAME) = HaikuImage ;
|
|
|
|
HAIKU_INCLUDE_IN_CONTAINER_VAR on $(HAIKU_IMAGE_CONTAINER_NAME)
|
|
|
|
= HAIKU_INCLUDE_IN_IMAGE ;
|
|
|
|
HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_IMAGE_CONTAINER_NAME)
|
|
|
|
= HAIKU_IMAGE_INSTALL_TARGETS ;
|
|
|
|
|
|
|
|
# network boot archive
|
|
|
|
HAIKU_NET_BOOT_ARCHIVE_CONTAINER_NAME = haiku-netboot-archive-container ;
|
|
|
|
HAIKU_CONTAINER_GRIST on $(HAIKU_NET_BOOT_ARCHIVE_CONTAINER_NAME)
|
|
|
|
= NetBootArchive ;
|
|
|
|
# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported
|
|
|
|
HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_NET_BOOT_ARCHIVE_CONTAINER_NAME)
|
|
|
|
= HAIKU_NET_BOOT_ARCHIVE_INSTALL_TARGETS ;
|
|
|
|
|
2009-05-25 05:21:32 +04:00
|
|
|
# alternative gcc archive
|
|
|
|
HAIKU_ALTERNATIVE_GCC_ARCHIVE_CONTAINER_NAME
|
|
|
|
= haiku-alternative-gcc-archive-container ;
|
|
|
|
HAIKU_CONTAINER_GRIST on $(HAIKU_ALTERNATIVE_GCC_ARCHIVE_CONTAINER_NAME)
|
|
|
|
= AlternativeGCCArchive ;
|
|
|
|
# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported
|
|
|
|
HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_ALTERNATIVE_GCC_ARCHIVE_CONTAINER_NAME)
|
|
|
|
= HAIKU_ALTERNATIVE_GCC_ARCHIVE_INSTALL_TARGETS ;
|
|
|
|
|
2008-03-02 06:05:23 +03:00
|
|
|
# boot floppy
|
|
|
|
HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME = haiku-boot-floppy-container ;
|
2008-10-02 03:56:12 +04:00
|
|
|
HAIKU_CONTAINER_GRIST on $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME)
|
|
|
|
= FloppyBootImage ;
|
2008-03-02 06:05:23 +03:00
|
|
|
# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported
|
|
|
|
HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME)
|
|
|
|
= HAIKU_FLOPPY_BOOT_IMAGE_INSTALL_TARGETS ;
|
|
|
|
|
|
|
|
# boot CD image
|
2008-03-02 07:38:29 +03:00
|
|
|
HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME = haiku-boot-cd-container ;
|
|
|
|
HAIKU_CONTAINER_GRIST on $(HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME) = CDBootImage ;
|
|
|
|
# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported
|
|
|
|
HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME)
|
|
|
|
= HAIKU_CD_BOOT_IMAGE_INSTALL_TARGETS ;
|
2007-07-18 03:37:40 +04:00
|
|
|
|
2008-11-07 05:35:46 +03:00
|
|
|
# boot CD for PPC image
|
|
|
|
HAIKU_CD_BOOT_PPC_IMAGE_CONTAINER_NAME = haiku-boot-cd-ppc-container ;
|
|
|
|
HAIKU_CONTAINER_GRIST on $(HAIKU_CD_BOOT_PPC_IMAGE_CONTAINER_NAME) = CDBootPPCImage ;
|
|
|
|
# HAIKU_INCLUDE_IN_CONTAINER_VAR -- update only mode not supported
|
|
|
|
HAIKU_INSTALL_TARGETS_VAR on $(HAIKU_CD_BOOT_PPC_IMAGE_CONTAINER_NAME)
|
|
|
|
= HAIKU_CD_BOOT_PPC_IMAGE_INSTALL_TARGETS ;
|
|
|
|
|
2008-04-03 00:29:43 +04:00
|
|
|
# Haiku image/install defaults
|
|
|
|
HAIKU_DEFAULT_IMAGE_NAME = haiku.image ;
|
|
|
|
HAIKU_DEFAULT_IMAGE_DIR = $(HAIKU_OUTPUT_DIR) ;
|
|
|
|
HAIKU_DEFAULT_VMWARE_IMAGE_NAME = haiku.vmdk ;
|
|
|
|
HAIKU_DEFAULT_INSTALL_DIR = /Haiku ;
|
2011-08-25 01:04:55 +04:00
|
|
|
HAIKU_DEFAULT_IMAGE_SIZE ?= 300 ; # 300 MB
|
2008-09-19 21:32:57 +04:00
|
|
|
HAIKU_DEFAULT_IMAGE_LABEL ?= Haiku ;
|
2008-04-03 00:29:43 +04:00
|
|
|
|
2009-02-15 05:34:32 +03:00
|
|
|
# Haiku CD defaults
|
|
|
|
HAIKU_DEFAULT_CD_NAME = haiku-cd.iso ;
|
|
|
|
HAIKU_DEFAULT_CD_DIR = $(HAIKU_OUTPUT_DIR) ;
|
|
|
|
HAIKU_DEFAULT_CD_LABEL = Haiku ;
|
|
|
|
|
2010-03-16 02:51:45 +03:00
|
|
|
# Haiku Anyboot defaults
|
|
|
|
HAIKU_DEFAULT_ANYBOOT_NAME = haiku-anyboot.image ;
|
|
|
|
HAIKU_DEFAULT_ANYBOOT_DIR = $(HAIKU_OUTPUT_DIR) ;
|
|
|
|
HAIKU_DEFAULT_ANYBOOT_LABEL ?= Haiku ;
|
|
|
|
|
2009-02-24 01:33:09 +03:00
|
|
|
# analyze and optionally replace jam's target parameters
|
|
|
|
ProcessCommandLineArguments ;
|
2007-02-22 03:59:28 +03:00
|
|
|
|
|
|
|
|
2010-07-27 13:48:36 +04:00
|
|
|
# include libgccObjects
|
2005-10-29 20:27:43 +04:00
|
|
|
{
|
|
|
|
local libgccObjects = [ GLOB $(HAIKU_BUILD_OUTPUT_DIR) : libgccObjects ] ;
|
|
|
|
|
2010-07-27 13:48:36 +04:00
|
|
|
if ! $(libgccObjects) {
|
|
|
|
ECHO "No `libgccObjects' found in"
|
2008-10-02 03:56:12 +04:00
|
|
|
"$(HAIKU_BUILD_OUTPUT_DIR)!" ;
|
|
|
|
EXIT "Please run ./configure in the source tree's root directory"
|
|
|
|
"again!" ;
|
2005-10-29 20:27:43 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
LOCATE on libgccObjects = $(HAIKU_BUILD_OUTPUT_DIR) ;
|
|
|
|
|
|
|
|
include libgccObjects ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# supported debug levels
|
|
|
|
HAIKU_DEBUG_LEVELS = 0 1 2 3 4 5 ;
|
|
|
|
|
|
|
|
# BeOS, BONE, Dan0 compatible platforms
|
2007-08-03 01:13:56 +04:00
|
|
|
HAIKU_BEOS_COMPATIBLE_PLATFORMS = haiku r5 bone dano haiku_host ;
|
|
|
|
HAIKU_BONE_COMPATIBLE_PLATFORMS = haiku bone dano haiku_host ;
|
|
|
|
HAIKU_DANO_COMPATIBLE_PLATFORMS = haiku dano haiku_host ;
|
|
|
|
HAIKU_HAIKU_COMPATIBLE_PLATFORMS = haiku haiku_host ;
|
2005-10-29 20:27:43 +04:00
|
|
|
|
2008-03-28 01:01:38 +03:00
|
|
|
# configuration header directories
|
|
|
|
HAIKU_CONFIG_HEADERS = [ FDirName $(HAIKU_TOP) build user_config_headers ]
|
|
|
|
[ FDirName $(HAIKU_TOP) build config_headers ] ;
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
|
|
|
|
# haiku target platform settings
|
|
|
|
|
2008-03-16 20:21:37 +03:00
|
|
|
# analyze GCC version
|
|
|
|
HAIKU_GCC_VERSION = [ FAnalyzeGCCVersion HAIKU_GCC_RAW_VERSION ] ;
|
|
|
|
|
2007-02-04 17:03:21 +03:00
|
|
|
# enable GCC -pipe option, if requested
|
|
|
|
if $(HAIKU_USE_GCC_PIPE) = 1 {
|
|
|
|
HAIKU_GCC_BASE_FLAGS = -pipe ;
|
|
|
|
}
|
2007-01-30 03:47:56 +03:00
|
|
|
|
2008-04-19 21:12:47 +04:00
|
|
|
# disable strict aliasing on anything newer than gcc 2 as it may lead to
|
|
|
|
# unexpected results. also disable the tree-vrp (value range propagation)
|
|
|
|
# optimization for now as with the current gcc4 version we are using this
|
|
|
|
# results in some broken code.
|
|
|
|
# TODO: remove the -fno-strict-aliasing option when all code has been
|
|
|
|
# analyzed/fixed with regard to aliasing.
|
|
|
|
# TODO: retest/remove the -fno-tree-vrp option as soon as we have updated our
|
|
|
|
# gcc4 compiler.
|
2008-04-18 13:40:53 +04:00
|
|
|
if $(HAIKU_GCC_VERSION[1]) >= 3 {
|
2008-04-19 21:12:47 +04:00
|
|
|
HAIKU_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-tree-vrp ;
|
2008-04-18 13:40:53 +04:00
|
|
|
}
|
2011-06-17 00:53:44 +04:00
|
|
|
|
|
|
|
if $(HOST_GCC_VERSION[1]) >= 3 {
|
|
|
|
HOST_GCC_BASE_FLAGS += -fno-strict-aliasing -fno-tree-vrp ;
|
|
|
|
}
|
2008-04-18 13:40:53 +04:00
|
|
|
|
2008-03-16 20:21:37 +03:00
|
|
|
# override gcc 2.95.3's header directory -- strictly necessary only when using
|
|
|
|
# the BeOS native compiler (since its headers are incompatible), but it doesn't
|
|
|
|
# harm for the cross-compiler either.
|
|
|
|
if $(HAIKU_GCC_VERSION[1]) = 2 {
|
|
|
|
HAIKU_GCC_HEADERS_DIR = [ FDirName $(HAIKU_TOP) headers build gcc-2.95.3 ] ;
|
|
|
|
}
|
|
|
|
|
2009-05-25 05:21:32 +04:00
|
|
|
# the subdirectory into which the alternative GCC libraries are to be installed
|
|
|
|
if $(HAIKU_GCC_VERSION[1]) = 2 {
|
|
|
|
HAIKU_ALTERNATIVE_GCC_LIB_SUBDIR = gcc2 ;
|
|
|
|
} else {
|
|
|
|
HAIKU_ALTERNATIVE_GCC_LIB_SUBDIR = gcc4 ;
|
|
|
|
}
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# initial state for flags etc.
|
|
|
|
HAIKU_C++ ?= $(HAIKU_CC) ;
|
|
|
|
HAIKU_LINK = $(HAIKU_CC) ;
|
2007-02-04 17:03:21 +03:00
|
|
|
HAIKU_LINKFLAGS = $(HAIKU_GCC_BASE_FLAGS) ;
|
2012-05-27 00:47:27 +04:00
|
|
|
HAIKU_BOOT_LINKFLAGS = ;
|
2005-10-29 20:27:43 +04:00
|
|
|
|
|
|
|
HAIKU_HDRS = [ FStandardHeaders ] ;
|
2011-11-04 00:54:21 +04:00
|
|
|
HAIKU_KERNEL_CCFLAGS = $(HAIKU_CCFLAGS) $(HAIKU_GCC_BASE_FLAGS) ;
|
|
|
|
HAIKU_KERNEL_C++FLAGS = $(HAIKU_C++FLAGS) $(HAIKU_GCC_BASE_FLAGS) ;
|
2012-05-27 00:47:27 +04:00
|
|
|
HAIKU_BOOT_CCFLAGS = $(HAIKU_CCFLAGS) $(HAIKU_GCC_BASE_FLAGS) ;
|
|
|
|
HAIKU_BOOT_C++FLAGS = $(HAIKU_C++FLAGS) $(HAIKU_GCC_BASE_FLAGS) ;
|
2011-11-04 00:54:21 +04:00
|
|
|
HAIKU_CCFLAGS += $(HAIKU_GCC_BASE_FLAGS) -nostdinc ;
|
|
|
|
HAIKU_C++FLAGS += $(HAIKU_GCC_BASE_FLAGS) -nostdinc ;
|
2005-10-29 20:27:43 +04:00
|
|
|
HAIKU_DEFINES = __HAIKU__ ;
|
2009-07-22 21:34:13 +04:00
|
|
|
HAIKU_NO_WERROR ?= 0 ;
|
2005-10-29 20:27:43 +04:00
|
|
|
|
2007-05-20 21:50:11 +04:00
|
|
|
# distro compatibility level defines
|
|
|
|
HAIKU_DISTRO_COMPATIBILITY ?= "default" ;
|
|
|
|
switch $(HAIKU_DISTRO_COMPATIBILITY) {
|
2010-07-26 00:34:17 +04:00
|
|
|
case official : {
|
|
|
|
HAIKU_DEFINES += HAIKU_DISTRO_COMPATIBILITY_OFFICIAL ;
|
|
|
|
HAIKU_INCLUDE_TRADEMARKS = "" ;
|
|
|
|
}
|
|
|
|
case compatible : {
|
|
|
|
HAIKU_DEFINES += HAIKU_DISTRO_COMPATIBILITY_COMPATIBLE ;
|
|
|
|
HAIKU_INCLUDE_TRADEMARKS = "" ;
|
|
|
|
}
|
|
|
|
case "default" : {
|
|
|
|
HAIKU_DEFINES += HAIKU_DISTRO_COMPATIBILITY_DEFAULT ;
|
|
|
|
HAIKU_INCLUDE_TRADEMARKS = ;
|
|
|
|
}
|
2007-05-20 21:50:11 +04:00
|
|
|
case * : Exit "Invalid value for HAIKU_DISTRO_COMPATIBILITY:"
|
|
|
|
$(HAIKU_DISTRO_COMPATIBILITY) ;
|
|
|
|
}
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# analyze the gcc machine spec to determine HAIKU_CPU
|
|
|
|
switch $(HAIKU_GCC_MACHINE) {
|
2010-01-03 01:11:08 +03:00
|
|
|
case i?86-* : HAIKU_CPU = x86 ;
|
2010-05-11 23:40:06 +04:00
|
|
|
case x86_64-* : HAIKU_CPU = x86_64 ;
|
2005-12-07 01:47:04 +03:00
|
|
|
case powerpc-* : HAIKU_CPU = ppc ;
|
2010-01-03 01:11:08 +03:00
|
|
|
case m68k-* : HAIKU_CPU = m68k ;
|
2009-05-02 23:03:19 +04:00
|
|
|
case mipsel-* : HAIKU_CPU = mipsel ;
|
2010-01-03 01:11:08 +03:00
|
|
|
case arm-* : HAIKU_CPU = arm ;
|
2010-01-04 20:50:52 +03:00
|
|
|
case * : Exit "Unsupported gcc target machine:"
|
2010-01-03 01:11:08 +03:00
|
|
|
$(HAIKU_GCC_MACHINE) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# determine the endianness of the host
|
|
|
|
switch $(HOST_GCC_MACHINE) {
|
2010-01-21 07:04:51 +03:00
|
|
|
case amd64-* : HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
|
2010-01-03 01:11:08 +03:00
|
|
|
case i?86-* : HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
|
|
|
|
case powerpc-* : HAIKU_HOST_IS_BIG_ENDIAN = 1 ;
|
2010-01-21 07:04:51 +03:00
|
|
|
case x86_64-* : HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
|
|
|
|
|
2010-01-03 01:11:08 +03:00
|
|
|
# the following are rather unlikely as hosts ...
|
2010-01-21 07:04:51 +03:00
|
|
|
case arm-* : HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
|
2010-01-03 01:11:08 +03:00
|
|
|
case m68k-* : HAIKU_HOST_IS_BIG_ENDIAN = 1 ;
|
|
|
|
case mipsel-* : HAIKU_HOST_IS_BIG_ENDIAN = 0 ;
|
|
|
|
case * : Exit "Unsupported gcc host machine:" $(HOST_GCC_MACHINE) ;
|
2005-10-29 20:27:43 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
switch $(HAIKU_CPU) {
|
|
|
|
case ppc :
|
|
|
|
{
|
|
|
|
HAIKU_DEFINES += __POWERPC__ ;
|
2011-11-13 02:46:40 +04:00
|
|
|
HAIKU_BOOT_PLATFORM ?= openfirmware ;
|
2009-04-27 23:28:13 +04:00
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # in kB
|
2009-04-03 13:02:44 +04:00
|
|
|
# offset in floppy image (>= sizeof(haiku_loader))
|
2008-11-15 06:30:00 +03:00
|
|
|
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet
|
2005-10-29 20:27:43 +04:00
|
|
|
}
|
2009-07-22 21:17:09 +04:00
|
|
|
case arm :
|
|
|
|
{
|
|
|
|
HAIKU_DEFINES += __ARM__ ;
|
2012-04-29 03:35:38 +04:00
|
|
|
HAIKU_BOOT_PLATFORM ?= u-boot ;
|
2009-08-05 20:00:13 +04:00
|
|
|
HAIKU_BOOT_BOARD ?= verdex ;
|
2009-08-12 18:47:46 +04:00
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
|
|
|
|
# in kB (there is not really a floppy on the gumstix ;) )
|
2009-07-22 21:17:09 +04:00
|
|
|
# offset in floppy image (>= sizeof(haiku_loader))
|
|
|
|
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet
|
2009-08-12 18:47:46 +04:00
|
|
|
HAIKU_NO_WERROR = 1 ;
|
|
|
|
# we use #warning as placeholders for things to write...
|
2009-07-22 21:17:09 +04:00
|
|
|
}
|
2005-10-29 20:27:43 +04:00
|
|
|
case x86 :
|
|
|
|
{
|
|
|
|
HAIKU_DEFINES += __INTEL__ ;
|
|
|
|
HAIKU_BOOT_PLATFORM = bios_ia32 ;
|
2009-08-18 18:56:59 +04:00
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
|
2009-04-03 13:02:44 +04:00
|
|
|
# offset in floppy image (>= sizeof(haiku_loader))
|
2009-08-18 18:56:59 +04:00
|
|
|
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB
|
2009-04-13 14:50:17 +04:00
|
|
|
|
|
|
|
# yasm is required for target arch x86
|
|
|
|
if ! $(HAIKU_YASM) {
|
|
|
|
Exit "HAIKU_YASM not set. Please re-run configure." ;
|
|
|
|
}
|
2005-10-29 20:27:43 +04:00
|
|
|
}
|
2010-05-11 23:40:06 +04:00
|
|
|
case x86_64 :
|
|
|
|
{
|
|
|
|
HAIKU_BOOT_PLATFORM = bios_ia32 ;
|
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
|
|
|
|
# offset in floppy image (>= sizeof(haiku_loader))
|
|
|
|
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB
|
|
|
|
|
|
|
|
# yasm is required for target arch x86_64
|
|
|
|
if ! $(HAIKU_YASM) {
|
|
|
|
Exit "HAIKU_YASM not set. Please re-run configure." ;
|
|
|
|
}
|
|
|
|
}
|
2007-10-24 03:27:09 +04:00
|
|
|
case m68k :
|
|
|
|
{
|
|
|
|
HAIKU_DEFINES += __M68K__ ;
|
2010-10-27 19:51:54 +04:00
|
|
|
HAIKU_BOOT_PLATFORM ?= atari_m68k ;
|
|
|
|
switch $(HAIKU_BOOT_PLATFORM) {
|
|
|
|
case atari_m68k :
|
|
|
|
{
|
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # in kB
|
|
|
|
}
|
|
|
|
case amiga_m68k :
|
|
|
|
{
|
|
|
|
# for now we have trouble reading from double-sided images
|
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 880 ; # in kB
|
|
|
|
}
|
|
|
|
}
|
2009-04-03 13:02:44 +04:00
|
|
|
# offset in floppy image (>= sizeof(haiku_loader))
|
2011-11-03 06:42:27 +04:00
|
|
|
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 260 ; # in kB
|
2009-08-12 18:47:46 +04:00
|
|
|
HAIKU_NO_WERROR = 1 ;
|
|
|
|
# we use #warning as placeholders for things to write...
|
2007-10-24 03:27:09 +04:00
|
|
|
}
|
2009-05-02 23:03:19 +04:00
|
|
|
case mipsel :
|
|
|
|
{
|
|
|
|
HAIKU_DEFINES += __MIPSEL__ ;
|
|
|
|
# RouterBOARD firmware (ELF image over TFTP)
|
2009-08-22 05:48:18 +04:00
|
|
|
HAIKU_BOOT_PLATFORM = routerboard_mipsel ;
|
2009-05-02 23:03:19 +04:00
|
|
|
# offset in floppy image (>= sizeof(haiku_loader))
|
2009-08-22 05:48:18 +04:00
|
|
|
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB
|
|
|
|
HAIKU_NO_WERROR = 1 ;
|
|
|
|
# we use #warning as placeholders for things to write...
|
2009-05-02 23:03:19 +04:00
|
|
|
}
|
2005-10-29 20:27:43 +04:00
|
|
|
case * :
|
|
|
|
Exit "Currently unsupported target CPU:" $(HAIKU_CPU) ;
|
|
|
|
}
|
2012-05-11 19:53:30 +04:00
|
|
|
|
|
|
|
# Include embedded board-specific file.
|
|
|
|
if $(HAIKU_BOOT_BOARD) {
|
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) board $(HAIKU_BOOT_BOARD)
|
|
|
|
BoardSetup ] ;
|
|
|
|
}
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
HAIKU_ARCH ?= $(HAIKU_CPU) ;
|
|
|
|
HAIKU_ARCH_MACRO_DEFINE = ARCH_$(HAIKU_ARCH) ;
|
|
|
|
HAIKU_DEFINES += $(HAIKU_ARCH_MACRO_DEFINE) ;
|
2008-11-15 06:30:00 +03:00
|
|
|
HAIKU_DEFINES += BOOT_ARCHIVE_IMAGE_OFFSET=$(HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET) ;
|
2009-08-28 00:55:26 +04:00
|
|
|
HAIKU_ATA_STACK ?= 1 ;
|
2005-10-29 20:27:43 +04:00
|
|
|
|
|
|
|
# directories
|
|
|
|
HAIKU_OBJECT_BASE_DIR = [ FDirName $(HAIKU_OBJECT_DIR) haiku ] ;
|
|
|
|
HAIKU_COMMON_ARCH_OBJECT_DIR = [ FDirName $(HAIKU_OBJECT_BASE_DIR) common ] ;
|
|
|
|
HAIKU_ARCH_OBJECT_DIR = [ FDirName $(HAIKU_OBJECT_BASE_DIR) $(HAIKU_ARCH) ] ;
|
|
|
|
HAIKU_COMMON_DEBUG_OBJECT_DIR = [ FDirName $(HAIKU_ARCH_OBJECT_DIR) common ] ;
|
|
|
|
HAIKU_DEBUG_0_OBJECT_DIR = [ FDirName $(HAIKU_ARCH_OBJECT_DIR) release ] ;
|
|
|
|
|
|
|
|
local level ;
|
|
|
|
for level in $(HAIKU_DEBUG_LEVELS[2-]) {
|
|
|
|
HAIKU_DEBUG_$(level)_OBJECT_DIR
|
|
|
|
= [ FDirName $(HAIKU_ARCH_OBJECT_DIR) debug_$(level) ] ;
|
|
|
|
}
|
|
|
|
|
2005-11-13 01:58:54 +03:00
|
|
|
# set variables for gcc header options
|
|
|
|
SetIncludePropertiesVariables HAIKU ;
|
2005-10-29 20:27:43 +04:00
|
|
|
|
|
|
|
# assembler flags
|
|
|
|
HAIKU_ASFLAGS = ;
|
|
|
|
|
|
|
|
# C/C++ flags
|
2009-12-20 16:55:45 +03:00
|
|
|
HAIKU_KERNEL_CCFLAGS += -finline -fno-builtin ;
|
|
|
|
HAIKU_KERNEL_C++FLAGS += -finline -fno-builtin -fno-exceptions ;
|
2008-01-11 03:36:44 +03:00
|
|
|
HAIKU_KERNEL_DEFINES += _KERNEL_MODE ;
|
2012-05-27 00:47:27 +04:00
|
|
|
HAIKU_BOOT_CCFLAGS += -finline -fno-builtin ;
|
|
|
|
HAIKU_BOOT_C++FLAGS += -finline -fno-builtin -fno-exceptions ;
|
2005-10-29 20:27:43 +04:00
|
|
|
|
|
|
|
if $(HAIKU_GCC_VERSION[1]) >= 3 {
|
|
|
|
HAIKU_KERNEL_C++FLAGS += -fno-use-cxa-atexit ;
|
|
|
|
}
|
|
|
|
|
2006-11-08 02:47:33 +03:00
|
|
|
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
|
|
|
HAIKU_C++FLAGS += -Wno-deprecated ;
|
2009-01-23 03:40:41 +03:00
|
|
|
|
|
|
|
if $(HAIKU_GCC_VERSION[2]) >= 3 {
|
|
|
|
HAIKU_KERNEL_CCFLAGS += -ffreestanding ;
|
|
|
|
HAIKU_KERNEL_C++FLAGS += -ffreestanding ;
|
2012-05-27 00:47:27 +04:00
|
|
|
HAIKU_BOOT_CCFLAGS += -ffreestanding ;
|
|
|
|
HAIKU_BOOT_C++FLAGS += -ffreestanding ;
|
2009-01-23 03:40:41 +03:00
|
|
|
}
|
2006-11-08 02:47:33 +03:00
|
|
|
}
|
|
|
|
|
2005-12-31 00:20:07 +03:00
|
|
|
HAIKU_KERNEL_PIC_CCFLAGS = -fno-pic ;
|
|
|
|
HAIKU_KERNEL_PIC_LINKFLAGS = ;
|
2010-01-11 23:36:24 +03:00
|
|
|
|
|
|
|
switch $(HAIKU_ARCH) {
|
|
|
|
case ppc :
|
|
|
|
{
|
|
|
|
# Build a position independent PPC kernel. We need to be able to
|
|
|
|
# relocate the kernel, since the virtual address space layout at boot
|
|
|
|
# time is not fixed.
|
|
|
|
HAIKU_KERNEL_PIC_CCFLAGS = -fPIE ;
|
|
|
|
HAIKU_KERNEL_PIC_LINKFLAGS = -shared -fPIE ;
|
|
|
|
}
|
|
|
|
|
|
|
|
case m68k :
|
|
|
|
{
|
|
|
|
# We don't want to have to handle emulating missing FPU opcodes for 040
|
|
|
|
# and 060 in the kernel.
|
|
|
|
HAIKU_KERNEL_CCFLAGS += -m68020-60 ;
|
|
|
|
HAIKU_KERNEL_C++FLAGS += -m68020-60 ;
|
|
|
|
}
|
2010-01-12 00:12:37 +03:00
|
|
|
case x86 :
|
|
|
|
{
|
2011-11-04 00:54:21 +04:00
|
|
|
HAIKU_CCFLAGS += -march=pentium ;
|
|
|
|
HAIKU_C++FLAGS += -march=pentium ;
|
|
|
|
HAIKU_KERNEL_CCFLAGS += -march=pentium ;
|
|
|
|
HAIKU_KERNEL_C++FLAGS += -march=pentium ;
|
2010-01-12 00:38:07 +03:00
|
|
|
|
|
|
|
# Enable use of the gcc built-in atomic functions instead of atomic_*().
|
|
|
|
# The former are inlined and have thus less overhead. They are not
|
|
|
|
# available with gcc 2, but the header will take care of that.
|
|
|
|
HAIKU_DEFINES += B_USE_BUILTIN_ATOMIC_FUNCTIONS ;
|
2010-01-12 00:12:37 +03:00
|
|
|
}
|
2010-05-11 23:40:06 +04:00
|
|
|
case x86_64 :
|
|
|
|
{
|
2012-06-15 23:05:25 +04:00
|
|
|
# Kernel lives in the top 2GB of the address space, use kernel code
|
|
|
|
# model. Also disable the red zone, which cannot be used in kernel
|
|
|
|
# code due to interrupts.
|
|
|
|
HAIKU_KERNEL_CCFLAGS += -mcmodel=kernel -mno-red-zone ;
|
|
|
|
HAIKU_KERNEL_C++FLAGS += -mcmodel=kernel -mno-red-zone ;
|
2012-05-27 00:47:27 +04:00
|
|
|
|
|
|
|
# Bootloader is 32-bit.
|
|
|
|
HAIKU_BOOT_LINKFLAGS += -m elf_i386_haiku ;
|
2012-06-20 00:54:40 +04:00
|
|
|
HAIKU_BOOT_CCFLAGS += -m32 -march=pentium ;
|
|
|
|
HAIKU_BOOT_C++FLAGS += -m32 -march=pentium ;
|
2012-05-27 00:47:27 +04:00
|
|
|
|
2010-05-11 23:40:06 +04:00
|
|
|
# Enable use of the gcc built-in atomic functions instead of atomic_*().
|
|
|
|
# The former are inlined and have thus less overhead.
|
|
|
|
HAIKU_DEFINES += B_USE_BUILTIN_ATOMIC_FUNCTIONS ;
|
|
|
|
}
|
2009-05-02 23:03:19 +04:00
|
|
|
}
|
2005-12-31 00:20:07 +03:00
|
|
|
|
2009-08-21 21:20:23 +04:00
|
|
|
# If the environment variable HAIKU_INCLUDE_PATENTED_CODE is defined, we
|
|
|
|
# define an equally named macro to the variable value. Some components use the
|
|
|
|
# macro to allow compilation of code known to implemented patented ideas and/or
|
|
|
|
# techniques, for example the Freetype bytecode hinter or sub-pixel rendering
|
|
|
|
# as well as some problematic media codecs.
|
|
|
|
if $(HAIKU_INCLUDE_PATENTED_CODE) {
|
2009-12-20 16:40:12 +03:00
|
|
|
HAIKU_DEFINES
|
|
|
|
+= HAIKU_INCLUDE_PATENTED_CODE=$(HAIKU_INCLUDE_PATENTED_CODE) ;
|
2009-08-21 21:20:23 +04:00
|
|
|
}
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# warning flags
|
2008-10-02 03:56:12 +04:00
|
|
|
HAIKU_WARNING_CCFLAGS = -Wall -Wno-trigraphs -Wmissing-prototypes
|
2008-10-03 01:25:10 +04:00
|
|
|
-Wpointer-arith -Wcast-align -Wsign-compare -Wno-multichar ;
|
2007-10-25 17:22:01 +04:00
|
|
|
HAIKU_WARNING_C++FLAGS = -Wall -Wno-trigraphs -Wno-ctor-dtor-privacy
|
2008-10-03 01:25:10 +04:00
|
|
|
-Woverloaded-virtual -Wpointer-arith -Wcast-align -Wsign-compare
|
|
|
|
-Wno-multichar ;
|
2005-10-29 20:27:43 +04:00
|
|
|
|
2008-07-15 15:52:08 +04:00
|
|
|
HAIKU_KERNEL_WARNING_CCFLAGS = -Wall -Wno-trigraphs -Wmissing-prototypes
|
|
|
|
-Wno-multichar ;
|
|
|
|
HAIKU_KERNEL_WARNING_C++FLAGS = -Wall -Wno-trigraphs -Wno-multichar ;
|
2005-10-29 20:27:43 +04:00
|
|
|
|
|
|
|
# debug flags
|
|
|
|
HAIKU_DEBUG_FLAGS ?= -ggdb ;
|
|
|
|
|
|
|
|
# debug 0: suppress asserts
|
|
|
|
HAIKU_DEBUG_0_CCFLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
|
|
|
|
HAIKU_DEBUG_0_C++FLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
|
|
|
|
|
|
|
|
HAIKU_KERNEL_DEBUG_0_CCFLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
|
|
|
|
HAIKU_KERNEL_DEBUG_0_C++FLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
|
|
|
|
|
|
|
|
local level ;
|
|
|
|
for level in $(HAIKU_DEBUG_LEVELS[2-]) {
|
|
|
|
local flags = $(HAIKU_DEBUG_FLAGS) [ FDefines DEBUG=$(level) ] ;
|
|
|
|
HAIKU_DEBUG_$(level)_CCFLAGS = $(flags) ;
|
|
|
|
HAIKU_DEBUG_$(level)_C++FLAGS = $(flags) ;
|
|
|
|
HAIKU_KERNEL_DEBUG_$(level)_CCFLAGS = $(flags) ;
|
|
|
|
HAIKU_KERNEL_DEBUG_$(level)_C++FLAGS = $(flags) ;
|
|
|
|
}
|
|
|
|
|
2005-11-14 16:47:52 +03:00
|
|
|
if $(HAIKU_GCC_VERSION[1]) >= 3 {
|
|
|
|
# TODO: Temporary work-around. Should be defined in the compiler specs
|
|
|
|
HAIKU_LINKFLAGS += -Xlinker --no-undefined ;
|
|
|
|
} else {
|
|
|
|
HAIKU_DEFINES += _BEOS_R5_COMPATIBLE_ ;
|
|
|
|
}
|
2005-11-13 01:58:54 +03:00
|
|
|
|
2008-05-14 07:55:16 +04:00
|
|
|
# private shared kernel/libroot headers
|
|
|
|
HAIKU_PRIVATE_SYSTEM_HEADERS =
|
|
|
|
[ PrivateHeaders $(DOT) system system/arch/$(HAIKU_ARCH) ]
|
|
|
|
;
|
|
|
|
|
2008-01-19 19:34:29 +03:00
|
|
|
# private kernel headers to be used when compiling kernel code
|
2005-10-29 20:27:43 +04:00
|
|
|
HAIKU_PRIVATE_KERNEL_HEADERS =
|
2009-12-19 17:23:44 +03:00
|
|
|
[ PrivateHeaders $(DOT) kernel libroot shared
|
2005-10-29 20:27:43 +04:00
|
|
|
kernel/boot/platform/$(HAIKU_BOOT_PLATFORM) ]
|
|
|
|
[ ArchHeaders $(HAIKU_ARCH) ]
|
2009-12-02 13:56:10 +03:00
|
|
|
[ FDirName $(HAIKU_COMMON_DEBUG_OBJECT_DIR) system kernel ]
|
2008-05-14 07:55:16 +04:00
|
|
|
$(HAIKU_PRIVATE_SYSTEM_HEADERS)
|
2005-10-29 20:27:43 +04:00
|
|
|
;
|
|
|
|
|
|
|
|
# Add some grist to the libgcc objects
|
|
|
|
HAIKU_GCC_LIBGCC_OBJECTS = $(HAIKU_GCC_LIBGCC_OBJECTS:G=libgcc) ;
|
|
|
|
|
2010-02-03 23:19:53 +03:00
|
|
|
# the C++ standard library
|
|
|
|
HAIKU_BUILD_SHARED_LIBSTDC++ = ;
|
2005-11-13 01:58:54 +03:00
|
|
|
if $(HAIKU_SHARED_LIBSTDC++) {
|
|
|
|
HAIKU_LIBSTDC++ = $(HAIKU_SHARED_LIBSTDC++) ;
|
|
|
|
} else {
|
2010-02-03 23:19:53 +03:00
|
|
|
# no shared library available with the compiler -- build it
|
|
|
|
if $(HAIKU_GCC_VERSION[1]) = 2 {
|
|
|
|
HAIKU_LIBSTDC++ = libstdc++.r4.so ;
|
|
|
|
} else {
|
|
|
|
HAIKU_LIBSTDC++ = libstdc++.so ;
|
|
|
|
}
|
2009-06-21 21:04:32 +04:00
|
|
|
HAIKU_SHARED_LIBSTDC++ = $(HAIKU_LIBSTDC++) ;
|
2010-02-03 23:19:53 +03:00
|
|
|
HAIKU_BUILD_SHARED_LIBSTDC++ = 1 ;
|
2005-11-13 01:58:54 +03:00
|
|
|
}
|
|
|
|
|
2010-02-03 23:19:53 +03:00
|
|
|
# the C++ support (runtime) library
|
|
|
|
HAIKU_BUILD_SHARED_LIBSUPC++ = ;
|
2005-11-14 16:47:52 +03:00
|
|
|
if $(HAIKU_SHARED_LIBSUPC++) {
|
|
|
|
HAIKU_LIBSUPC++ = $(HAIKU_SHARED_LIBSUPC++) ;
|
2005-11-13 01:58:54 +03:00
|
|
|
} else {
|
2010-02-03 23:19:53 +03:00
|
|
|
# no shared library available with the compiler -- build it for gcc 4
|
|
|
|
if $(HAIKU_GCC_VERSION[1]) != 2 {
|
|
|
|
HAIKU_SHARED_LIBSUPC++ = libsupc++.so ;
|
|
|
|
HAIKU_BUILD_SHARED_LIBSUPC++ = 1 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
HAIKU_LIBSUPC++ = $(HAIKU_SHARED_LIBSUPC++) ;
|
2005-11-13 01:58:54 +03:00
|
|
|
}
|
2005-10-29 20:27:43 +04:00
|
|
|
|
2010-07-01 15:54:09 +04:00
|
|
|
|
2007-08-13 02:15:10 +04:00
|
|
|
# network libraries
|
|
|
|
HAIKU_NETWORK_LIBS = network ;
|
2008-05-14 17:49:48 +04:00
|
|
|
HAIKU_NETAPI_LIB = bnetapi ;
|
2007-08-13 02:15:10 +04:00
|
|
|
HAIKU_SELECT_UNAME_ETC_LIB = ; # libroot, against which we link anyway
|
|
|
|
|
2010-07-01 15:54:09 +04:00
|
|
|
|
|
|
|
# locale libraries
|
2012-04-05 00:23:14 +04:00
|
|
|
HAIKU_LOCALE_LIBS = liblocalestub.a ;
|
2010-07-01 15:54:09 +04:00
|
|
|
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# library and executable glue code
|
|
|
|
local commonGlueCode =
|
|
|
|
<src!system!glue>init_term_dyn.o
|
|
|
|
<src!system!glue!arch!$(HAIKU_ARCH)>crti.o
|
|
|
|
<src!system!glue!arch!$(HAIKU_ARCH)>crtn.o
|
|
|
|
;
|
|
|
|
HAIKU_LIBRARY_BEGIN_GLUE_CODE =
|
|
|
|
<src!system!glue!arch!$(HAIKU_ARCH)>crti.o
|
|
|
|
crtbegin.o
|
|
|
|
<src!system!glue>init_term_dyn.o
|
|
|
|
;
|
|
|
|
HAIKU_LIBRARY_END_GLUE_CODE =
|
|
|
|
crtend.o
|
|
|
|
<src!system!glue!arch!$(HAIKU_ARCH)>crtn.o
|
|
|
|
;
|
|
|
|
HAIKU_EXECUTABLE_BEGIN_GLUE_CODE =
|
|
|
|
<src!system!glue!arch!$(HAIKU_ARCH)>crti.o
|
|
|
|
crtbegin.o
|
|
|
|
<src!system!glue>start_dyn.o
|
|
|
|
<src!system!glue>init_term_dyn.o
|
|
|
|
;
|
|
|
|
HAIKU_EXECUTABLE_END_GLUE_CODE = $(HAIKU_LIBRARY_END_GLUE_CODE) ;
|
2009-05-21 19:04:37 +04:00
|
|
|
HAIKU_KERNEL_ADDON_BEGIN_GLUE_CODE = crtbegin.o
|
|
|
|
<src!system!glue>haiku_version_glue.o ;
|
2007-08-02 21:50:17 +04:00
|
|
|
HAIKU_KERNEL_ADDON_END_GLUE_CODE = $(HAIKU_GCC_LIBGCC) crtend.o ;
|
2005-10-29 20:27:43 +04:00
|
|
|
|
|
|
|
SEARCH on crtbegin.o crtend.o = $(HAIKU_GCC_LIB_DIR) ;
|
|
|
|
|
|
|
|
HAIKU_EXECUTABLE_MIME_TYPE = "application/x-vnd.Be-elfexecutable" ;
|
|
|
|
|
|
|
|
# TODO: The version stuff should probably go into a separate file and be made
|
|
|
|
# available as macro, too.
|
|
|
|
# Set our version number if not already set and mark it as a developer build
|
|
|
|
if ! $(HAIKU_BUILD_VERSION) {
|
|
|
|
HAIKU_BUILD_VERSION ?= "1 0 0 a 1" ;
|
|
|
|
HAIKU_BUILD_DESCRIPTION ?= "Developer Build" ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# If HAIKU_BUILD_VERSION is set, but HAIKU_BUILD_DESCRIPTION isn't, mark it as
|
|
|
|
# an unknown build.
|
|
|
|
HAIKU_BUILD_DESCRIPTION ?= "Unknown Build" ;
|
|
|
|
|
|
|
|
# init library name map
|
|
|
|
{
|
|
|
|
local i ;
|
2010-05-05 13:17:52 +04:00
|
|
|
for i in be bnetapi debug game GL locale mail media midi midi2 network
|
2011-01-22 01:18:58 +03:00
|
|
|
opengl package root screensaver textencoding tracker translation
|
|
|
|
z {
|
2005-10-29 20:27:43 +04:00
|
|
|
HAIKU_LIBRARY_NAME_MAP_$(i) = lib$(i).so ;
|
|
|
|
}
|
2005-11-13 01:58:54 +03:00
|
|
|
HAIKU_LIBRARY_NAME_MAP_libstdc++ = $(HAIKU_LIBSTDC++) ;
|
2009-07-07 14:30:09 +04:00
|
|
|
HAIKU_LIBRARY_NAME_MAP_libsupc++ = $(HAIKU_LIBSUPC++) ;
|
2006-08-09 12:13:07 +04:00
|
|
|
HAIKU_LIBRARY_NAME_MAP_input_server = <nogrist>input_server ;
|
2005-10-29 20:27:43 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
|
|
|
|
# host platform settings
|
|
|
|
|
2009-11-24 21:57:49 +03:00
|
|
|
# analyze the host gcc machine spec to find out about 64-bitness
|
|
|
|
HOST_PLATFORM_IS_64_BIT = ;
|
2011-06-17 00:53:44 +04:00
|
|
|
switch $(HOST_GCC_MACHINE) {
|
|
|
|
case amd64-* : HOST_PLATFORM_IS_64_BIT = 1 ;
|
2011-11-13 01:23:21 +04:00
|
|
|
case i686-apple-darwin10 : HOST_PLATFORM_IS_64_BIT = 1 ;
|
|
|
|
case i686-apple-darwin11 : HOST_PLATFORM_IS_64_BIT = 1 ;
|
2011-06-17 00:53:44 +04:00
|
|
|
case x86_64-* : HOST_PLATFORM_IS_64_BIT = 1 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# If HAIKU_HOST_USE_32BIT is set, add the required gcc base flag (the LD flag
|
|
|
|
# is set later), or, if the architecture isn't actually 64 bit, clear
|
|
|
|
# HAIKU_HOST_USE_32BIT.
|
|
|
|
# Afterwards HOST_PLATFORM_IS_64_BIT will indicate whether the architecture is
|
|
|
|
# effectively (i.e. when using the compiler/linker flags) 64 bit and
|
|
|
|
# HAIKU_HOST_USE_32BIT will be set, iff the architecture is really 64 bit and
|
|
|
|
# 32 bit mode was requested.
|
2007-08-23 02:07:03 +04:00
|
|
|
if $(HAIKU_HOST_USE_32BIT) = 1 {
|
2011-06-17 00:53:44 +04:00
|
|
|
if $(HOST_PLATFORM_IS_64_BIT) {
|
|
|
|
# enable GCC -m32 option
|
|
|
|
HOST_GCC_BASE_FLAGS = -m32 ;
|
|
|
|
HOST_PLATFORM_IS_64_BIT = ;
|
|
|
|
} else {
|
|
|
|
HAIKU_HOST_USE_32BIT = 0 ;
|
2009-11-24 21:57:49 +03:00
|
|
|
}
|
2007-08-23 02:07:03 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# save jam's variables for the build platform
|
|
|
|
HOST_AR ?= $(AR) ;
|
|
|
|
HOST_CC ?= $(CC) ;
|
|
|
|
HOST_C++ ?= $(C++) ;
|
|
|
|
HOST_LINK ?= $(LINK) ;
|
|
|
|
HOST_RANLIB ?= $(RANLIB) ;
|
|
|
|
HOST_CPPFLAGS ?= $(CPPFLAGS) ;
|
2007-08-23 02:07:03 +04:00
|
|
|
HOST_CCFLAGS ?= $(HOST_GCC_BASE_FLAGS) $(CCFLAGS) ;
|
|
|
|
HOST_C++FLAGS ?= $(HOST_GCC_BASE_FLAGS) $(C++FLAGS) ;
|
2011-06-17 00:53:44 +04:00
|
|
|
HOST_LDFLAGS ?= $(LDFLAGS) ;
|
2007-08-23 02:07:03 +04:00
|
|
|
HOST_LINKFLAGS ?= $(HOST_GCC_BASE_FLAGS) $(LINKFLAGS) ;
|
2005-10-29 20:27:43 +04:00
|
|
|
HOST_DEFINES ?= $(DEFINES) ;
|
|
|
|
HOST_HDRS ?= $(HDRS) ;
|
|
|
|
|
2007-08-23 02:07:03 +04:00
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# split up HOST_AR into the command name and flags
|
|
|
|
HOST_AR = [ Match "([^ ]*) *(.*)" : $(HOST_AR[1]) ]
|
|
|
|
$(HOST_AR[2-]) ;
|
|
|
|
HOST_ARFLAGS = $(HOST_AR[2-]) ;
|
|
|
|
HOST_AR = $(HOST_AR[1]) ;
|
|
|
|
HOST_UNARFLAGS ?= x ;
|
|
|
|
|
|
|
|
# check the host platform compatibility
|
2007-05-18 19:59:04 +04:00
|
|
|
SetPlatformCompatibilityFlagVariables HOST_PLATFORM : HOST : host
|
2008-10-20 23:44:06 +04:00
|
|
|
: linux openbsd freebsd darwin sunos cygwin ;
|
2005-10-29 20:27:43 +04:00
|
|
|
|
2007-05-18 19:59:04 +04:00
|
|
|
if $(HOST_PLATFORM) = linux || $(HOST_PLATFORM) = freebsd
|
2008-08-09 19:36:24 +04:00
|
|
|
|| $(HOST_PLATFORM) = darwin || $(HOST_PLATFORM) = cygwin
|
2008-10-20 23:44:06 +04:00
|
|
|
|| $(HOST_PLATFORM) = sunos || $(HOST_PLATFORM) = openbsd {
|
2005-10-29 20:27:43 +04:00
|
|
|
# don't use lex: otherwise rc will not work correctly
|
|
|
|
if $(LEX) = lex {
|
|
|
|
LEX = flex ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-24 02:20:37 +04:00
|
|
|
if $(HOST_PLATFORM) = cygwin {
|
2008-10-02 03:56:12 +04:00
|
|
|
HOST_LINKFLAGS += -Xlinker --allow-multiple-definition -Xlinker
|
|
|
|
--enable-auto-import ;
|
2008-07-24 02:20:37 +04:00
|
|
|
}
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
HOST_CPU ?= $(OSPLAT:L) ;
|
|
|
|
|
2011-06-16 21:58:24 +04:00
|
|
|
# Jam doesn't know x86_64, so override HOST_CPU, if 64 bit.
|
|
|
|
if $(HOST_CPU) = x86 && $(HOST_PLATFORM_IS_64_BIT) {
|
|
|
|
HOST_CPU = x86_64 ;
|
|
|
|
}
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
HOST_ARCH ?= $(HOST_CPU) ;
|
|
|
|
HOST_ARCH_MACRO_DEFINE = ARCH_$(HOST_CPU) ;
|
|
|
|
|
2009-11-24 21:57:49 +03:00
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# directories
|
|
|
|
HOST_OBJECT_BASE_DIR = [ FDirName $(HAIKU_OBJECT_DIR) $(HOST_PLATFORM) ] ;
|
|
|
|
HOST_COMMON_ARCH_OBJECT_DIR = [ FDirName $(HOST_OBJECT_BASE_DIR) common ] ;
|
|
|
|
HOST_ARCH_OBJECT_DIR = [ FDirName $(HOST_OBJECT_BASE_DIR) $(HOST_ARCH) ] ;
|
|
|
|
HOST_COMMON_DEBUG_OBJECT_DIR = [ FDirName $(HOST_ARCH_OBJECT_DIR) common ] ;
|
|
|
|
HOST_DEBUG_0_OBJECT_DIR = [ FDirName $(HOST_ARCH_OBJECT_DIR) release ] ;
|
|
|
|
|
|
|
|
local level ;
|
|
|
|
for level in $(HAIKU_DEBUG_LEVELS[2-]) {
|
|
|
|
HOST_DEBUG_$(level)_OBJECT_DIR
|
|
|
|
= [ FDirName $(HOST_ARCH_OBJECT_DIR) debug_$(level) ] ;
|
|
|
|
}
|
|
|
|
|
2005-11-13 01:58:54 +03:00
|
|
|
# analyze GCC version
|
|
|
|
HOST_GCC_VERSION = [ FAnalyzeGCCVersion HOST_GCC_RAW_VERSION ] ;
|
|
|
|
|
|
|
|
# set variables for gcc header options
|
|
|
|
SetIncludePropertiesVariables HOST ;
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# assembler flags
|
|
|
|
HOST_ASFLAGS = ;
|
|
|
|
|
|
|
|
# C/C++ flags
|
|
|
|
HOST_CCFLAGS += -Wno-multichar ;
|
|
|
|
HOST_C++FLAGS += -Wno-multichar ;
|
|
|
|
|
2008-07-24 02:20:37 +04:00
|
|
|
if $(HOST_PLATFORM) != cygwin {
|
|
|
|
HOST_PIC_CCFLAGS += -fPIC ;
|
|
|
|
HOST_PIC_C++FLAGS += -fPIC ;
|
|
|
|
}
|
2007-06-16 23:43:53 +04:00
|
|
|
|
2007-08-23 02:07:03 +04:00
|
|
|
HOST_KERNEL_CCFLAGS += $(HOST_GCC_BASE_FLAGS) -finline -fno-builtin
|
2009-12-20 16:55:45 +03:00
|
|
|
-D_KERNEL_MODE ;
|
2007-08-23 02:07:03 +04:00
|
|
|
HOST_KERNEL_C++FLAGS += $(HOST_GCC_BASE_FLAGS) -finline -fno-builtin
|
2009-12-20 16:55:45 +03:00
|
|
|
-fno-exceptions -D_KERNEL_MODE ;
|
2008-01-11 03:36:44 +03:00
|
|
|
HOST_KERNEL_DEFINES += _KERNEL_MODE ;
|
2005-10-29 20:27:43 +04:00
|
|
|
|
2005-12-31 00:20:07 +03:00
|
|
|
HOST_KERNEL_PIC_CCFLAGS = -fno-pic ;
|
|
|
|
HOST_KERNEL_PIC_LINKFLAGS = ;
|
|
|
|
if $(HOST_ARCH) = ppc {
|
|
|
|
# Build a position independent PPC kernel. We need to be able to relocate
|
|
|
|
# the kernel, since the virtual address space layout at boot time is not
|
|
|
|
# fixed.
|
|
|
|
HOST_KERNEL_PIC_CCFLAGS = -fPIE ;
|
|
|
|
HOST_KERNEL_PIC_LINKFLAGS = -shared -fPIE ;
|
|
|
|
}
|
2008-06-23 19:34:48 +04:00
|
|
|
if $(HOST_ARCH) = m68k {
|
|
|
|
# Build a position independent M68K kernel. We need to be able to relocate
|
|
|
|
# the kernel, since the virtual address space layout at boot time is not
|
|
|
|
# fixed.
|
|
|
|
HOST_KERNEL_PIC_CCFLAGS = $(HAIKU_KERNEL_PIC_CCFLAGS) ;
|
|
|
|
HOST_KERNEL_PIC_LINKFLAGS = $(HAIKU_KERNEL_PIC_LINKFLAGS) ;
|
|
|
|
}
|
2005-12-31 00:20:07 +03:00
|
|
|
|
2011-11-06 17:14:47 +04:00
|
|
|
if $(HOST_PLATFORM) != darwin {
|
|
|
|
# fix for new changes to DSO linking policies
|
|
|
|
HOST_LINKFLAGS += -Xlinker --no-as-needed ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# warning flags
|
2008-10-02 03:56:12 +04:00
|
|
|
HOST_WARNING_CCFLAGS = -Wall -Wno-trigraphs -Wmissing-prototypes -Wpointer-arith
|
|
|
|
-Wcast-align -Wsign-compare ;
|
2007-10-25 17:22:01 +04:00
|
|
|
HOST_WARNING_C++FLAGS = -Wall -Wno-trigraphs -Wno-ctor-dtor-privacy
|
2005-10-29 20:27:43 +04:00
|
|
|
-Woverloaded-virtual -Wpointer-arith -Wcast-align -Wsign-compare ;
|
|
|
|
|
2007-10-25 17:22:01 +04:00
|
|
|
HOST_KERNEL_WARNING_CCFLAGS = -Wall -Wno-trigraphs -Wmissing-prototypes ;
|
|
|
|
HOST_KERNEL_WARNING_C++FLAGS = -Wall -Wno-trigraphs ;
|
2005-10-29 20:27:43 +04:00
|
|
|
|
|
|
|
# debug flags
|
|
|
|
switch $(HOST_PLATFORM) {
|
|
|
|
case haiku : HOST_DEBUG_FLAGS ?= -ggdb ;
|
2007-08-03 01:13:56 +04:00
|
|
|
case haiku_host : HOST_DEBUG_FLAGS ?= -ggdb ;
|
2005-10-29 20:27:43 +04:00
|
|
|
case linux : HOST_DEBUG_FLAGS ?= -ggdb ;
|
2008-05-14 17:32:52 +04:00
|
|
|
case freebsd : HOST_DEBUG_FLAGS ?= -ggdb ;
|
|
|
|
case darwin : HOST_DEBUG_FLAGS ?= -ggdb ;
|
2005-10-29 20:27:43 +04:00
|
|
|
case * : HOST_DEBUG_FLAGS ?= -g ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# debug 0: suppress asserts
|
|
|
|
HOST_DEBUG_0_CCFLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
|
|
|
|
HOST_DEBUG_0_C++FLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
|
|
|
|
|
|
|
|
HOST_KERNEL_DEBUG_0_CCFLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
|
|
|
|
HOST_KERNEL_DEBUG_0_C++FLAGS = [ FDefines NDEBUG=$(NDEBUG) ] ;
|
|
|
|
|
|
|
|
local level ;
|
|
|
|
for level in $(HAIKU_DEBUG_LEVELS[2-]) {
|
|
|
|
local flags = $(HOST_DEBUG_FLAGS) [ FDefines DEBUG=$(level) ] ;
|
|
|
|
HOST_DEBUG_$(level)_CCFLAGS = $(flags) ;
|
|
|
|
HOST_DEBUG_$(level)_C++FLAGS = $(flags) ;
|
|
|
|
HOST_KERNEL_DEBUG_$(level)_CCFLAGS = $(flags) ;
|
|
|
|
HOST_KERNEL_DEBUG_$(level)_C++FLAGS = $(flags) ;
|
|
|
|
}
|
|
|
|
|
2007-08-23 02:07:03 +04:00
|
|
|
# ld flags
|
2011-06-17 00:53:44 +04:00
|
|
|
if $(HAIKU_HOST_USE_32BIT) = 1 {
|
2007-08-23 02:07:03 +04:00
|
|
|
HOST_LDFLAGS += -melf_i386 ;
|
|
|
|
}
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# private kernel headers do be used when compiling kernel code
|
|
|
|
HOST_PRIVATE_KERNEL_HEADERS = ;
|
|
|
|
|
2008-05-14 07:55:16 +04:00
|
|
|
# private shared kernel/libroot headers
|
|
|
|
HOST_PRIVATE_SYSTEM_HEADERS = ;
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# under BeOS use copyattr instead of cp
|
|
|
|
if $(HOST_PLATFORM_BEOS_COMPATIBLE)
|
|
|
|
{
|
|
|
|
CP = copyattr --data ;
|
|
|
|
}
|
|
|
|
|
|
|
|
HOST_DEFINES += $(HOST_ARCH_MACRO_DEFINE) ;
|
|
|
|
HOST_DEFINES += _NO_INLINE_ASM ;
|
|
|
|
|
|
|
|
if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
|
|
|
|
# TODO: That's obviously not correct, but in the way the COMPILE_FOR_R5
|
|
|
|
# macro is used, it actually seems to mean r5/bone/dano.
|
2005-11-01 19:18:01 +03:00
|
|
|
# TODO: Deprecated. Remove!
|
2005-10-29 20:27:43 +04:00
|
|
|
HOST_DEFINES += COMPILE_FOR_R5 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# for builds of tools in the current environment
|
|
|
|
HOST_BUILD_COMPATIBILITY_LIB_DIR = [ FDirName $(HOST_OBJECT_BASE_DIR) lib ] ;
|
|
|
|
|
* BuildPlatformMain supports overriding HOST_LIBROOT on the target now,
so one can set it to the static libroot, if desired.
* Generic attribute emulation:
- Added build tool rm_attrs, a simple "rm" replacement, which also
removes the attributes directory for a given file.
- Added build/scripts/rm_attrs shell script, which wraps the
invocation of the rm_attrs tool. If it doesn't exist yet, the
ordinary rm is used.
- The RM jam variable refers to the rm_attrs script now, i.e. whenever
something is removed by the build system, the attributes are removed
too (if the build tool has already been built, that is).
- Removed the shell function attrrmrf() in build_haiku_image. We use
the rm_attrs tool instead, if necessary.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24528 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-23 00:05:03 +03:00
|
|
|
# For the generic attributes emulation: Target rm_attrs -- rm replacement that
|
|
|
|
# also removes the attributes.
|
|
|
|
HOST_RM_ATTRS_TARGET = ;
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
|
2009-09-23 14:14:07 +04:00
|
|
|
# the C++ standard and support libraries
|
2009-01-25 22:25:16 +03:00
|
|
|
if $(HOST_GCC_VERSION[1]) < 3 {
|
|
|
|
HOST_LIBSTDC++ = stdc++.r4 ;
|
2009-09-23 14:14:07 +04:00
|
|
|
HOST_LIBSUPC++ = ;
|
2009-01-25 22:25:16 +03:00
|
|
|
} else {
|
|
|
|
HOST_LIBSTDC++ = stdc++ ;
|
2009-09-23 14:14:07 +04:00
|
|
|
HOST_LIBSUPC++ = supc++ ;
|
2009-01-25 22:25:16 +03:00
|
|
|
}
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
HOST_LIBROOT = root ;
|
* BuildPlatformMain supports overriding HOST_LIBROOT on the target now,
so one can set it to the static libroot, if desired.
* Generic attribute emulation:
- Added build tool rm_attrs, a simple "rm" replacement, which also
removes the attributes directory for a given file.
- Added build/scripts/rm_attrs shell script, which wraps the
invocation of the rm_attrs tool. If it doesn't exist yet, the
ordinary rm is used.
- The RM jam variable refers to the rm_attrs script now, i.e. whenever
something is removed by the build system, the attributes are removed
too (if the build tool has already been built, that is).
- Removed the shell function attrrmrf() in build_haiku_image. We use
the rm_attrs tool instead, if necessary.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24528 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-23 00:05:03 +03:00
|
|
|
HOST_STATIC_LIBROOT = $(HOST_LIBROOT) ;
|
2005-10-29 20:27:43 +04:00
|
|
|
HOST_LIBBE = be ;
|
2009-09-19 23:52:30 +04:00
|
|
|
HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR = "export LIBRARY_PATH=$LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
|
2006-08-09 12:13:07 +04:00
|
|
|
HOST_LIBRARY_NAME_MAP_input_server = /system/servers/input_server ;
|
2009-11-25 19:33:10 +03:00
|
|
|
HOST_DEFINES += __STDC_FORMAT_MACROS __STDC_LIMIT_MACROS ;
|
2009-11-26 02:48:45 +03:00
|
|
|
|
|
|
|
local compatibilityHeader = -include [ FDirName $(HAIKU_TOP) headers build
|
|
|
|
HaikuBuildCompatibility.h ] ;
|
|
|
|
HOST_CCFLAGS += $(compatibilityHeader) ;
|
|
|
|
HOST_C++FLAGS += $(compatibilityHeader) ;
|
|
|
|
|
|
|
|
# compatibility library
|
|
|
|
HOST_HAIKU_COMPATIBILITY_LIBS = libhaikucompat.a ;
|
2005-10-29 20:27:43 +04:00
|
|
|
} else {
|
2011-12-11 03:40:38 +04:00
|
|
|
HOST_LINKFLAGS += -lm ;
|
2005-10-29 20:27:43 +04:00
|
|
|
HOST_LIBSTDC++ = stdc++ ;
|
2011-06-30 21:17:17 +04:00
|
|
|
HOST_LIBROOT = libroot_build_function_remapper.a libroot_build.so ;
|
2011-11-26 01:04:51 +04:00
|
|
|
HOST_STATIC_LIBROOT = libroot_build_function_remapper.a libroot_build.a ;
|
2005-10-29 20:27:43 +04:00
|
|
|
HOST_LIBBE = libbe_build.so ;
|
2008-07-24 02:20:37 +04:00
|
|
|
if $(HOST_PLATFORM) = cygwin {
|
|
|
|
HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
|
|
|
|
= "export PATH=$PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
|
2009-05-25 02:07:06 +04:00
|
|
|
} else if $(HOST_PLATFORM) = darwin {
|
|
|
|
HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
|
|
|
|
= "export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
|
2008-07-24 02:20:37 +04:00
|
|
|
} else {
|
|
|
|
HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
|
|
|
|
= "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
|
|
|
|
}
|
2005-10-29 20:27:43 +04:00
|
|
|
|
2005-11-13 01:58:54 +03:00
|
|
|
# the C++ support library
|
|
|
|
if $(HOST_GCC_VERSION[1]) < 3 {
|
|
|
|
HOST_LIBSUPC++ = ;
|
|
|
|
} else {
|
|
|
|
HOST_LIBSUPC++ = supc++ ;
|
|
|
|
}
|
|
|
|
|
2007-05-18 19:59:04 +04:00
|
|
|
if $(HOST_PLATFORM) = darwin {
|
2007-10-30 20:17:50 +03:00
|
|
|
# part of the C++ runtime lives in libstdc++ on Darwin
|
|
|
|
HOST_LIBSUPC++ = gcc_s.1 stdc++ ;
|
|
|
|
HOST_LIBSTDC++ = ;
|
2010-01-21 07:04:51 +03:00
|
|
|
} else if $(HOST_PLATFORM) = freebsd {
|
2011-06-16 21:58:24 +04:00
|
|
|
if $(HOST_CPU) = x86_64 {
|
2010-01-21 07:04:51 +03:00
|
|
|
# amd64 FreeBSD 8 doesn't come without a shared libsupc++, and the
|
|
|
|
# static one prevents us from building shared libraries. So we have
|
|
|
|
# to work around by using the shared libstdc++.
|
|
|
|
HOST_LIBSUPC++ = stdc++ ;
|
|
|
|
HOST_LIBSTDC++ = ;
|
|
|
|
}
|
2007-05-18 19:59:04 +04:00
|
|
|
}
|
|
|
|
|
2006-11-29 21:08:00 +03:00
|
|
|
# Unlike glibc FreeBSD's libc doesn't have built-in regex support.
|
|
|
|
if $(HOST_PLATFORM) = freebsd {
|
|
|
|
HOST_LIBROOT += /usr/lib/libgnuregex.so ;
|
* BuildPlatformMain supports overriding HOST_LIBROOT on the target now,
so one can set it to the static libroot, if desired.
* Generic attribute emulation:
- Added build tool rm_attrs, a simple "rm" replacement, which also
removes the attributes directory for a given file.
- Added build/scripts/rm_attrs shell script, which wraps the
invocation of the rm_attrs tool. If it doesn't exist yet, the
ordinary rm is used.
- The RM jam variable refers to the rm_attrs script now, i.e. whenever
something is removed by the build system, the attributes are removed
too (if the build tool has already been built, that is).
- Removed the shell function attrrmrf() in build_haiku_image. We use
the rm_attrs tool instead, if necessary.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24528 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-23 00:05:03 +03:00
|
|
|
HOST_STATIC_LIBROOT += /usr/lib/libgnuregex.so ;
|
2007-05-18 19:59:04 +04:00
|
|
|
} else if $(HOST_PLATFORM) = darwin {
|
|
|
|
HOST_LIBROOT += /opt/local/lib/libgnuregex.dylib ;
|
* BuildPlatformMain supports overriding HOST_LIBROOT on the target now,
so one can set it to the static libroot, if desired.
* Generic attribute emulation:
- Added build tool rm_attrs, a simple "rm" replacement, which also
removes the attributes directory for a given file.
- Added build/scripts/rm_attrs shell script, which wraps the
invocation of the rm_attrs tool. If it doesn't exist yet, the
ordinary rm is used.
- The RM jam variable refers to the rm_attrs script now, i.e. whenever
something is removed by the build system, the attributes are removed
too (if the build tool has already been built, that is).
- Removed the shell function attrrmrf() in build_haiku_image. We use
the rm_attrs tool instead, if necessary.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24528 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-23 00:05:03 +03:00
|
|
|
HOST_STATIC_LIBROOT += /opt/local/lib/libgnuregex.dylib ;
|
2006-11-29 21:08:00 +03:00
|
|
|
}
|
2007-08-23 02:07:03 +04:00
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# The BeOS compilers define __INTEL__ respectively __POWERPC__. On the
|
|
|
|
# build platform we need to make sure, this is also defined.
|
|
|
|
if $(HOST_CPU) = x86 {
|
|
|
|
HOST_DEFINES += __INTEL__ ;
|
2011-06-16 21:58:24 +04:00
|
|
|
} else if $(HOST_CPU) = x86_64 {
|
|
|
|
HOST_DEFINES += __x86_64__ ;
|
2005-10-29 20:27:43 +04:00
|
|
|
} else if $(HOST_CPU) = ppc {
|
|
|
|
HOST_DEFINES += __POWERPC__ ;
|
2007-10-24 03:27:09 +04:00
|
|
|
} else if $(HOST_CPU) = m68k {
|
|
|
|
HOST_DEFINES += __M68K__ ;
|
2009-05-02 23:03:19 +04:00
|
|
|
} else if $(HOST_CPU) = mipsel {
|
|
|
|
HOST_DEFINES += __MIPSEL__ ;
|
2005-10-29 20:27:43 +04:00
|
|
|
}
|
|
|
|
|
2007-05-04 13:55:31 +04:00
|
|
|
# Supposing this is a glibc platform, let's try to get features like large
|
2007-05-09 13:48:35 +04:00
|
|
|
# file support, ISO C 99 definitions, etc. On some platforms we need to
|
|
|
|
# request 64 bit off_t support explicitely.
|
2009-11-25 14:58:09 +03:00
|
|
|
HOST_DEFINES += _GNU_SOURCE _FILE_OFFSET_BITS=64 __STDC_FORMAT_MACROS
|
|
|
|
__STDC_LIMIT_MACROS ;
|
2007-04-08 06:19:01 +04:00
|
|
|
|
|
|
|
# On Linux with xattr support we can use it for our attribute emulation,
|
|
|
|
# which is somewhat more robust.
|
|
|
|
if $(HAIKU_HOST_USE_XATTR) = 1 {
|
|
|
|
HOST_DEFINES += HAIKU_HOST_USE_XATTR ;
|
* BuildPlatformMain supports overriding HOST_LIBROOT on the target now,
so one can set it to the static libroot, if desired.
* Generic attribute emulation:
- Added build tool rm_attrs, a simple "rm" replacement, which also
removes the attributes directory for a given file.
- Added build/scripts/rm_attrs shell script, which wraps the
invocation of the rm_attrs tool. If it doesn't exist yet, the
ordinary rm is used.
- The RM jam variable refers to the rm_attrs script now, i.e. whenever
something is removed by the build system, the attributes are removed
too (if the build tool has already been built, that is).
- Removed the shell function attrrmrf() in build_haiku_image. We use
the rm_attrs tool instead, if necessary.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24528 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-23 00:05:03 +03:00
|
|
|
} else {
|
|
|
|
# Otherwise the generic attribute emulation is used, which uses a
|
|
|
|
# directory per file to store its attribute. We need to redefine RM so
|
2008-10-02 03:56:12 +04:00
|
|
|
# that the attributes are removed as well. We use a wrapper script,
|
|
|
|
# which invokes a build tool. If the build tool hasn't been built yet,
|
|
|
|
# the normal "rm" is used and the attributes are leaked (likely there
|
|
|
|
# aren't any yet).
|
* BuildPlatformMain supports overriding HOST_LIBROOT on the target now,
so one can set it to the static libroot, if desired.
* Generic attribute emulation:
- Added build tool rm_attrs, a simple "rm" replacement, which also
removes the attributes directory for a given file.
- Added build/scripts/rm_attrs shell script, which wraps the
invocation of the rm_attrs tool. If it doesn't exist yet, the
ordinary rm is used.
- The RM jam variable refers to the rm_attrs script now, i.e. whenever
something is removed by the build system, the attributes are removed
too (if the build tool has already been built, that is).
- Removed the shell function attrrmrf() in build_haiku_image. We use
the rm_attrs tool instead, if necessary.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24528 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-23 00:05:03 +03:00
|
|
|
RM = $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ";"
|
|
|
|
[ FDirName $(HAIKU_TOP) build scripts rm_attrs ]
|
|
|
|
[ FDirName $(HAIKU_OBJECT_DIR) $(HOST_PLATFORM) $(HOST_ARCH) release
|
|
|
|
tools rm_attrs ] -f ;
|
|
|
|
# assumes that rm_attrs is built with debugging disabled
|
|
|
|
HOST_RM_ATTRS_TARGET = <build>rm_attrs ;
|
2007-04-08 06:19:01 +04:00
|
|
|
}
|
2005-10-29 20:27:43 +04:00
|
|
|
}
|
|
|
|
|
2007-08-13 02:15:10 +04:00
|
|
|
# network libraries
|
|
|
|
if $(HOST_PLATFORM_HAIKU_COMPATIBLE) {
|
|
|
|
HOST_NETWORK_LIBS = network ;
|
2008-05-14 17:49:48 +04:00
|
|
|
HOST_NETAPI_LIB = bnetapi ;
|
2007-08-13 02:15:10 +04:00
|
|
|
HOST_SELECT_UNAME_ETC_LIB = ; # libroot
|
|
|
|
} else if $(HOST_PLATFORM_BONE_COMPATIBLE) {
|
|
|
|
HOST_NETWORK_LIBS = socket bind ;
|
|
|
|
HOST_NETAPI_LIB = bnetapi ;
|
|
|
|
HOST_SELECT_UNAME_ETC_LIB = ; # libroot
|
|
|
|
} else if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
|
|
|
|
HOST_NETWORK_LIBS = net ;
|
|
|
|
HOST_NETAPI_LIB = netapi ;
|
|
|
|
HOST_SELECT_UNAME_ETC_LIB = net ;
|
2008-08-09 19:36:24 +04:00
|
|
|
} else if $(HOST_PLATFORM) = "sunos" {
|
|
|
|
HOST_NETWORK_LIBS = xnet ;
|
|
|
|
HOST_NETAPI_LIB = ;
|
|
|
|
HOST_SELECT_UNAME_ETC_LIB = ;
|
2007-08-13 02:15:10 +04:00
|
|
|
} else {
|
|
|
|
# Linux,...
|
|
|
|
HOST_NETWORK_LIBS = ;
|
|
|
|
HOST_NETAPI_LIB = ;
|
|
|
|
HOST_SELECT_UNAME_ETC_LIB = ;
|
|
|
|
}
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# define the executable MIME type
|
|
|
|
HOST_EXECUTABLE_MIME_TYPE = "application/x-vnd.Be-elfexecutable" ;
|
|
|
|
|
|
|
|
if $(METROWERKS) {
|
|
|
|
# at least parts of Haiku still can be compiled with
|
|
|
|
# the Metrowerks compiler on BeOS/PPC
|
|
|
|
HOST_EXECUTABLE_MIME_TYPE = "application/x-be-executable" ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Be API compatibility
|
|
|
|
HOST_BE_API_HEADERS = ;
|
|
|
|
HOST_BE_API_CCFLAGS = ;
|
|
|
|
HOST_BE_API_C++FLAGS = ;
|
2006-11-29 21:08:00 +03:00
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
if ! $(HOST_PLATFORM_BEOS_COMPATIBLE) {
|
|
|
|
HOST_BE_API_HEADERS =
|
|
|
|
[ FDirName $(HAIKU_TOP) headers build ]
|
|
|
|
[ FDirName $(HAIKU_TOP) headers build os ]
|
|
|
|
[ FDirName $(HAIKU_TOP) headers build os app ]
|
|
|
|
[ FDirName $(HAIKU_TOP) headers build os drivers ]
|
|
|
|
[ FDirName $(HAIKU_TOP) headers build os kernel ]
|
|
|
|
[ FDirName $(HAIKU_TOP) headers build os interface ]
|
2012-04-05 00:23:14 +04:00
|
|
|
[ FDirName $(HAIKU_TOP) headers build os locale ]
|
2008-10-14 01:10:52 +04:00
|
|
|
[ FDirName $(HAIKU_TOP) headers build os opengl ]
|
2005-10-29 20:27:43 +04:00
|
|
|
[ FDirName $(HAIKU_TOP) headers build os storage ]
|
|
|
|
[ FDirName $(HAIKU_TOP) headers build os support ]
|
2011-06-14 15:42:49 +04:00
|
|
|
[ FDirName $(HAIKU_TOP) headers build private ]
|
2005-10-29 20:27:43 +04:00
|
|
|
;
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
HOST_BE_API_CCFLAGS = -include BeOSBuildCompatibility.h ;
|
2005-10-29 20:27:43 +04:00
|
|
|
HOST_BE_API_C++FLAGS = $(HOST_BE_API_CCFLAGS) ;
|
|
|
|
}
|
|
|
|
|
2006-11-29 21:08:00 +03:00
|
|
|
# Add directory with system headers we need when building something for the host
|
|
|
|
# platform, e.g. containing missing POSIX/GNU headers.
|
|
|
|
HOST_HDRS += [ FDirName $(HAIKU_TOP) headers build host $(HOST_PLATFORM) ] ;
|
|
|
|
|
2007-08-25 01:05:20 +04:00
|
|
|
# For all versions of BeOS also add the common beos directory.
|
|
|
|
if $(HOST_PLATFORM) in r5 bone dano {
|
|
|
|
HOST_HDRS += [ FDirName $(HAIKU_TOP) headers build host beos_common ] ;
|
|
|
|
}
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
|
|
|
|
# target platform settings
|
|
|
|
|
|
|
|
# check the target platform compatibility
|
|
|
|
SetPlatformCompatibilityFlagVariables TARGET_PLATFORM : TARGET : target ;
|
|
|
|
|
|
|
|
# check the compatibility between host and target platform
|
|
|
|
if $(TARGET_PLATFORM) != haiku {
|
|
|
|
if ! $(HOST_PLATFORM_($(TARGET_PLATFORM))_COMPATIBLE) {
|
|
|
|
Exit ERROR: The host platform is not compatible with target platform
|
|
|
|
$(TARGET_PLATFORM). ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Set TARGET_* variables either from HAIKU_* or HOST_* depending on the
|
|
|
|
# specified TARGET_PLATFORM.
|
|
|
|
|
|
|
|
local buildVars =
|
2005-11-13 01:58:54 +03:00
|
|
|
ARCH CPU GCC_VERSION
|
2005-10-29 20:27:43 +04:00
|
|
|
|
|
|
|
AR CC C++ LD OBJCOPY RANLIB
|
|
|
|
|
2005-11-13 01:58:54 +03:00
|
|
|
INCLUDES_SEPARATOR LOCAL_INCLUDES_OPTION SYSTEM_INCLUDES_OPTION
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
HDRS CPPFLAGS CCFLAGS C++FLAGS LDFLAGS LINK LINKFLAGS DEFINES
|
|
|
|
ARFLAGS UNARFLAGS
|
2008-01-11 03:36:44 +03:00
|
|
|
KERNEL_DEFINES
|
2005-10-29 20:27:43 +04:00
|
|
|
|
|
|
|
KERNEL_CCFLAGS KERNEL_C++FLAGS
|
2005-12-31 00:20:07 +03:00
|
|
|
KERNEL_PIC_CCFLAGS KERNEL_PIC_LINKFLAGS
|
2012-05-27 00:47:27 +04:00
|
|
|
BOOT_CCFLAGS BOOT_C++FLAGS BOOT_LINKFLAGS
|
2005-10-29 20:27:43 +04:00
|
|
|
WARNING_CCFLAGS WARNING_C++FLAGS
|
|
|
|
|
|
|
|
KERNEL_WARNING_CCFLAGS KERNEL_WARNING_C++FLAGS
|
|
|
|
|
|
|
|
DEBUG_FLAGS
|
|
|
|
|
|
|
|
DEBUG_$(HAIKU_DEBUG_LEVELS)_CCFLAGS DEBUG_$(HAIKU_DEBUG_LEVELS)_C++FLAGS
|
|
|
|
|
|
|
|
KERNEL_DEBUG_$(HAIKU_DEBUG_LEVELS)_CCFLAGS
|
|
|
|
KERNEL_DEBUG_$(HAIKU_DEBUG_LEVELS)_C++FLAGS
|
|
|
|
|
|
|
|
PRIVATE_KERNEL_HEADERS
|
2008-05-14 07:55:16 +04:00
|
|
|
PRIVATE_SYSTEM_HEADERS
|
2005-10-29 20:27:43 +04:00
|
|
|
|
2005-11-13 01:58:54 +03:00
|
|
|
LIBSTDC++ LIBSUPC++
|
2009-05-20 06:22:36 +04:00
|
|
|
STATIC_LIBSTDC++ STATIC_LIBSUPC++
|
2005-10-29 20:27:43 +04:00
|
|
|
|
2007-08-13 02:15:10 +04:00
|
|
|
NETWORK_LIBS NETAPI_LIB SELECT_UNAME_ETC_LIB
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
ARCH_MACRO_DEFINE EXECUTABLE_MIME_TYPE
|
|
|
|
|
|
|
|
OBJECT_BASE_DIR COMMON_ARCH_OBJECT_DIR COMMON_DEBUG_OBJECT_DIR
|
|
|
|
DEBUG_$(HAIKU_DEBUG_LEVELS)_OBJECT_DIR
|
|
|
|
;
|
|
|
|
|
|
|
|
if $(TARGET_PLATFORM) = haiku {
|
|
|
|
local var ;
|
|
|
|
for var in $(buildVars) {
|
|
|
|
TARGET_$(var) = $(HAIKU_$(var)) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
TARGET_GCC_LIB_DIR = $(HAIKU_GCC_LIB_DIR) ;
|
|
|
|
TARGET_GCC_HEADERS_DIR = $(HAIKU_GCC_HEADERS_DIR) ;
|
|
|
|
TARGET_GCC_LIBGCC = $(HAIKU_GCC_LIBGCC) ;
|
|
|
|
TARGET_GCC_LIBGCC_OBJECTS = $(HAIKU_GCC_LIBGCC_OBJECTS) ;
|
|
|
|
|
2012-05-27 00:47:27 +04:00
|
|
|
TARGET_BOOT_LIBGCC = $(HAIKU_BOOT_LIBGCC) ;
|
|
|
|
TARGET_BOOT_LIBSUPC++ = $(HAIKU_BOOT_LIBSUPC++) ;
|
|
|
|
|
2006-09-28 15:55:30 +04:00
|
|
|
TARGET_BOOT_PLATFORM ?= $(HAIKU_BOOT_PLATFORM) ;
|
2009-09-23 14:14:07 +04:00
|
|
|
TARGET_BOOT_BOARD ?= $(HAIKU_BOOT_BOARD) ;
|
2005-10-29 20:27:43 +04:00
|
|
|
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
TARGET_LIBRARY_NAME_MAP = HAIKU_LIBRARY_NAME_MAP ;
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
} else {
|
|
|
|
local var ;
|
|
|
|
for var in $(buildVars) {
|
|
|
|
TARGET_$(var) = $(HOST_$(var)) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
TARGET_GCC_LIB_DIR = ;
|
|
|
|
TARGET_GCC_HEADERS_DIR = ;
|
|
|
|
TARGET_GCC_LIBGCC = ;
|
|
|
|
TARGET_GCC_LIBGCC_OBJECTS = ;
|
|
|
|
|
2012-05-27 00:47:27 +04:00
|
|
|
TARGET_BOOT_LIBGCC = ;
|
|
|
|
TARGET_BOOT_LIBSUPC++ = ;
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
TARGET_BOOT_PLATFORM = ;
|
2009-09-23 14:14:07 +04:00
|
|
|
TARGET_BOOT_BOARD = ;
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
|
2006-08-09 12:13:07 +04:00
|
|
|
TARGET_LIBRARY_NAME_MAP = HOST_LIBRARY_NAME_MAP ;
|
2005-10-29 20:27:43 +04:00
|
|
|
}
|
|
|
|
|
2005-11-01 19:24:29 +03:00
|
|
|
# define macro, for identifying the platform
|
|
|
|
switch $(TARGET_PLATFORM) {
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
case r5 : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_BEOS ;
|
|
|
|
case bone : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_BONE ;
|
|
|
|
case dano : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_DANO ;
|
2007-08-03 01:13:56 +04:00
|
|
|
case haiku_host : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_HAIKU ;
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
case haiku : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_HAIKU ;
|
|
|
|
case linux : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_LINUX ;
|
2006-01-24 19:31:27 +03:00
|
|
|
case freebsd : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_FREEBSD ;
|
2007-05-18 19:59:04 +04:00
|
|
|
case darwin : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_DARWIN ;
|
2008-10-14 17:29:28 +04:00
|
|
|
case cygwin : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_CYGWIN ;
|
|
|
|
case sunos : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_SUNOS ;
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
case libbe_test : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_LIBBE_TEST ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# define macro, for identifying the host platform
|
|
|
|
switch $(HOST_PLATFORM) {
|
2006-01-24 19:31:27 +03:00
|
|
|
case r5 : HOST_DEFINES += HAIKU_HOST_PLATFORM_BEOS ;
|
|
|
|
case bone : HOST_DEFINES += HAIKU_HOST_PLATFORM_BONE ;
|
|
|
|
case dano : HOST_DEFINES += HAIKU_HOST_PLATFORM_DANO ;
|
2007-08-03 01:13:56 +04:00
|
|
|
case haiku_host : HOST_DEFINES += HAIKU_HOST_PLATFORM_HAIKU ;
|
2006-01-24 19:31:27 +03:00
|
|
|
case linux : HOST_DEFINES += HAIKU_HOST_PLATFORM_LINUX ;
|
2006-01-26 02:55:14 +03:00
|
|
|
case freebsd : HOST_DEFINES += HAIKU_HOST_PLATFORM_FREEBSD ;
|
2007-05-18 19:59:04 +04:00
|
|
|
case darwin : HOST_DEFINES += HAIKU_HOST_PLATFORM_DARWIN ;
|
2008-10-14 17:29:28 +04:00
|
|
|
case cygwin : HOST_DEFINES += HAIKU_HOST_PLATFORM_CYGWIN ;
|
|
|
|
case sunos : HOST_DEFINES += HAIKU_HOST_PLATFORM_SUNOS ;
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
}
|
|
|
|
|
2009-11-24 21:57:49 +03:00
|
|
|
# define host platform 64 bit macro
|
|
|
|
if $(HOST_PLATFORM_IS_64_BIT) {
|
|
|
|
HOST_DEFINES += HAIKU_HOST_PLATFORM_64_BIT ;
|
|
|
|
}
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
|
2006-08-03 21:50:19 +04:00
|
|
|
# In case we build for a BeOS compatible platform, but not for Haiku, we
|
|
|
|
# include the HaikuBuildCompatibility.h header and link against
|
|
|
|
# libhaikucompat.a.
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
|
2007-08-03 01:13:56 +04:00
|
|
|
if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) && $(TARGET_PLATFORM_BEOS_COMPATIBLE) {
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
# headers and flags
|
|
|
|
local compatibilityHeader = -include [ FDirName $(HAIKU_TOP) headers build
|
|
|
|
HaikuBuildCompatibility.h ] ;
|
|
|
|
TARGET_CCFLAGS += $(compatibilityHeader) ;
|
|
|
|
TARGET_C++FLAGS += $(compatibilityHeader) ;
|
|
|
|
|
|
|
|
# compatibility library
|
|
|
|
TARGET_HAIKU_COMPATIBILITY_LIBS = libhaikucompat.a ;
|
2006-08-03 21:50:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# special target libbe_test
|
|
|
|
|
|
|
|
if $(TARGET_PLATFORM) = libbe_test {
|
|
|
|
# headers and flags
|
2007-03-28 19:20:08 +04:00
|
|
|
TARGET_HDRS +=
|
2012-04-05 00:23:14 +04:00
|
|
|
[ PublicHeaders $(DOT) app drivers game interface kernel locale storage
|
2007-10-21 14:15:57 +04:00
|
|
|
support ]
|
2006-08-03 21:50:19 +04:00
|
|
|
[ PrivateHeaders $(DOT) ] ;
|
|
|
|
TARGET_DEFINES += __HAIKU__ ;
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
|
2008-06-19 04:05:48 +04:00
|
|
|
TARGET_PRIVATE_SYSTEM_HEADERS =
|
|
|
|
[ PrivateHeaders $(DOT) system system/arch/$(TARGET_ARCH) ] ;
|
|
|
|
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
# directories
|
|
|
|
TARGET_OBJECT_BASE_DIR
|
|
|
|
= [ FDirName $(HAIKU_OBJECT_DIR) $(TARGET_PLATFORM) ] ;
|
|
|
|
TARGET_COMMON_ARCH_OBJECT_DIR
|
|
|
|
= [ FDirName $(TARGET_OBJECT_BASE_DIR) common ] ;
|
|
|
|
TARGET_ARCH_OBJECT_DIR
|
|
|
|
= [ FDirName $(TARGET_OBJECT_BASE_DIR) $(TARGET_ARCH) ] ;
|
|
|
|
TARGET_COMMON_DEBUG_OBJECT_DIR
|
|
|
|
= [ FDirName $(TARGET_ARCH_OBJECT_DIR) common ] ;
|
|
|
|
TARGET_DEBUG_0_OBJECT_DIR
|
|
|
|
= [ FDirName $(TARGET_ARCH_OBJECT_DIR) release ] ;
|
|
|
|
|
|
|
|
local level ;
|
|
|
|
for level in $(HAIKU_DEBUG_LEVELS[2-]) {
|
|
|
|
TARGET_DEBUG_$(level)_OBJECT_DIR
|
|
|
|
= [ FDirName $(TARGET_ARCH_OBJECT_DIR) debug_$(level) ] ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# library name map
|
|
|
|
TARGET_LIBRARY_NAME_MAP = LIBBE_LIBRARY_NAME_MAP ;
|
2009-08-19 18:17:13 +04:00
|
|
|
LIBBE_LIBRARY_NAME_MAP_be = libbe_test.so ;
|
2005-11-01 19:24:29 +03:00
|
|
|
}
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
|
|
|
|
# common stuff
|
|
|
|
|
2007-08-02 21:50:17 +04:00
|
|
|
# start with a clean state
|
2005-10-29 20:27:43 +04:00
|
|
|
CCFLAGS = ;
|
|
|
|
C++FLAGS = ;
|
|
|
|
DEFINES = ;
|
|
|
|
|
|
|
|
# Set CC, C++, LINK to invalid values, so that we realize early, that we use
|
|
|
|
# the wrong compiler.
|
|
|
|
CC = bad-cc ;
|
|
|
|
C++ = bad-c++ ;
|
|
|
|
LINK = bad-link ;
|
|
|
|
|
2006-11-29 21:08:00 +03:00
|
|
|
# Allow compiling unit tests on Zeta. Instead of fixing the PostMessage()
|
2005-10-29 20:27:43 +04:00
|
|
|
# issues, they deprecated that nice function. This will enable it again:
|
|
|
|
C++FLAGS += -D_ZETA_USING_DEPRECATED_API_=1 ;
|
2006-05-23 13:41:43 +04:00
|
|
|
# Same for buggy find_directory threadsafety fixes
|
|
|
|
C++FLAGS += -D_ZETA_TS_FIND_DIR_=1 ;
|
2005-10-29 20:27:43 +04:00
|
|
|
# TODO: Doesn't really belong here.
|
|
|
|
|
|
|
|
|
|
|
|
# Defaults for warnings, optimization, and debugging.
|
|
|
|
#
|
|
|
|
WARNINGS ?= 1 ;
|
|
|
|
OPTIM ?= -O2 ;
|
|
|
|
DEBUG ?= 0 ;
|
|
|
|
|
|
|
|
|
|
|
|
# Set the defaults for PLATFORM and SUPPORTED_PLATFORMS. PLATFORM is only
|
|
|
|
# overridden for targets to be built for the host platform. SUPPORTED_PLATFORMS
|
|
|
|
# can be overridden by the author of a component.
|
|
|
|
PLATFORM = $(TARGET_PLATFORM) ;
|
|
|
|
SUPPORTED_PLATFORMS = haiku ;
|
|
|
|
|
|
|
|
|
|
|
|
# Instructs the Library rule to not make its object files temporary.
|
|
|
|
# This is needed as some objects are used in a static library and for an
|
|
|
|
# executable.
|
|
|
|
KEEPOBJS = true ;
|
|
|
|
|
|
|
|
|
2008-04-02 18:02:52 +04:00
|
|
|
# Set permissions to how they should be on the image.
|
|
|
|
EXEMODE = 755 ;
|
|
|
|
FILEMODE = 644 ;
|
|
|
|
SHELLMODE = 755 ;
|
|
|
|
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# output directories
|
|
|
|
# TODO: Review this.
|
|
|
|
HAIKU_DOCUMENTATION_DIR ?= [ FDirName $(HAIKU_OUTPUT_DIR) documentation ] ;
|
2008-04-02 18:02:52 +04:00
|
|
|
HAIKU_DOCUMENTATION_OBJECT_DIR ?= [ FDirName $(HAIKU_COMMON_PLATFORM_OBJECT_DIR)
|
2005-10-29 20:27:43 +04:00
|
|
|
documentation ] ;
|
|
|
|
|
|
|
|
# TODO: Rethink test stuff.
|
2008-10-02 03:56:12 +04:00
|
|
|
HAIKU_TEST_DIR ?= [ FDirName $(HAIKU_OUTPUT_DIR) tests
|
|
|
|
$(TARGET_PLATFORM) $(HAIKU_ARCH) ] ;
|
2005-10-29 20:27:43 +04:00
|
|
|
HAIKU_APP_TEST_DIR ?= [ FDirName $(HAIKU_TEST_DIR) apps ] ;
|
|
|
|
HAIKU_APP_TEST_LIB_DIR ?= [ FDirName $(HAIKU_APP_TEST_DIR) lib ] ;
|
|
|
|
HAIKU_TMP_DIR ?= [ FDirName $(HAIKU_OUTPUT_DIR) tmp ] ;
|
|
|
|
|
|
|
|
HAIKU_PACKAGE_DIR ?= [ FDirName $(HAIKU_OUTPUT_DIR) packages ] ;
|
|
|
|
HAIKU_PACKAGE_OBJECT_DIR ?= [ FDirName $(HAIKU_OBJECT_DIR) packages ] ;
|
|
|
|
|
2005-11-09 19:17:31 +03:00
|
|
|
TARGET_TEST_DIR ?= [ FDirName $(HAIKU_TEST_DIR)
|
|
|
|
$(TARGET_PLATFORM) ] ;
|
|
|
|
TARGET_UNIT_TEST_DIR ?= [ FDirName $(TARGET_TEST_DIR) unittests ] ;
|
|
|
|
TARGET_UNIT_TEST_LIB_DIR ?= [ FDirName $(TARGET_UNIT_TEST_DIR) lib ] ;
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# automatically setup the objects directory per subdirectory
|
|
|
|
SUBDIRRULES += SetupObjectsDir ;
|
|
|
|
|
|
|
|
# Add the standard (userland) warning flags variables to the ones restored in
|
|
|
|
# every subdirectory. Thus we can easily meddle with them in subdirectories
|
|
|
|
# with imported sources.
|
|
|
|
AUTO_SET_UP_CONFIG_VARIABLES +=
|
|
|
|
HOST_WARNING_CCFLAGS HOST_WARNING_C++FLAGS
|
|
|
|
TARGET_WARNING_CCFLAGS TARGET_WARNING_C++FLAGS
|
|
|
|
|
|
|
|
# also add PLATFORM and SUPPORTED_PLATFORMS
|
|
|
|
PLATFORM SUPPORTED_PLATFORMS
|
|
|
|
;
|
2008-10-03 01:25:10 +04:00
|
|
|
|
|
|
|
|
|
|
|
# enable -Werror for certain parts of the source tree
|
2012-01-19 22:44:42 +04:00
|
|
|
HAIKU_WERRORFLAGS = ;
|
|
|
|
if $(HAIKU_GCC_VERSION[1]) >= 4 {
|
2008-10-03 01:25:10 +04:00
|
|
|
# -Wuninitialized gives too many false positives.
|
2012-01-19 22:44:42 +04:00
|
|
|
HAIKU_WERRORFLAGS = -Wno-error=uninitialized ;
|
|
|
|
|
|
|
|
if $(HAIKU_GCC_VERSION[2]) >= 6 {
|
|
|
|
# TODO: remove the -Wno-unused-but-set-variable option
|
|
|
|
HAIKU_WERRORFLAGS += -Wno-unused-but-set-variable ;
|
2008-10-03 01:25:10 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-19 22:44:42 +04:00
|
|
|
rule EnableWerror dirTokens : scope {
|
|
|
|
AppendToConfigVar CCFLAGS : HAIKU_TOP $(dirTokens)
|
|
|
|
: -Werror $(HAIKU_WERRORFLAGS) : $(scope) ;
|
|
|
|
AppendToConfigVar C++FLAGS : HAIKU_TOP $(dirTokens)
|
|
|
|
: -Werror $(HAIKU_WERRORFLAGS) : $(scope) ;
|
|
|
|
}
|
|
|
|
|
2008-10-03 01:25:10 +04:00
|
|
|
# Work-around for GCC 2 problem -- despite -Wno-multichar it reports
|
|
|
|
# multichar warnings in headers/private/kernel/debugger_keymaps.h included by
|
2009-12-01 20:07:10 +03:00
|
|
|
# src/system/kernel/arch/x86/arch_debug_console.cpp.
|
2008-10-03 01:25:10 +04:00
|
|
|
if $(HAIKU_GCC_VERSION[1]) = 2 {
|
|
|
|
local file = <src!system!kernel!arch!x86>arch_debug_console.o ;
|
2009-12-01 20:07:10 +03:00
|
|
|
C++FLAGS on $(file) = [ on $(file) return $(C++FLAGS) ] ;
|
2008-10-03 01:25:10 +04:00
|
|
|
}
|
|
|
|
|
2009-07-22 21:34:13 +04:00
|
|
|
if $(HAIKU_NO_WERROR) != 1 {
|
2010-07-22 01:43:20 +04:00
|
|
|
EnableWerror src add-ons accelerants 3dfx ;
|
|
|
|
EnableWerror src add-ons accelerants ati ;
|
|
|
|
EnableWerror src add-ons accelerants common ;
|
|
|
|
EnableWerror src add-ons accelerants et6x00 ;
|
|
|
|
# EnableWerror src add-ons accelerants intel_extreme ;
|
|
|
|
# EnableWerror src add-ons accelerants matrox ;
|
|
|
|
EnableWerror src add-ons accelerants neomagic ;
|
|
|
|
# EnableWerror src add-ons accelerants nvidia ;
|
|
|
|
EnableWerror src add-ons accelerants nvidia_gpgpu ;
|
|
|
|
# EnableWerror src add-ons accelerants radeon ;
|
2012-02-12 18:13:04 +04:00
|
|
|
# EnableWerror src add-ons accelerants radeon_hd ;
|
2010-07-22 01:43:20 +04:00
|
|
|
EnableWerror src add-ons accelerants s3 ;
|
|
|
|
EnableWerror src add-ons accelerants skeleton ;
|
|
|
|
EnableWerror src add-ons accelerants vesa ;
|
|
|
|
EnableWerror src add-ons accelerants via ;
|
|
|
|
EnableWerror src add-ons accelerants vmware ;
|
|
|
|
EnableWerror src add-ons bluetooth ;
|
|
|
|
EnableWerror src add-ons decorators ;
|
|
|
|
EnableWerror src add-ons disk_systems ;
|
|
|
|
EnableWerror src add-ons input_server devices ;
|
|
|
|
# EnableWerror src add-ons input_server filters ;
|
|
|
|
# EnableWerror src add-ons input_server methods ;
|
2010-08-19 19:29:02 +04:00
|
|
|
EnableWerror src add-ons kernel bluetooth ;
|
2010-07-22 01:43:20 +04:00
|
|
|
# EnableWerror src add-ons kernel bus_managers acpi ;
|
|
|
|
EnableWerror src add-ons kernel bus_managers agp_gart ;
|
|
|
|
EnableWerror src add-ons kernel bus_managers ata ;
|
|
|
|
EnableWerror src add-ons kernel bus_managers config_manager ;
|
2012-02-12 18:13:04 +04:00
|
|
|
# EnableWerror src add-ons kernel bus_managers firewire ;
|
2010-07-22 01:43:20 +04:00
|
|
|
EnableWerror src add-ons kernel bus_managers isa ;
|
|
|
|
EnableWerror src add-ons kernel bus_managers pci ;
|
|
|
|
# EnableWerror src add-ons kernel bus_managers ps2 ; # gcc2
|
|
|
|
EnableWerror src add-ons kernel bus_managers scsi ;
|
|
|
|
EnableWerror src add-ons kernel bus_managers usb ;
|
|
|
|
EnableWerror src add-ons kernel busses agp_gart ;
|
|
|
|
EnableWerror src add-ons kernel busses ata ;
|
|
|
|
EnableWerror src add-ons kernel busses scsi ;
|
|
|
|
EnableWerror src add-ons kernel busses usb ;
|
|
|
|
EnableWerror src add-ons kernel console ;
|
|
|
|
EnableWerror src add-ons kernel cpu ;
|
|
|
|
# EnableWerror src add-ons kernel debugger ; # gcc2
|
|
|
|
# EnableWerror src add-ons kernel drivers audio ;
|
|
|
|
EnableWerror src add-ons kernel drivers bluetooth ;
|
|
|
|
EnableWerror src add-ons kernel drivers bus ;
|
|
|
|
EnableWerror src add-ons kernel drivers common ;
|
|
|
|
EnableWerror src add-ons kernel drivers disk ;
|
|
|
|
EnableWerror src add-ons kernel drivers dvb ;
|
|
|
|
# EnableWerror src add-ons kernel drivers graphics ;
|
|
|
|
# EnableWerror src add-ons kernel drivers input ;
|
|
|
|
EnableWerror src add-ons kernel drivers joystick ;
|
|
|
|
EnableWerror src add-ons kernel drivers midi ;
|
|
|
|
EnableWerror src add-ons kernel drivers misc ;
|
|
|
|
# EnableWerror src add-ons kernel drivers network ;
|
|
|
|
EnableWerror src add-ons kernel drivers ports ;
|
|
|
|
# EnableWerror src add-ons kernel drivers power ;
|
|
|
|
EnableWerror src add-ons kernel drivers printer ;
|
|
|
|
EnableWerror src add-ons kernel drivers random ;
|
|
|
|
EnableWerror src add-ons kernel drivers tty ;
|
|
|
|
EnableWerror src add-ons kernel drivers video ;
|
2009-11-16 02:22:27 +03:00
|
|
|
EnableWerror src add-ons kernel file_systems bfs ;
|
2010-07-22 01:43:20 +04:00
|
|
|
EnableWerror src add-ons kernel file_systems cdda ;
|
|
|
|
# EnableWerror src add-ons kernel file_systems ext2 ;
|
|
|
|
# EnableWerror src add-ons kernel file_systems fat ;
|
|
|
|
# EnableWerror src add-ons kernel file_systems googlefs ;
|
|
|
|
EnableWerror src add-ons kernel file_systems iso9660 ;
|
|
|
|
EnableWerror src add-ons kernel file_systems layers ;
|
|
|
|
EnableWerror src add-ons kernel file_systems netfs ;
|
|
|
|
EnableWerror src add-ons kernel file_systems nfs ;
|
|
|
|
# EnableWerror src add-ons kernel file_systems ntfs ;
|
2009-11-16 02:22:27 +03:00
|
|
|
EnableWerror src add-ons kernel file_systems packagefs ;
|
2010-07-22 01:43:20 +04:00
|
|
|
EnableWerror src add-ons kernel file_systems ramfs ;
|
|
|
|
# EnableWerror src add-ons kernel file_systems reiserfs ;
|
|
|
|
EnableWerror src add-ons kernel file_systems udf ;
|
2009-11-16 02:22:27 +03:00
|
|
|
EnableWerror src add-ons kernel file_systems userlandfs ;
|
2010-07-22 01:43:20 +04:00
|
|
|
EnableWerror src add-ons kernel generic ;
|
2010-08-27 16:09:47 +04:00
|
|
|
# EnableWerror src add-ons kernel network datalink_protocols ;
|
2010-07-22 01:43:20 +04:00
|
|
|
EnableWerror src add-ons kernel network devices ;
|
|
|
|
EnableWerror src add-ons kernel network notifications ;
|
|
|
|
EnableWerror src add-ons kernel network ppp ;
|
2010-08-27 14:53:04 +04:00
|
|
|
EnableWerror src add-ons kernel network protocols ;
|
2010-07-22 01:43:20 +04:00
|
|
|
# EnableWerror src add-ons kernel network stack ;
|
|
|
|
EnableWerror src add-ons kernel partitioning_systems ;
|
|
|
|
EnableWerror src add-ons locale ;
|
|
|
|
EnableWerror src add-ons mail_daemon ;
|
|
|
|
EnableWerror src add-ons media media-add-ons demultiplexer ;
|
|
|
|
EnableWerror src add-ons media media-add-ons dvb ;
|
|
|
|
EnableWerror src add-ons media media-add-ons esound_sink ;
|
|
|
|
EnableWerror src add-ons media media-add-ons finepix_webcam ;
|
|
|
|
EnableWerror src add-ons media media-add-ons firewire_dv ;
|
|
|
|
EnableWerror src add-ons media media-add-ons legacy ;
|
|
|
|
EnableWerror src add-ons media media-add-ons mixer ;
|
|
|
|
EnableWerror src add-ons media media-add-ons multi_audio ;
|
|
|
|
EnableWerror src add-ons media media-add-ons opensound ;
|
|
|
|
EnableWerror src add-ons media media-add-ons radeon ;
|
|
|
|
EnableWerror src add-ons media media-add-ons reader ;
|
|
|
|
EnableWerror src add-ons media media-add-ons tone_producer_demo ;
|
|
|
|
EnableWerror src add-ons media media-add-ons usb_vision ;
|
|
|
|
# EnableWerror src add-ons media media-add-ons usb_webcam ;
|
|
|
|
EnableWerror src add-ons media media-add-ons video_mixer ;
|
|
|
|
# EnableWerror src add-ons media media-add-ons video_producer_demo ;
|
|
|
|
EnableWerror src add-ons media media-add-ons videowindow ;
|
|
|
|
EnableWerror src add-ons media media-add-ons writer ;
|
|
|
|
EnableWerror src add-ons media plugins ac3_decoder ;
|
|
|
|
EnableWerror src add-ons media plugins aiff_reader ;
|
|
|
|
EnableWerror src add-ons media plugins ape_reader ;
|
|
|
|
# EnableWerror src add-ons media plugins asf_reader ;
|
|
|
|
EnableWerror src add-ons media plugins au_reader ;
|
|
|
|
# EnableWerror src add-ons media plugins avi_reader ;
|
|
|
|
# EnableWerror src add-ons media plugins ffmpeg ;
|
|
|
|
# EnableWerror src add-ons media plugins matroska ;
|
|
|
|
# EnableWerror src add-ons media plugins mov_reader ;
|
|
|
|
EnableWerror src add-ons media plugins mp3_decoder ;
|
|
|
|
# EnableWerror src add-ons media plugins mp3_reader ;
|
|
|
|
EnableWerror src add-ons media plugins mp4_reader ;
|
|
|
|
EnableWerror src add-ons media plugins musepack ;
|
|
|
|
# EnableWerror src add-ons media plugins ogg ;
|
|
|
|
# EnableWerror src add-ons media plugins raw_decoder ;
|
|
|
|
# EnableWerror src add-ons media plugins speex ;
|
|
|
|
EnableWerror src add-ons media plugins theora ;
|
|
|
|
EnableWerror src add-ons media plugins vorbis ;
|
|
|
|
# EnableWerror src add-ons media plugins wav_reader ;
|
|
|
|
EnableWerror src add-ons media plugins xvid_decoder ;
|
|
|
|
EnableWerror src add-ons opengl ;
|
|
|
|
EnableWerror src add-ons print ;
|
|
|
|
EnableWerror src add-ons screen_savers ;
|
|
|
|
EnableWerror src add-ons tracker ;
|
|
|
|
EnableWerror src add-ons translators bmp ;
|
|
|
|
# EnableWerror src add-ons translators exr ;
|
|
|
|
EnableWerror src add-ons translators gif ;
|
|
|
|
EnableWerror src add-ons translators hpgs ;
|
|
|
|
EnableWerror src add-ons translators hvif ;
|
|
|
|
EnableWerror src add-ons translators ico ;
|
|
|
|
# EnableWerror src add-ons translators jpeg ; # gcc2
|
|
|
|
EnableWerror src add-ons translators jpeg2000 ;
|
|
|
|
EnableWerror src add-ons translators pcx ;
|
|
|
|
# EnableWerror src add-ons translators png ; # gcc2
|
|
|
|
EnableWerror src add-ons translators ppm ;
|
|
|
|
EnableWerror src add-ons translators raw ;
|
|
|
|
EnableWerror src add-ons translators rtf ;
|
|
|
|
EnableWerror src add-ons translators sgi ;
|
|
|
|
EnableWerror src add-ons translators shared ;
|
2012-02-12 18:13:04 +04:00
|
|
|
# EnableWerror src add-ons translators stxt ;
|
2010-07-22 01:43:20 +04:00
|
|
|
EnableWerror src add-ons translators tga ;
|
|
|
|
EnableWerror src add-ons translators tiff ;
|
2012-02-12 18:13:04 +04:00
|
|
|
# EnableWerror src add-ons translators wonderbrush ;
|
2010-08-23 18:40:29 +04:00
|
|
|
EnableWerror src add-ons print ;
|
2009-11-16 02:22:27 +03:00
|
|
|
EnableWerror src bin package ;
|
2010-08-19 21:36:23 +04:00
|
|
|
EnableWerror src apps ;
|
2010-08-19 19:54:21 +04:00
|
|
|
EnableWerror src kits ;
|
2010-08-17 21:37:15 +04:00
|
|
|
EnableWerror src preferences ;
|
2010-08-19 19:29:02 +04:00
|
|
|
EnableWerror src servers ;
|
2009-07-22 21:34:13 +04:00
|
|
|
EnableWerror src system kernel ;
|
2011-12-15 16:26:45 +04:00
|
|
|
EnableWerror src system libroot add-ons ;
|
|
|
|
EnableWerror src system libroot posix locale ;
|
|
|
|
EnableWerror src system libroot posix wchar ;
|
2009-07-22 21:34:13 +04:00
|
|
|
EnableWerror src system runtime_loader ;
|
|
|
|
}
|
|
|
|
|
2011-12-28 22:34:13 +04:00
|
|
|
# The following directories cannot currently be compiled with DEBUG=1
|
|
|
|
SetConfigVar DEBUG : HAIKU_TOP src add-ons disk_systems bfs : 0 : local ;
|
|
|
|
SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel drivers audio hda : 0 : local ;
|
|
|
|
SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel drivers audio ac97 auich : 0 : local ; # fails with gcc4 only
|
|
|
|
SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel drivers audio ac97 auvia : 0 : local ; # fails with gcc4 only
|
|
|
|
SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel drivers audio ac97 sis7018 : 0 : local ;
|
|
|
|
SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel file_systems btrfs : 0 : local ;
|
|
|
|
SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel file_systems ntfs libntfs : 0 : local ;
|
|
|
|
SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel file_systems udf : 0 : local ;
|
|
|
|
SetConfigVar DEBUG : HAIKU_TOP src add-ons media media-add-ons dvb : 0 : local ;
|
|
|
|
SetConfigVar DEBUG : HAIKU_TOP src add-ons print drivers gutenprint : 0 : local ;
|
|
|
|
SetConfigVar DEBUG : HAIKU_TOP src servers input : 0 : local ;
|
|
|
|
SetConfigVar DEBUG : HAIKU_TOP src servers media_addon : 0 : local ;
|
|
|
|
SetConfigVar DEBUG : HAIKU_TOP src system boot loader file_systems bfs : 0 : local ;
|
|
|
|
SetConfigVar DEBUG : HAIKU_TOP src system boot loader file_systems tarfs : 0 : local ;
|