2005-10-29 18:27:43 +02:00
|
|
|
# Haiku Jamrules
|
2005-03-05 15:11:02 +01:00
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
# Main directories used by the build.
|
|
|
|
HAIKU_OUTPUT_DIR ?= [ FDirName $(HAIKU_TOP) generated ] ;
|
|
|
|
HAIKU_BUILD_OUTPUT_DIR = [ FDirName $(HAIKU_OUTPUT_DIR) build ] ;
|
|
|
|
HAIKU_BUILD_DIR = [ FDirName $(HAIKU_TOP) build ] ;
|
|
|
|
HAIKU_BUILD_RULES_DIR = [ FDirName $(HAIKU_BUILD_DIR) jam ] ;
|
2010-09-26 18:21:14 +02:00
|
|
|
HAIKU_OBJECT_DIR = [ FDirName $(HAIKU_OUTPUT_DIR)
|
|
|
|
objects ] ;
|
2010-09-26 18:55:06 +02:00
|
|
|
HAIKU_CATALOGS_OBJECT_DIR = [ FDirName $(HAIKU_OBJECT_DIR)
|
|
|
|
catalogs ] ;
|
2005-10-29 18:27:43 +02:00
|
|
|
HAIKU_COMMON_PLATFORM_OBJECT_DIR = [ FDirName $(HAIKU_OBJECT_DIR) common ] ;
|
2009-11-26 12:11:17 +01:00
|
|
|
HAIKU_DOWNLOAD_DIR = [ FDirName $(HAIKU_OUTPUT_DIR)
|
|
|
|
download ] ;
|
2009-04-08 12:07:17 +02:00
|
|
|
HAIKU_OPTIONAL_BUILD_PACKAGES_DIR = [ FDirName $(HAIKU_OUTPUT_DIR)
|
|
|
|
build_packages ] ;
|
2002-11-20 01:46:04 +01:00
|
|
|
|
|
|
|
# Cache files for header scanning and jamfile caching
|
|
|
|
HCACHEFILE = header_cache ;
|
|
|
|
JCACHEFILE = jamfile_cache ;
|
2005-10-29 18:27:43 +02:00
|
|
|
LOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(HAIKU_BUILD_OUTPUT_DIR) ;
|
|
|
|
|
2008-10-23 23:45:24 +02:00
|
|
|
# include BuildConfig
|
|
|
|
local buildConfig = [ GLOB $(HAIKU_BUILD_OUTPUT_DIR) : BuildConfig ] ;
|
|
|
|
if ! $(buildConfig) {
|
|
|
|
ECHO "No `BuildConfig' found in $(HAIKU_BUILD_OUTPUT_DIR)!" ;
|
|
|
|
EXIT "Run ./configure in the source tree's root directory first!" ;
|
|
|
|
}
|
|
|
|
LOCATE on BuildConfig = $(HAIKU_BUILD_OUTPUT_DIR) ;
|
|
|
|
include BuildConfig ;
|
|
|
|
|
2013-07-25 23:52:11 +02:00
|
|
|
# Set simplified variables for primary architecture.
|
|
|
|
HAIKU_PACKAGING_ARCH = $(HAIKU_PACKAGING_ARCHS[1]) ;
|
|
|
|
local variable ;
|
|
|
|
for variable in
|
|
|
|
HAIKU_GCC_RAW_VERSION
|
|
|
|
HAIKU_GCC_MACHINE
|
|
|
|
HAIKU_GCC_LIB_DIR
|
|
|
|
HAIKU_GCC_HEADERS_DIR
|
|
|
|
HAIKU_GCC_LIBGCC
|
|
|
|
HAIKU_GCC_LIBGCC_OBJECTS
|
|
|
|
HAIKU_CPU
|
|
|
|
HAIKU_STATIC_LIBSTDC++
|
|
|
|
HAIKU_SHARED_LIBSTDC++
|
|
|
|
HAIKU_STATIC_LIBSUPC++
|
|
|
|
HAIKU_SHARED_LIBSUPC++
|
|
|
|
HAIKU_C++_HEADERS_DIR
|
|
|
|
HAIKU_KERNEL_LIBGCC
|
|
|
|
HAIKU_KERNEL_LIBSUPC++
|
|
|
|
HAIKU_BOOT_LIBGCC
|
|
|
|
HAIKU_BOOT_LIBSUPC++
|
|
|
|
HAIKU_AR
|
|
|
|
HAIKU_CC
|
|
|
|
HAIKU_LD
|
|
|
|
HAIKU_OBJCOPY
|
|
|
|
HAIKU_RANLIB
|
|
|
|
HAIKU_ELFEDIT
|
|
|
|
HAIKU_STRIP
|
|
|
|
HAIKU_CPPFLAGS
|
|
|
|
HAIKU_CCFLAGS
|
|
|
|
HAIKU_C++FLAGS
|
|
|
|
HAIKU_LDFLAGS
|
|
|
|
HAIKU_ARFLAGS
|
|
|
|
HAIKU_UNARFLAGS
|
|
|
|
HAIKU_USE_GCC_GRAPHITE {
|
|
|
|
$(variable) = $($(variable)_$(HAIKU_PACKAGING_ARCH)) ;
|
|
|
|
}
|
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
# The build setup and rules are neatly organized in several files. Include
|
|
|
|
# them now. Start with the side-effect-less rules, since they are the most
|
|
|
|
# likely to be used in the top level context (i.e. not only in rules).
|
|
|
|
# At the end include BuildSetup that sets up global variables etc. The
|
|
|
|
# optional user-defined UserBuildConfig is included thereafter.
|
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) HelperRules ] ;
|
2007-04-06 04:37:12 +02:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) MathRules ] ;
|
2005-10-29 18:27:43 +02:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) BeOSRules ] ;
|
2010-07-23 21:56:24 +02:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) LocaleRules ] ;
|
2009-02-23 23:33:09 +01:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) CommandLineArguments ] ;
|
2005-10-29 18:27:43 +02:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) ConfigRules ] ;
|
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) DocumentationRules ] ;
|
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) FileRules ] ;
|
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) HeadersRules ] ;
|
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) KernelRules ] ;
|
2012-05-26 22:47:27 +02:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) BootRules ] ;
|
2005-10-29 18:27:43 +02:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) ImageRules ] ;
|
2009-02-15 03:34:32 +01:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) CDRules ] ;
|
2005-10-29 18:27:43 +02:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) MainBuildRules ] ;
|
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) MiscRules ] ;
|
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) OverriddenJamRules ] ;
|
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) PackageRules ] ;
|
2013-07-05 10:51:42 +02:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) RepositoryRules ] ;
|
2005-10-29 18:27:43 +02:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) TestsRules ] ;
|
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildSetup ] ;
|
2013-07-21 03:20:26 +02:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) DefaultBuildProfiles ] ;
|
2005-10-29 18:27:43 +02:00
|
|
|
|
2013-07-05 10:51:42 +02:00
|
|
|
# Include the repositories for this architecture.
|
|
|
|
local repositoriesDirectory
|
|
|
|
= [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories ] ;
|
2013-07-21 04:10:48 +02:00
|
|
|
local repositories = HaikuPorts ;
|
|
|
|
if $(HAIKU_BOOTSTRAP_BUILD) {
|
|
|
|
repositories = HaikuPortsCross ;
|
|
|
|
}
|
|
|
|
|
2013-07-05 10:51:42 +02:00
|
|
|
local repository ;
|
2013-07-21 04:10:48 +02:00
|
|
|
for repository in $(repositories) {
|
2013-07-05 10:51:42 +02:00
|
|
|
local repositoryDirectory
|
|
|
|
= [ FDirName $(repositoriesDirectory) $(repository) ] ;
|
|
|
|
local file = [ Glob $(repositoryDirectory) : $(HAIKU_PACKAGING_ARCH) ] ;
|
|
|
|
if $(file) {
|
2013-07-06 02:29:51 +02:00
|
|
|
HAIKU_REPOSITORY_JAMFILE = $(file) ;
|
2013-07-05 10:51:42 +02:00
|
|
|
include $(file) ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-03 03:02:28 +01:00
|
|
|
# Declare no-op user-overridable build rules.
|
|
|
|
rule UserBuildConfigRulePostBuildTargets { }
|
|
|
|
rule UserBuildConfigRulePreImage { }
|
|
|
|
rule UserBuildConfigRulePostImage { }
|
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
# Include UserBuildConfig.
|
2009-05-27 02:45:44 +02:00
|
|
|
if ! $(HAIKU_IGNORE_USER_BUILD_CONFIG) {
|
2005-10-29 18:27:43 +02:00
|
|
|
local userBuildConfig
|
|
|
|
= [ GLOB $(HAIKU_BUILD_RULES_DIR) : UserBuildConfig ] ;
|
|
|
|
if $(userBuildConfig) {
|
|
|
|
include $(userBuildConfig) ;
|
|
|
|
}
|
2009-02-08 14:20:19 +01:00
|
|
|
|
|
|
|
# allow for a separate UserBuildConfig per output directory
|
|
|
|
local userBuildConfig
|
|
|
|
= [ GLOB $(HAIKU_OUTPUT_DIR) : UserBuildConfig ] ;
|
|
|
|
if $(userBuildConfig) {
|
|
|
|
include $(userBuildConfig) ;
|
|
|
|
}
|
2005-10-29 18:27:43 +02:00
|
|
|
}
|
|
|
|
|
2013-07-21 03:20:26 +02:00
|
|
|
DefineDefaultBuildProfiles ;
|
2008-04-02 22:29:43 +02:00
|
|
|
|
2005-10-29 18:27:43 +02:00
|
|
|
PrepareConfigVariables ;
|