2013-08-01 10:51:16 +04:00
|
|
|
rule ArchitectureSetup architecture
|
|
|
|
{
|
|
|
|
# ArchitectureSetup <architecture> ;
|
|
|
|
#
|
|
|
|
# Initializes all global packaging architecture dependent variables for the
|
|
|
|
# given packaging architecture. Also sets HAIKU_ARCH (to the primary
|
|
|
|
# architecture), if this is the first invocation of the rule, and adds
|
|
|
|
# the architecture to HAIKU_ARCHS, if not yet contained.
|
|
|
|
|
|
|
|
# analyze GCC version
|
|
|
|
local gccVersion
|
|
|
|
= [ FAnalyzeGCCVersion HAIKU_GCC_RAW_VERSION_$(architecture) ] ;
|
|
|
|
HAIKU_GCC_VERSION_$(architecture) = $(gccVersion) ;
|
|
|
|
|
|
|
|
# enable GCC -pipe option, if requested
|
|
|
|
local gccBaseFlags ;
|
|
|
|
if $(HAIKU_USE_GCC_PIPE) = 1 {
|
|
|
|
gccBaseFlags = -pipe ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# 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. See this discussion on some issues:
|
|
|
|
# http://www.freelists.org/post/haiku-development/hrev45320-Yet-another-nonobvious-effect-of-ftreevrp-optimization
|
|
|
|
if $(gccVersion[1]) >= 3 {
|
2014-01-11 00:06:25 +04:00
|
|
|
gccBaseFlags += -fno-strict-aliasing ;
|
2014-04-17 05:04:12 +04:00
|
|
|
if $(HAIKU_CC_IS_CLANG_$(architecture)) != 1 {
|
2014-01-11 00:06:25 +04:00
|
|
|
gccBaseFlags += -fno-tree-vrp ;
|
|
|
|
}
|
2013-08-01 10:51:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# disable array bounds warnings on gcc 4.6 or newer since they trigger
|
|
|
|
# too many false positives. Coverity does a better job of this kind of
|
|
|
|
# analysis anyways.
|
|
|
|
if $(gccVersion[1]) >= 4 {
|
|
|
|
gccBaseFlags += -Wno-array-bounds ;
|
|
|
|
}
|
|
|
|
|
2013-09-27 03:55:45 +04:00
|
|
|
local cpu = $(HAIKU_CPU_$(architecture)) ;
|
|
|
|
if $(cpu) = arm {
|
2015-11-08 18:38:57 +03:00
|
|
|
if $(HAIKU_CC_IS_CLANG_$(architecture)) != 1 {
|
2015-11-07 20:02:06 +03:00
|
|
|
# For stackcrawls - not supported by Clang
|
|
|
|
gccBaseFlags += -mapcs-frame ;
|
|
|
|
}
|
2013-09-27 03:55:45 +04:00
|
|
|
}
|
|
|
|
|
2013-08-01 10:51:16 +04:00
|
|
|
# activating graphite optimizations
|
|
|
|
if $(HAIKU_USE_GCC_GRAPHITE_$(architecture)) = 1 {
|
|
|
|
gccBaseFlags += -floop-interchange -ftree-loop-distribution
|
|
|
|
-floop-strip-mine -floop-block ;
|
|
|
|
}
|
|
|
|
HAIKU_GCC_BASE_FLAGS_$(architecture) = $(gccBaseFlags) ;
|
|
|
|
|
|
|
|
# initial state for flags etc.
|
|
|
|
HAIKU_C++_$(architecture) ?= $(HAIKU_CC_$(architecture)) ;
|
|
|
|
HAIKU_LINK_$(architecture) = $(HAIKU_CC_$(architecture)) ;
|
|
|
|
HAIKU_LINKFLAGS_$(architecture) = $(gccBaseFlags) ;
|
|
|
|
|
|
|
|
HAIKU_CCFLAGS_$(architecture) += $(gccBaseFlags) -nostdinc ;
|
|
|
|
HAIKU_C++FLAGS_$(architecture) += $(gccBaseFlags) -nostdinc ;
|
|
|
|
|
|
|
|
# strip is required
|
|
|
|
if ! $(HAIKU_STRIP_$(architecture)) {
|
|
|
|
Exit "HAIKU_STRIP_$(architecture) not set. Please re-run configure." ;
|
|
|
|
}
|
|
|
|
|
|
|
|
HAIKU_ARCH_$(architecture) = $(cpu) ;
|
|
|
|
HAIKU_ARCH ?= $(cpu) ;
|
|
|
|
# Set only, if not set yet. This way HAIKU_ARCH is set to the primary
|
|
|
|
# architecture.
|
|
|
|
if ! $(cpu) in $(HAIKU_ARCHS) {
|
|
|
|
HAIKU_ARCHS += $(cpu) ;
|
|
|
|
}
|
|
|
|
HAIKU_DEFINES_$(architecture) += ARCH_$(cpu) ;
|
|
|
|
|
|
|
|
# directories
|
|
|
|
HAIKU_ARCH_OBJECT_DIR_$(architecture)
|
|
|
|
= [ FDirName $(HAIKU_OBJECT_BASE_DIR) $(architecture) ] ;
|
|
|
|
HAIKU_COMMON_DEBUG_OBJECT_DIR_$(architecture)
|
|
|
|
= [ FDirName $(HAIKU_ARCH_OBJECT_DIR_$(architecture)) common ] ;
|
|
|
|
HAIKU_DEBUG_0_OBJECT_DIR_$(architecture)
|
|
|
|
= [ FDirName $(HAIKU_ARCH_OBJECT_DIR_$(architecture)) release ] ;
|
|
|
|
|
|
|
|
local level ;
|
|
|
|
for level in $(HAIKU_DEBUG_LEVELS[2-]) {
|
|
|
|
HAIKU_DEBUG_$(level)_OBJECT_DIR_$(architecture)
|
|
|
|
= [ FDirName $(HAIKU_ARCH_OBJECT_DIR_$(architecture))
|
|
|
|
debug_$(level) ] ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# set variables for gcc header options
|
|
|
|
SetIncludePropertiesVariables HAIKU : _$(architecture) ;
|
|
|
|
|
|
|
|
# assembler flags
|
|
|
|
HAIKU_ASFLAGS_$(architecture) = ;
|
|
|
|
|
|
|
|
# C/C++ flags
|
|
|
|
if $(gccVersion[1]) >= 4 {
|
|
|
|
HAIKU_C++FLAGS_$(architecture) += -Wno-deprecated ;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch $(cpu) {
|
|
|
|
case x86* :
|
|
|
|
# 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_$(architecture) += B_USE_BUILTIN_ATOMIC_FUNCTIONS ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# warning flags
|
|
|
|
HAIKU_WARNING_CCFLAGS_$(architecture)
|
|
|
|
= -Wall -Wno-trigraphs -Wmissing-prototypes
|
|
|
|
-Wpointer-arith -Wcast-align -Wsign-compare -Wno-multichar ;
|
|
|
|
HAIKU_WARNING_C++FLAGS_$(architecture) = -Wall -Wno-trigraphs
|
|
|
|
-Wno-ctor-dtor-privacy -Woverloaded-virtual -Wpointer-arith -Wcast-align
|
|
|
|
-Wsign-compare -Wno-multichar ;
|
|
|
|
|
Fix kernel -Werror support
The introduction of secondary arch support for kernel files disabled
-Werror for all kernel files, since the -Werror flags were moved from
{CC,C++}FLAGS to TARGET_WARNING_{CC,C++}FLAGS_<arch>, which, however,
was overwritten by the SetupKernel rule. This commit introduces new
global variables {HAIKU,HOST,TARGET}_WERROR_FLAGS[_<arch>], which
contain the additional -Werror flags to be applied for the architecture.
The config variable WARNINGS can be set to "treatAsErrors" to cause
-Werror and {HOST,TARGET}_WERROR_FLAGS[_<arch>] to be appended to the
compilation flags.
Fixes #10280.
2013-12-05 15:37:14 +04:00
|
|
|
HAIKU_WERROR_FLAGS_$(architecture) = ;
|
|
|
|
|
|
|
|
if $(gccVersion[1]) >= 4 {
|
|
|
|
# -Wuninitialized gives too many false positives.
|
2016-03-04 22:23:17 +03:00
|
|
|
HAIKU_WERROR_FLAGS_$(architecture) += -Wno-error=uninitialized
|
|
|
|
-Wno-error=maybe-uninitialized ;
|
Fix kernel -Werror support
The introduction of secondary arch support for kernel files disabled
-Werror for all kernel files, since the -Werror flags were moved from
{CC,C++}FLAGS to TARGET_WARNING_{CC,C++}FLAGS_<arch>, which, however,
was overwritten by the SetupKernel rule. This commit introduces new
global variables {HAIKU,HOST,TARGET}_WERROR_FLAGS[_<arch>], which
contain the additional -Werror flags to be applied for the architecture.
The config variable WARNINGS can be set to "treatAsErrors" to cause
-Werror and {HOST,TARGET}_WERROR_FLAGS[_<arch>] to be appended to the
compilation flags.
Fixes #10280.
2013-12-05 15:37:14 +04:00
|
|
|
|
|
|
|
# TODO: remove the -Wno-unused-but-set-variable option
|
|
|
|
HAIKU_WERROR_FLAGS_$(architecture) += -Wno-unused-but-set-variable ;
|
|
|
|
}
|
|
|
|
|
2013-08-01 10:51:16 +04:00
|
|
|
# debug flags
|
|
|
|
local debugFlags = -ggdb ;
|
|
|
|
|
|
|
|
# debug 0: suppress asserts
|
|
|
|
HAIKU_DEBUG_0_CCFLAGS_$(architecture) = [ FDefines NDEBUG=$(NDEBUG) ] ;
|
|
|
|
HAIKU_DEBUG_0_C++FLAGS_$(architecture) = [ FDefines NDEBUG=$(NDEBUG) ] ;
|
|
|
|
|
|
|
|
local level ;
|
|
|
|
for level in $(HAIKU_DEBUG_LEVELS[2-]) {
|
|
|
|
local flags = $(debugFlags) [ FDefines DEBUG=$(level) ] ;
|
|
|
|
HAIKU_DEBUG_$(level)_CCFLAGS_$(architecture) = $(flags) ;
|
|
|
|
HAIKU_DEBUG_$(level)_C++FLAGS_$(architecture) = $(flags) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if $(gccVersion[1]) >= 3 {
|
|
|
|
# TODO: Temporary work-around. Should be defined in the compiler specs
|
|
|
|
HAIKU_LINKFLAGS_$(architecture) += -Xlinker --no-undefined ;
|
|
|
|
} else {
|
|
|
|
HAIKU_DEFINES_$(architecture) += _BEOS_R5_COMPATIBLE_ ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# private shared kernel/libroot headers
|
|
|
|
HAIKU_PRIVATE_SYSTEM_HEADERS_$(architecture)
|
|
|
|
= [ PrivateHeaders $(DOT) system system/arch/$(cpu) ] ;
|
|
|
|
|
|
|
|
# library and executable glue code
|
|
|
|
local commonGlueCode =
|
|
|
|
<src!system!glue!$(architecture)>init_term_dyn.o
|
|
|
|
<src!system!glue!arch!$(HAIKU_ARCH)!$(architecture)>crti.o
|
|
|
|
<src!system!glue!arch!$(HAIKU_ARCH)!$(architecture)>crtn.o
|
|
|
|
;
|
|
|
|
HAIKU_LIBRARY_BEGIN_GLUE_CODE_$(architecture) =
|
|
|
|
<src!system!glue!arch!$(HAIKU_ARCH)!$(architecture)>crti.o
|
2014-08-01 00:01:44 +04:00
|
|
|
<$(architecture)>crtbeginS.o
|
2013-08-01 10:51:16 +04:00
|
|
|
<src!system!glue!$(architecture)>init_term_dyn.o
|
|
|
|
;
|
|
|
|
HAIKU_LIBRARY_END_GLUE_CODE_$(architecture) =
|
2014-08-01 00:01:44 +04:00
|
|
|
<$(architecture)>crtendS.o
|
2013-08-01 10:51:16 +04:00
|
|
|
<src!system!glue!arch!$(HAIKU_ARCH)!$(architecture)>crtn.o
|
|
|
|
;
|
|
|
|
HAIKU_EXECUTABLE_BEGIN_GLUE_CODE_$(architecture) =
|
|
|
|
<src!system!glue!arch!$(HAIKU_ARCH)!$(architecture)>crti.o
|
2014-08-01 00:01:44 +04:00
|
|
|
<$(architecture)>crtbeginS.o
|
2013-08-01 10:51:16 +04:00
|
|
|
<src!system!glue!$(architecture)>start_dyn.o
|
|
|
|
<src!system!glue!$(architecture)>init_term_dyn.o
|
|
|
|
;
|
|
|
|
HAIKU_EXECUTABLE_END_GLUE_CODE_$(architecture)
|
|
|
|
= $(HAIKU_LIBRARY_END_GLUE_CODE_$(architecture)) ;
|
|
|
|
|
2014-08-01 00:01:44 +04:00
|
|
|
SEARCH on <$(architecture)>crtbeginS.o <$(architecture)>crtendS.o
|
|
|
|
= $(HAIKU_GCC_LIB_DIR_$(architecture)) ;
|
2013-08-01 10:51:16 +04:00
|
|
|
|
|
|
|
# init library name map
|
2013-08-05 20:52:33 +04:00
|
|
|
local libraryGrist = "" ;
|
|
|
|
if $(architecture) != $(HAIKU_PACKAGING_ARCHS[1]) {
|
|
|
|
libraryGrist = $(architecture) ;
|
|
|
|
}
|
2013-08-01 10:51:16 +04:00
|
|
|
local i ;
|
2013-12-23 09:36:02 +04:00
|
|
|
for i in be bnetapi debug device game locale mail media midi midi2
|
|
|
|
network package root screensaver textencoding tracker
|
2013-08-01 10:51:16 +04:00
|
|
|
translation z {
|
2013-08-05 20:52:33 +04:00
|
|
|
local library = lib$(i).so ;
|
2013-08-05 08:39:10 +04:00
|
|
|
HAIKU_LIBRARY_NAME_MAP_$(architecture)_$(i)
|
2013-08-05 20:52:33 +04:00
|
|
|
= $(library:G=$(libraryGrist)) ;
|
2013-08-01 10:51:16 +04:00
|
|
|
}
|
|
|
|
HAIKU_LIBRARY_NAME_MAP_$(architecture)_localestub
|
|
|
|
= <$(architecture)>liblocalestub.a ;
|
2016-01-16 04:55:20 +03:00
|
|
|
HAIKU_LIBRARY_NAME_MAP_$(architecture)_shared
|
|
|
|
= <$(architecture)>libshared.a ;
|
2013-08-05 23:44:12 +04:00
|
|
|
if $(architecture) = $(HAIKU_PACKAGING_ARCHS[1]) {
|
2013-08-05 20:52:33 +04:00
|
|
|
HAIKU_LIBRARY_NAME_MAP_$(architecture)_input_server
|
|
|
|
= <nogrist>input_server ;
|
|
|
|
} else {
|
|
|
|
HAIKU_LIBRARY_NAME_MAP_$(architecture)_input_server
|
|
|
|
= <$(architecture)>input_server ;
|
|
|
|
}
|
2013-08-01 10:51:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
rule KernelArchitectureSetup architecture
|
|
|
|
{
|
|
|
|
# KernelArchitectureSetup <architecture> ;
|
|
|
|
#
|
|
|
|
# Initializes the global kernel and boot loader related variables. Those
|
|
|
|
# don't have a packaging architecture suffix, since they are only set for
|
|
|
|
# the primary packaging architecture. <architecture> is the primary
|
|
|
|
# packaging architecture (supplied for convenience).
|
|
|
|
|
|
|
|
HAIKU_KERNEL_ARCH = $(HAIKU_ARCH) ;
|
|
|
|
|
|
|
|
local gccVersion = $(HAIKU_GCC_VERSION_$(architecture)) ;
|
|
|
|
local cpu = $(HAIKU_CPU_$(architecture)) ;
|
|
|
|
|
|
|
|
switch $(cpu) {
|
|
|
|
case ppc :
|
|
|
|
HAIKU_BOOT_PLATFORM ?= openfirmware ;
|
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ; # in kB
|
|
|
|
# offset in floppy image (>= sizeof(haiku_loader))
|
|
|
|
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet
|
|
|
|
|
|
|
|
case arm :
|
2014-02-26 10:26:49 +04:00
|
|
|
switch $(HAIKU_BOOT_BOARD) {
|
2016-10-20 19:05:22 +03:00
|
|
|
case beagleboard :
|
|
|
|
{
|
|
|
|
HAIKU_BOOT_PLATFORM ?= u-boot ;
|
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
|
|
|
|
}
|
|
|
|
case beaglebone :
|
2014-02-26 10:26:49 +04:00
|
|
|
{
|
|
|
|
HAIKU_BOOT_PLATFORM ?= u-boot ;
|
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
|
|
|
|
}
|
|
|
|
case neo_freerunner :
|
|
|
|
{
|
|
|
|
HAIKU_BOOT_PLATFORM ?= u-boot ;
|
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
|
|
|
|
}
|
|
|
|
case overo :
|
|
|
|
{
|
|
|
|
HAIKU_BOOT_PLATFORM ?= u-boot ;
|
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
|
|
|
|
}
|
2015-03-07 21:31:12 +03:00
|
|
|
case rpi1 :
|
2014-02-26 10:26:49 +04:00
|
|
|
{
|
2015-03-07 21:31:12 +03:00
|
|
|
HAIKU_BOOT_PLATFORM ?= u-boot ;
|
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
|
|
|
|
}
|
|
|
|
case rpi2 :
|
|
|
|
{
|
|
|
|
HAIKU_BOOT_PLATFORM ?= u-boot ;
|
2014-02-26 10:26:49 +04:00
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
|
|
|
|
}
|
2015-04-12 00:52:50 +03:00
|
|
|
case cubieboard4 :
|
|
|
|
{
|
|
|
|
HAIKU_BOOT_PLATFORM ?= u-boot ;
|
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
|
|
|
|
}
|
2014-02-26 10:26:49 +04:00
|
|
|
case verdex :
|
|
|
|
{
|
|
|
|
HAIKU_BOOT_PLATFORM ?= u-boot ;
|
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
|
|
|
|
}
|
|
|
|
case * :
|
|
|
|
{
|
|
|
|
Exit "Set HAIKU_BOOT_BOARD for your target ARM device!" ;
|
|
|
|
}
|
|
|
|
}
|
2014-05-01 14:50:11 +04:00
|
|
|
|
2013-08-01 10:51:16 +04:00
|
|
|
# offset in floppy image (>= sizeof(haiku_loader))
|
|
|
|
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet
|
|
|
|
|
|
|
|
case x86 :
|
2016-04-14 10:15:55 +03:00
|
|
|
HAIKU_BOOT_PLATFORM ?= bios_ia32 ;
|
2013-08-01 10:51:16 +04:00
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
|
|
|
|
# offset in floppy image (>= sizeof(haiku_loader))
|
2014-07-12 20:41:09 +04:00
|
|
|
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 320 ; # in kB
|
2013-08-01 10:51:16 +04:00
|
|
|
|
2014-03-29 02:07:04 +04:00
|
|
|
# nasm is required for target arch x86
|
|
|
|
if ! $(HAIKU_NASM) {
|
|
|
|
Exit "HAIKU_NASM not set. Please re-run configure." ;
|
2013-08-01 10:51:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
case x86_64 :
|
|
|
|
# x86_64 completely shares the x86 bootloader.
|
2016-04-14 10:15:55 +03:00
|
|
|
HAIKU_BOOT_PLATFORM ?= bios_ia32 ;
|
2013-08-01 10:51:16 +04:00
|
|
|
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
|
|
|
|
# offset in floppy image (>= sizeof(haiku_loader))
|
2014-07-12 20:41:09 +04:00
|
|
|
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 320 ; # in kB
|
2013-08-01 10:51:16 +04:00
|
|
|
|
|
|
|
# x86_64 kernel source is under arch/x86.
|
|
|
|
HAIKU_KERNEL_ARCH = x86 ;
|
|
|
|
|
2014-03-29 02:07:04 +04:00
|
|
|
# nasm is required for target arch x86_64
|
|
|
|
if ! $(HAIKU_NASM) {
|
|
|
|
Exit "HAIKU_NASM not set. Please re-run configure." ;
|
2013-08-01 10:51:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
case m68k :
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
# offset in floppy image (>= sizeof(haiku_loader))
|
|
|
|
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 260 ; # in kB
|
2013-10-12 19:24:26 +04:00
|
|
|
HAIKU_CONTAINER_STRIP_EXECUTABLES on
|
|
|
|
$(HAIKU_FLOPPY_BOOT_IMAGE_CONTAINER_NAME) = 1 ;
|
2013-08-01 10:51:16 +04:00
|
|
|
|
|
|
|
case * :
|
|
|
|
Exit "Currently unsupported target CPU:" $(cpu) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# private kernel headers to be used when compiling kernel code
|
|
|
|
HAIKU_PRIVATE_KERNEL_HEADERS =
|
|
|
|
[ PrivateHeaders $(DOT) kernel libroot shared
|
|
|
|
kernel/boot/platform/$(HAIKU_BOOT_PLATFORM) ]
|
|
|
|
[ ArchHeaders $(HAIKU_KERNEL_ARCH) ]
|
|
|
|
[ FDirName $(HAIKU_COMMON_DEBUG_OBJECT_DIR_$(architecture)) system
|
|
|
|
kernel ]
|
|
|
|
$(HAIKU_PRIVATE_SYSTEM_HEADERS_$(architecture))
|
|
|
|
;
|
|
|
|
|
|
|
|
# C/C++ flags
|
|
|
|
local gccBaseFlags = $(HAIKU_GCC_BASE_FLAGS_$(architecture))
|
|
|
|
-finline -fno-builtin ;
|
|
|
|
|
|
|
|
if $(gccVersion[1]) >= 4 {
|
|
|
|
gccBaseFlags += -ffreestanding ;
|
|
|
|
}
|
|
|
|
|
|
|
|
local g++BaseFlags = $(gccBaseFlags) -fno-exceptions ;
|
|
|
|
|
2014-04-17 05:04:12 +04:00
|
|
|
if $(gccVersion[1]) >= 3 && $(HAIKU_CC_IS_CLANG_$(architecture)) != 1 {
|
2013-08-01 10:51:16 +04:00
|
|
|
g++BaseFlags += -fno-use-cxa-atexit ;
|
|
|
|
}
|
|
|
|
|
|
|
|
HAIKU_KERNEL_CCFLAGS = $(HAIKU_CCFLAGS_$(architecture)) $(gccBaseFlags) ;
|
|
|
|
HAIKU_KERNEL_C++FLAGS = $(HAIKU_C++FLAGS_$(architecture)) $(g++BaseFlags) ;
|
|
|
|
HAIKU_BOOT_CCFLAGS = $(HAIKU_CCFLAGS_$(architecture)) $(gccBaseFlags) ;
|
|
|
|
HAIKU_BOOT_C++FLAGS = $(HAIKU_C++FLAGS_$(architecture)) $(g++BaseFlags) ;
|
|
|
|
HAIKU_BOOT_LINKFLAGS = ;
|
2016-04-14 10:15:55 +03:00
|
|
|
HAIKU_BOOT_LDFLAGS = -Bstatic ;
|
2013-08-01 10:51:16 +04:00
|
|
|
|
2014-05-07 21:19:18 +04:00
|
|
|
if $(gccVersion[1]) >= 4 {
|
|
|
|
HAIKU_KERNEL_C++FLAGS += -std=gnu++11 ;
|
|
|
|
}
|
|
|
|
|
2013-08-01 10:51:16 +04:00
|
|
|
HAIKU_KERNEL_PIC_CCFLAGS = -fno-pic ;
|
|
|
|
HAIKU_KERNEL_PIC_LINKFLAGS = ;
|
|
|
|
HAIKU_KERNEL_ADDON_LINKFLAGS = ;
|
|
|
|
|
2016-04-14 10:15:55 +03:00
|
|
|
# Include embedded board-specific file.
|
|
|
|
if $(HAIKU_BOOT_BOARD) {
|
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) board $(HAIKU_BOOT_BOARD)
|
|
|
|
BoardSetup ] ;
|
|
|
|
if $(HAIKU_BOARD_LOADER_BASE) {
|
|
|
|
HAIKU_BOOT_LDFLAGS +=
|
|
|
|
--defsym BOARD_LOADER_BASE=$(HAIKU_BOARD_LOADER_BASE) ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-01 10:51:16 +04:00
|
|
|
switch $(cpu) {
|
|
|
|
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.
|
2013-09-30 05:58:54 +04:00
|
|
|
HAIKU_KERNEL_CCFLAGS += -mtune=68020-60 ;
|
|
|
|
HAIKU_KERNEL_C++FLAGS += -mtune=68020-60 ;
|
2013-08-01 10:51:16 +04:00
|
|
|
|
|
|
|
case x86 :
|
|
|
|
HAIKU_KERNEL_CCFLAGS += -march=pentium ;
|
|
|
|
HAIKU_KERNEL_C++FLAGS += -march=pentium ;
|
|
|
|
|
|
|
|
case x86_64 :
|
|
|
|
# Kernel lives in the top 2GB of the address space, use kernel code
|
|
|
|
# model.
|
|
|
|
HAIKU_KERNEL_PIC_CCFLAGS += -mcmodel=kernel ;
|
|
|
|
|
|
|
|
# Disable the red zone, which cannot be used in kernel code due to
|
|
|
|
# interrupts, and always enable the frame pointer so stack traces
|
|
|
|
# are correct.
|
|
|
|
HAIKU_KERNEL_CCFLAGS += -mno-red-zone -fno-omit-frame-pointer ;
|
|
|
|
HAIKU_KERNEL_C++FLAGS += -mno-red-zone -fno-omit-frame-pointer ;
|
|
|
|
HAIKU_KERNEL_PIC_LINKFLAGS += -z max-page-size=0x1000 ;
|
|
|
|
HAIKU_KERNEL_ADDON_LINKFLAGS += -z max-page-size=0x1000 ;
|
|
|
|
|
2016-04-14 10:15:55 +03:00
|
|
|
# BIOS Bootloader is 32-bit.
|
|
|
|
if $(HAIKU_BOOT_PLATFORM) = bios_ia32 {
|
|
|
|
HAIKU_BOOT_LINKFLAGS += -m elf_i386_haiku ;
|
|
|
|
HAIKU_BOOT_CCFLAGS += -m32 -march=pentium ;
|
|
|
|
HAIKU_BOOT_C++FLAGS += -m32 -march=pentium ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if $(HAIKU_BOOT_PLATFORM) = efi {
|
|
|
|
HAIKU_BOOT_CCFLAGS += -fpic -fno-stack-protector -fPIC -fshort-wchar -mno-red-zone
|
|
|
|
-maccumulate-outgoing-args -Wno-error=unused-variable ;
|
|
|
|
HAIKU_BOOT_C++FLAGS += -fpic -fno-stack-protector -fPIC -fshort-wchar -mno-red-zone
|
|
|
|
-maccumulate-outgoing-args -Wno-error=unused-variable ;
|
2016-04-21 03:37:24 +03:00
|
|
|
HAIKU_BOOT_LDFLAGS = -Bstatic -Bsymbolic -shared -nostdlib -znocombreloc -nostartfiles -no-undefined ;
|
2013-11-07 00:12:36 +04:00
|
|
|
} else {
|
|
|
|
HAIKU_BOOT_CCFLAGS += -fno-pic ;
|
|
|
|
HAIKU_BOOT_C++FLAGS += -fno-pic ;
|
2013-08-01 10:51:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# warning flags
|
|
|
|
HAIKU_KERNEL_WARNING_CCFLAGS = -Wall -Wno-trigraphs -Wmissing-prototypes
|
|
|
|
-Wno-multichar ;
|
|
|
|
HAIKU_KERNEL_WARNING_C++FLAGS = -Wall -Wno-trigraphs -Wno-multichar ;
|
|
|
|
|
|
|
|
# debug flags
|
|
|
|
local level ;
|
|
|
|
for level in $(HAIKU_DEBUG_LEVELS) {
|
|
|
|
local flags = $(HAIKU_DEBUG_FLAGS) [ FDefines DEBUG=$(level) ] ;
|
|
|
|
HAIKU_KERNEL_DEBUG_$(level)_CCFLAGS
|
|
|
|
= $(HAIKU_DEBUG_$(level)_CCFLAGS_$(architecture)) ;
|
|
|
|
HAIKU_KERNEL_DEBUG_$(level)_C++FLAGS
|
|
|
|
= $(HAIKU_DEBUG_$(level)_C++FLAGS_$(architecture)) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# defines
|
|
|
|
HAIKU_KERNEL_DEFINES += _KERNEL_MODE ;
|
|
|
|
|
|
|
|
HAIKU_DEFINES_$(architecture)
|
|
|
|
+= BOOT_ARCHIVE_IMAGE_OFFSET=$(HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET) ;
|
|
|
|
# TODO: That doesn't need to be a general define. It's just needed for
|
|
|
|
# compiling (part of) the boot loader.
|
|
|
|
|
|
|
|
# kernel add-on glue code
|
2014-08-01 00:01:44 +04:00
|
|
|
HAIKU_KERNEL_ADDON_BEGIN_GLUE_CODE = <$(architecture)>crtbeginS.o
|
2013-08-01 10:51:16 +04:00
|
|
|
<src!system!glue!$(architecture)>haiku_version_glue.o ;
|
2014-08-01 01:38:22 +04:00
|
|
|
HAIKU_KERNEL_ADDON_END_GLUE_CODE = <$(architecture)>crtendS.o ;
|
2013-08-01 10:51:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
rule ArchitectureSetupWarnings architecture
|
|
|
|
{
|
|
|
|
# ArchitectureSetupWarnings <architecture> ;
|
|
|
|
#
|
|
|
|
# Sets up compiler warnings and error flags for various subdirectories for
|
|
|
|
# the given packaging architecture.
|
|
|
|
|
|
|
|
local cpu = $(HAIKU_CPU_$(architecture)) ;
|
|
|
|
switch $(cpu) {
|
|
|
|
case arm :
|
|
|
|
return ;
|
|
|
|
# we use #warning as placeholders for things to write...
|
|
|
|
case m68k :
|
|
|
|
return ;
|
|
|
|
# we use #warning as placeholders for things to write...
|
2015-06-13 00:02:59 +03:00
|
|
|
case ppc :
|
|
|
|
return ;
|
|
|
|
# we use #warning as placeholders for things to write...
|
2013-08-01 10:51:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# enable -Werror for certain parts of the source tree
|
|
|
|
HAIKU_WERROR_ARCH = $(architecture) ;
|
|
|
|
|
|
|
|
rule EnableWerror dirTokens : scope {
|
2014-01-11 00:06:25 +04:00
|
|
|
# Clang gives way more warnings than GCC, so that code won't compile
|
2014-07-17 03:25:27 +04:00
|
|
|
# with -Werror when using Clang.
|
2014-04-15 11:15:53 +04:00
|
|
|
if $(HAIKU_CC_IS_CLANG_$(architecture)) != 1 {
|
2014-01-11 00:06:25 +04:00
|
|
|
SetConfigVar WARNINGS : HAIKU_TOP $(dirTokens) : treatAsErrors
|
|
|
|
: $(scope) ;
|
|
|
|
}
|
2013-08-01 10:51:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# Work-around for GCC 2 problem -- despite -Wno-multichar it reports
|
|
|
|
# multichar warnings in headers/private/kernel/debugger_keymaps.h included
|
|
|
|
# by src/system/kernel/arch/x86/arch_debug_console.cpp.
|
Fix kernel -Werror support
The introduction of secondary arch support for kernel files disabled
-Werror for all kernel files, since the -Werror flags were moved from
{CC,C++}FLAGS to TARGET_WARNING_{CC,C++}FLAGS_<arch>, which, however,
was overwritten by the SetupKernel rule. This commit introduces new
global variables {HAIKU,HOST,TARGET}_WERROR_FLAGS[_<arch>], which
contain the additional -Werror flags to be applied for the architecture.
The config variable WARNINGS can be set to "treatAsErrors" to cause
-Werror and {HOST,TARGET}_WERROR_FLAGS[_<arch>] to be appended to the
compilation flags.
Fixes #10280.
2013-12-05 15:37:14 +04:00
|
|
|
local gccVersion = $(HAIKU_GCC_VERSION_$(architecture)) ;
|
2013-08-01 10:51:16 +04:00
|
|
|
if $(gccVersion[1]) = 2 {
|
|
|
|
local file = <src!system!kernel!arch!x86>arch_debug_console.o ;
|
2013-12-05 23:41:27 +04:00
|
|
|
WARNINGS on $(file) = $(WARNINGS) ;
|
2013-08-01 10:51:16 +04:00
|
|
|
}
|
|
|
|
|
2014-04-03 20:52:17 +04:00
|
|
|
if $(HAIKU_CC_IS_CLANG_$(architecture)) = 1 {
|
2014-01-11 00:06:25 +04:00
|
|
|
# We need -integrated-as, as otherwise Clang uses GCC as assembler and
|
|
|
|
# passes -fheinous-gnu-extensions to GCC, which GCC does not understand
|
|
|
|
# then errors out.
|
|
|
|
AppendToConfigVar CCFLAGS :
|
|
|
|
HAIKU_TOP src system libroot posix glibc :
|
|
|
|
-integrated-as -fgnu89-inline -fheinous-gnu-extensions : global ;
|
|
|
|
}
|
|
|
|
|
2014-10-19 16:59:39 +04:00
|
|
|
EnableWerror src add-ons accelerants ;
|
2013-08-01 10:51:16 +04:00
|
|
|
EnableWerror src add-ons bluetooth ;
|
|
|
|
EnableWerror src add-ons decorators ;
|
|
|
|
EnableWerror src add-ons disk_systems ;
|
|
|
|
EnableWerror src add-ons input_server devices ;
|
2014-10-19 16:59:39 +04:00
|
|
|
EnableWerror src add-ons input_server filters ;
|
2014-10-19 17:05:07 +04:00
|
|
|
# EnableWerror src add-ons input_server methods pen ;
|
|
|
|
EnableWerror src add-ons input_server methods t9 ;
|
2013-08-01 10:51:16 +04:00
|
|
|
EnableWerror src add-ons kernel bluetooth ;
|
2017-02-21 21:28:33 +03:00
|
|
|
EnableWerror src add-ons kernel bus_managers acpi ;
|
2013-08-01 10:51:16 +04:00
|
|
|
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 ;
|
2014-10-28 12:57:33 +03:00
|
|
|
# EnableWerror src add-ons kernel bus_managers firewire ;
|
2014-10-28 00:59:38 +03:00
|
|
|
EnableWerror src add-ons kernel bus_managers ide ;
|
2013-08-01 10:51:16 +04:00
|
|
|
EnableWerror src add-ons kernel bus_managers isa ;
|
|
|
|
EnableWerror src add-ons kernel bus_managers pci ;
|
2016-02-22 01:36:29 +03:00
|
|
|
EnableWerror src add-ons kernel bus_managers ps2 ;
|
2014-10-28 00:59:38 +03:00
|
|
|
EnableWerror src add-ons kernel bus_managers random ;
|
2013-08-01 10:51:16 +04:00
|
|
|
EnableWerror src add-ons kernel bus_managers scsi ;
|
2014-10-28 00:59:38 +03:00
|
|
|
EnableWerror src add-ons kernel bus_managers tty ;
|
2013-08-01 10:51:16 +04:00
|
|
|
EnableWerror src add-ons kernel bus_managers usb ;
|
2014-10-28 00:59:38 +03:00
|
|
|
EnableWerror src add-ons kernel bus_managers virtio ;
|
2013-08-01 10:51:16 +04:00
|
|
|
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 ;
|
2016-08-27 10:03:56 +03:00
|
|
|
EnableWerror src add-ons kernel drivers graphics intel_extreme ;
|
2013-08-01 10:51:16 +04:00
|
|
|
# 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 ;
|
|
|
|
EnableWerror src add-ons kernel file_systems bfs ;
|
|
|
|
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 nfs4 ;
|
|
|
|
# EnableWerror src add-ons kernel file_systems ntfs ;
|
|
|
|
EnableWerror src add-ons kernel file_systems packagefs ;
|
|
|
|
EnableWerror src add-ons kernel file_systems ramfs ;
|
|
|
|
# EnableWerror src add-ons kernel file_systems reiserfs ;
|
|
|
|
EnableWerror src add-ons kernel file_systems udf ;
|
|
|
|
EnableWerror src add-ons kernel file_systems userlandfs ;
|
|
|
|
EnableWerror src add-ons kernel generic ;
|
|
|
|
# EnableWerror src add-ons kernel network datalink_protocols ;
|
|
|
|
EnableWerror src add-ons kernel network devices ;
|
|
|
|
EnableWerror src add-ons kernel network dns_resolver ;
|
|
|
|
EnableWerror src add-ons kernel network notifications ;
|
|
|
|
EnableWerror src add-ons kernel network ppp ;
|
|
|
|
EnableWerror src add-ons kernel network protocols ;
|
|
|
|
# EnableWerror src add-ons kernel network stack ;
|
|
|
|
EnableWerror src add-ons kernel partitioning_systems ;
|
2014-01-29 02:18:38 +04:00
|
|
|
EnableWerror src add-ons kernel power ;
|
2013-08-01 10:51:16 +04:00
|
|
|
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 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 ;
|
2016-07-10 20:13:22 +03:00
|
|
|
EnableWerror src add-ons translators jpeg ;
|
2013-08-01 10:51:16 +04:00
|
|
|
EnableWerror src add-ons translators jpeg2000 ;
|
|
|
|
EnableWerror src add-ons translators pcx ;
|
2016-07-10 20:13:22 +03:00
|
|
|
EnableWerror src add-ons translators png ;
|
2013-08-01 10:51:16 +04:00
|
|
|
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 ;
|
2016-07-10 20:13:22 +03:00
|
|
|
EnableWerror src add-ons translators stxt ;
|
2013-08-01 10:51:16 +04:00
|
|
|
EnableWerror src add-ons translators tga ;
|
|
|
|
EnableWerror src add-ons translators tiff ;
|
2016-07-10 20:13:22 +03:00
|
|
|
EnableWerror src add-ons translators wonderbrush ;
|
2013-08-01 10:51:16 +04:00
|
|
|
EnableWerror src add-ons print ;
|
2014-03-27 19:46:57 +04:00
|
|
|
EnableWerror src bin desklink ;
|
2013-09-18 18:10:38 +04:00
|
|
|
EnableWerror src bin multiuser ;
|
2013-08-01 10:51:16 +04:00
|
|
|
EnableWerror src bin package ;
|
2013-08-28 02:35:57 +04:00
|
|
|
EnableWerror src bin package_repo ;
|
|
|
|
EnableWerror src bin pkgman ;
|
2014-03-23 00:23:30 +04:00
|
|
|
EnableWerror src libs bsd ;
|
2013-08-01 10:51:16 +04:00
|
|
|
EnableWerror src apps ;
|
|
|
|
EnableWerror src kits ;
|
|
|
|
EnableWerror src preferences ;
|
|
|
|
EnableWerror src servers ;
|
2014-01-29 01:52:58 +04:00
|
|
|
EnableWerror src system boot ;
|
2016-03-04 22:23:17 +03:00
|
|
|
# EnableWerror src system kernel ;
|
2013-08-01 10:51:16 +04:00
|
|
|
EnableWerror src system libroot add-ons ;
|
2014-01-29 02:07:50 +04:00
|
|
|
EnableWerror src system libroot os ;
|
2013-08-01 10:51:16 +04:00
|
|
|
EnableWerror src system libroot posix locale ;
|
|
|
|
EnableWerror src system libroot posix wchar ;
|
|
|
|
EnableWerror src system runtime_loader ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-05 08:37:56 +04:00
|
|
|
rule MultiArchIfPrimary ifValue : elseValue : architecture
|
2013-08-01 10:51:16 +04:00
|
|
|
{
|
2013-08-05 08:37:56 +04:00
|
|
|
# MultiArchIfPrimary <ifValue> : <elseValue>
|
|
|
|
# [ : <architecture> = $(TARGET_PACKAGING_ARCH) ] ;
|
2013-08-01 10:51:16 +04:00
|
|
|
#
|
|
|
|
# Returns one of the two given values depending on whether
|
2013-08-05 08:37:56 +04:00
|
|
|
# <architecture> is the primary packaging architecture.
|
2013-08-01 10:51:16 +04:00
|
|
|
|
2013-08-05 08:37:56 +04:00
|
|
|
architecture ?= $(TARGET_PACKAGING_ARCH) ;
|
|
|
|
|
|
|
|
if $(architecture) = $(TARGET_PACKAGING_ARCHS[1]) {
|
2013-08-01 10:51:16 +04:00
|
|
|
return $(ifValue) ;
|
|
|
|
}
|
|
|
|
return $(elseValue) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
rule MultiArchConditionalGristFiles files : primaryGrist : secondaryGrist
|
2013-08-05 08:37:56 +04:00
|
|
|
: architecture
|
2013-08-01 10:51:16 +04:00
|
|
|
{
|
|
|
|
# MultiArchConditionalGristFiles <files> : <primaryGrist>
|
2013-08-05 08:37:56 +04:00
|
|
|
# : <secondaryGrist> [ : <architecture> = $(TARGET_PACKAGING_ARCH) ] ;
|
2013-08-01 10:51:16 +04:00
|
|
|
#
|
|
|
|
# Returns <files> with their grist set to either <primaryGrist> or
|
2013-08-05 08:37:56 +04:00
|
|
|
# <secondaryGrist> depending on whether <architecture> is the primary
|
|
|
|
# packaging architecture.
|
|
|
|
|
|
|
|
architecture ?= $(TARGET_PACKAGING_ARCH) ;
|
2013-08-01 10:51:16 +04:00
|
|
|
|
2013-08-05 08:37:56 +04:00
|
|
|
local grist = [ MultiArchIfPrimary $(primaryGrist) : $(secondaryGrist)
|
|
|
|
: $(architecture) ] ;
|
2013-08-01 10:51:16 +04:00
|
|
|
return $(files:G=$(grist:E=)) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-05 08:37:56 +04:00
|
|
|
rule MultiArchDefaultGristFiles files : gristPrefix : architecture
|
2013-08-01 10:51:16 +04:00
|
|
|
{
|
2013-08-05 08:37:56 +04:00
|
|
|
# MultiArchDefaultGristFiles <files> : <gristPrefix>
|
|
|
|
# [ : <architecture> = $(TARGET_PACKAGING_ARCH) ] ;
|
2013-08-01 10:51:16 +04:00
|
|
|
#
|
|
|
|
# Convenient shorthand for MultiArchConditionalGristFiles for the common
|
|
|
|
# case that for a secondary packaging architecture the packaging
|
|
|
|
# architecture name shall be appended to the grist while it shall be omitted
|
2013-08-05 08:37:56 +04:00
|
|
|
# for the primary packaging architecture. IOW, if architecture is the
|
|
|
|
# primary packaging architecture, <files> are returned with their grist set
|
|
|
|
# to <gristPrefix>, otherwise <files> are returned with their grist set to
|
|
|
|
# <gristPrefix>!<architecture> respectively <architecture> (if <gristPrefix>
|
|
|
|
# is empty).
|
|
|
|
|
|
|
|
architecture ?= $(TARGET_PACKAGING_ARCH) ;
|
2013-08-01 10:51:16 +04:00
|
|
|
|
2013-08-05 08:37:56 +04:00
|
|
|
local secondaryGrist = $(gristPrefix)!$(architecture) ;
|
|
|
|
secondaryGrist ?= $(architecture) ;
|
2013-08-01 10:51:16 +04:00
|
|
|
|
|
|
|
return [ MultiArchConditionalGristFiles $(files) : $(gristPrefix) :
|
2013-08-05 08:37:56 +04:00
|
|
|
$(secondaryGrist) : $(architecture) ] ;
|
2013-08-01 10:51:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
rule MultiArchSubDirSetup architectures
|
|
|
|
{
|
|
|
|
# MultiArchSubDirSetup <architectures> ;
|
|
|
|
#
|
|
|
|
# For each of the given packaging architectures <architectures> that are
|
|
|
|
# in the packaging architectures configured for the build (or all configured
|
|
|
|
# packaging architectures, if <architectures> is empty) an object is
|
|
|
|
# prepared that can be used for an "on ... { ... }" block to set up subdir
|
|
|
|
# variables for the respective packaging architecture. Most notably
|
2014-08-01 16:53:45 +04:00
|
|
|
# TARGET_PACKAGING_ARCH, TARGET_ARCH are set to the values for the
|
|
|
|
# respective packaging architecture. The per-subdir variables SOURCE_GRIST,
|
|
|
|
# LOCATE_TARGET, LOCATE_SOURCE, SEARCH_SOURCE, *_LOCATE_TARGET, are reset.
|
|
|
|
# All SUBDIR* and config variables are set to the values they had when this
|
|
|
|
# rule was invoked.
|
2013-08-01 10:51:16 +04:00
|
|
|
|
|
|
|
local result ;
|
|
|
|
architectures ?= $(TARGET_PACKAGING_ARCHS) ;
|
|
|
|
local architecture ;
|
|
|
|
for architecture in $(architectures) {
|
|
|
|
if ! $(architecture) in $(TARGET_PACKAGING_ARCHS) {
|
|
|
|
continue ;
|
|
|
|
}
|
|
|
|
|
|
|
|
local architectureObject = $(architecture:G=<arch-object>) ;
|
|
|
|
result += $(architectureObject) ;
|
|
|
|
|
|
|
|
# Set the variables that default to the values of the respective
|
|
|
|
# variables for the primary architecture.
|
|
|
|
TARGET_PACKAGING_ARCH on $(architectureObject) = $(architecture) ;
|
|
|
|
|
|
|
|
local var ;
|
2014-08-01 16:53:45 +04:00
|
|
|
for var in TARGET_ARCH {
|
2013-08-01 10:51:16 +04:00
|
|
|
$(var) on $(architectureObject) = $($(var)_$(architecture)) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Clone the current config variable values and the variables SubDir
|
|
|
|
# resets.
|
|
|
|
for var in $(AUTO_SET_UP_CONFIG_VARIABLES) SUBDIR$(SUBDIRRESET) {
|
|
|
|
$(var) on $(architectureObject) = $($(var)) ;
|
|
|
|
}
|
|
|
|
|
2015-06-15 20:27:12 +03:00
|
|
|
# adjust SOURCE_GRIST and HDRGRIST
|
2013-08-01 10:51:16 +04:00
|
|
|
SOURCE_GRIST on $(architectureObject)
|
|
|
|
= $(SOURCE_GRIST:E=)!$(architecture) ;
|
|
|
|
|
2015-06-15 20:27:12 +03:00
|
|
|
HDRGRIST on $(architectureObject)
|
|
|
|
= $(HDRGRIST:E=)!$(architecture) ;
|
|
|
|
|
2013-08-01 10:51:16 +04:00
|
|
|
# Adjust the subdir's object dirs that are architecture dependent. To
|
|
|
|
# avoid duplicating the code from SetupObjectsDir, we call it. Since it
|
|
|
|
# sets global variables, we set these variables on our object, call
|
|
|
|
# SetupObjectsDir in an "on" block, and grab the new variable values.
|
|
|
|
local hostTarget = HOST TARGET ;
|
|
|
|
local objectDirVars =
|
|
|
|
COMMON_ARCH COMMON_DEBUG DEBUG_$(HAIKU_DEBUG_LEVELS)
|
|
|
|
;
|
|
|
|
objectDirVars =
|
|
|
|
COMMON_PLATFORM_LOCATE_TARGET
|
|
|
|
$(hostTarget)_$(objectDirVars)_LOCATE_TARGET
|
|
|
|
LOCATE_TARGET
|
|
|
|
LOCATE_SOURCE
|
|
|
|
SEARCH_SOURCE
|
|
|
|
;
|
|
|
|
|
|
|
|
for var in $(objectDirVars) {
|
|
|
|
$(var) on $(architectureObject) = ;
|
|
|
|
}
|
|
|
|
|
|
|
|
on $(architectureObject) {
|
|
|
|
SetupObjectsDir ;
|
|
|
|
|
|
|
|
for var in $(objectDirVars) {
|
|
|
|
$(var) on $(architectureObject) = $($(var)) ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $(result) ;
|
|
|
|
}
|