2005-10-29 20:27:43 +04:00
|
|
|
# Haiku Jamrules
|
2005-03-05 17:11:02 +03:00
|
|
|
|
2005-10-29 20:27:43 +04: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 20:21:14 +04:00
|
|
|
HAIKU_OBJECT_DIR = [ FDirName $(HAIKU_OUTPUT_DIR)
|
|
|
|
objects ] ;
|
2010-09-26 20:55:06 +04:00
|
|
|
HAIKU_CATALOGS_OBJECT_DIR = [ FDirName $(HAIKU_OBJECT_DIR)
|
|
|
|
catalogs ] ;
|
2005-10-29 20:27:43 +04:00
|
|
|
HAIKU_COMMON_PLATFORM_OBJECT_DIR = [ FDirName $(HAIKU_OBJECT_DIR) common ] ;
|
2009-11-26 14:11:17 +03:00
|
|
|
HAIKU_DOWNLOAD_DIR = [ FDirName $(HAIKU_OUTPUT_DIR)
|
|
|
|
download ] ;
|
2009-04-08 14:07:17 +04:00
|
|
|
HAIKU_OPTIONAL_BUILD_PACKAGES_DIR = [ FDirName $(HAIKU_OUTPUT_DIR)
|
|
|
|
build_packages ] ;
|
2002-11-20 03:46:04 +03:00
|
|
|
|
|
|
|
# Cache files for header scanning and jamfile caching
|
|
|
|
HCACHEFILE = header_cache ;
|
|
|
|
JCACHEFILE = jamfile_cache ;
|
2005-10-29 20:27:43 +04:00
|
|
|
LOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(HAIKU_BUILD_OUTPUT_DIR) ;
|
|
|
|
|
2008-10-24 01:45:24 +04: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-08-01 10:51:16 +04:00
|
|
|
# set HAIKU_PACKAGING_ARCH, the primary packaging architecture
|
2013-07-26 01:52:11 +04:00
|
|
|
HAIKU_PACKAGING_ARCH = $(HAIKU_PACKAGING_ARCHS[1]) ;
|
|
|
|
|
2005-10-29 20:27:43 +04: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 06:37:12 +04:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) MathRules ] ;
|
2013-08-01 10:51:16 +04:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) ArchitectureRules ] ;
|
2005-10-29 20:27:43 +04:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) BeOSRules ] ;
|
2013-08-05 02:17:46 +04:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatureRules ] ;
|
2010-07-23 23:56:24 +04:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) LocaleRules ] ;
|
2009-02-24 01:33:09 +03:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) CommandLineArguments ] ;
|
2005-10-29 20:27:43 +04: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-27 00:47:27 +04:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) BootRules ] ;
|
2005-10-29 20:27:43 +04:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) ImageRules ] ;
|
2009-02-15 05:34:32 +03:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) CDRules ] ;
|
2005-10-29 20:27:43 +04: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 12:51:42 +04:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) RepositoryRules ] ;
|
2005-10-29 20:27:43 +04:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) TestsRules ] ;
|
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildSetup ] ;
|
2013-07-21 05:20:26 +04:00
|
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) DefaultBuildProfiles ] ;
|
2005-10-29 20:27:43 +04:00
|
|
|
|
2013-07-05 12:51:42 +04:00
|
|
|
# Include the repositories for this architecture.
|
|
|
|
local repositoriesDirectory
|
|
|
|
= [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories ] ;
|
2013-07-21 06:10:48 +04:00
|
|
|
local repositories = HaikuPorts ;
|
|
|
|
if $(HAIKU_BOOTSTRAP_BUILD) {
|
|
|
|
repositories = HaikuPortsCross ;
|
|
|
|
}
|
|
|
|
|
2013-07-05 12:51:42 +04:00
|
|
|
local repository ;
|
2013-07-21 06:10:48 +04:00
|
|
|
for repository in $(repositories) {
|
2013-07-05 12:51:42 +04:00
|
|
|
local repositoryDirectory
|
|
|
|
= [ FDirName $(repositoriesDirectory) $(repository) ] ;
|
|
|
|
local file = [ Glob $(repositoryDirectory) : $(HAIKU_PACKAGING_ARCH) ] ;
|
|
|
|
if $(file) {
|
2013-07-06 04:29:51 +04:00
|
|
|
HAIKU_REPOSITORY_JAMFILE = $(file) ;
|
2013-07-05 12:51:42 +04:00
|
|
|
include $(file) ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-03 05:02:28 +03:00
|
|
|
# Declare no-op user-overridable build rules.
|
|
|
|
rule UserBuildConfigRulePostBuildTargets { }
|
|
|
|
rule UserBuildConfigRulePreImage { }
|
|
|
|
rule UserBuildConfigRulePostImage { }
|
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
# Include UserBuildConfig.
|
2009-05-27 04:45:44 +04:00
|
|
|
if ! $(HAIKU_IGNORE_USER_BUILD_CONFIG) {
|
2005-10-29 20:27:43 +04:00
|
|
|
local userBuildConfig
|
|
|
|
= [ GLOB $(HAIKU_BUILD_RULES_DIR) : UserBuildConfig ] ;
|
|
|
|
if $(userBuildConfig) {
|
|
|
|
include $(userBuildConfig) ;
|
|
|
|
}
|
2009-02-08 16:20:19 +03:00
|
|
|
|
|
|
|
# allow for a separate UserBuildConfig per output directory
|
|
|
|
local userBuildConfig
|
|
|
|
= [ GLOB $(HAIKU_OUTPUT_DIR) : UserBuildConfig ] ;
|
|
|
|
if $(userBuildConfig) {
|
|
|
|
include $(userBuildConfig) ;
|
|
|
|
}
|
2005-10-29 20:27:43 +04:00
|
|
|
}
|
|
|
|
|
2013-07-21 05:20:26 +04:00
|
|
|
DefineDefaultBuildProfiles ;
|
2008-04-03 00:29:43 +04:00
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
PrepareConfigVariables ;
|