1# Haiku Jamrules 2 3# Main directories used by the build. 4HAIKU_OUTPUT_DIR ?= [ FDirName $(HAIKU_TOP) generated ] ; 5HAIKU_BUILD_OUTPUT_DIR ?= [ FDirName $(HAIKU_OUTPUT_DIR) build ] ; 6HAIKU_BUILD_DIR ?= [ FDirName $(HAIKU_TOP) build ] ; 7HAIKU_BUILD_RULES_DIR ?= [ FDirName $(HAIKU_BUILD_DIR) jam ] ; 8HAIKU_OBJECT_DIR ?= [ FDirName $(HAIKU_OUTPUT_DIR) 9 objects ] ; 10HAIKU_CATALOGS_OBJECT_DIR ?= [ FDirName $(HAIKU_OBJECT_DIR) 11 catalogs ] ; 12HAIKU_COMMON_PLATFORM_OBJECT_DIR ?= [ FDirName $(HAIKU_OBJECT_DIR) common ] ; 13HAIKU_DOWNLOAD_DIR ?= [ FDirName $(HAIKU_OUTPUT_DIR) 14 download ] ; 15HAIKU_OPTIONAL_BUILD_PACKAGES_DIR ?= [ FDirName $(HAIKU_OUTPUT_DIR) 16 build_packages ] ; 17 18# Cache files for header scanning and jamfile caching 19HCACHEFILE = header_cache ; 20JCACHEFILE = jamfile_cache ; 21LOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(HAIKU_BUILD_OUTPUT_DIR) ; 22 23# include BuildConfig 24local buildConfig = [ GLOB $(HAIKU_BUILD_OUTPUT_DIR) : BuildConfig ] ; 25if ! $(buildConfig) { 26 ECHO "No `BuildConfig' found in $(HAIKU_BUILD_OUTPUT_DIR)!" ; 27 EXIT "Run ./configure in the source tree's root directory first!" ; 28} 29LOCATE on BuildConfig = $(HAIKU_BUILD_OUTPUT_DIR) ; 30include BuildConfig ; 31 32# set HAIKU_PACKAGING_ARCH, the primary packaging architecture 33HAIKU_PACKAGING_ARCH = $(HAIKU_PACKAGING_ARCHS[1]) ; 34 35# The build setup and rules are neatly organized in several files. Include 36# them now. Start with the side-effect-less rules, since they are the most 37# likely to be used in the top level context (i.e. not only in rules). 38# At the end include BuildSetup that sets up global variables etc. The 39# optional user-defined UserBuildConfig is included thereafter. 40include [ FDirName $(HAIKU_BUILD_RULES_DIR) HelperRules ] ; 41include [ FDirName $(HAIKU_BUILD_RULES_DIR) MathRules ] ; 42include [ FDirName $(HAIKU_BUILD_RULES_DIR) ArchitectureRules ] ; 43include [ FDirName $(HAIKU_BUILD_RULES_DIR) BeOSRules ] ; 44include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatureRules ] ; 45include [ FDirName $(HAIKU_BUILD_RULES_DIR) LocaleRules ] ; 46include [ FDirName $(HAIKU_BUILD_RULES_DIR) CommandLineArguments ] ; 47include [ FDirName $(HAIKU_BUILD_RULES_DIR) ConfigRules ] ; 48include [ FDirName $(HAIKU_BUILD_RULES_DIR) DocumentationRules ] ; 49include [ FDirName $(HAIKU_BUILD_RULES_DIR) FileRules ] ; 50include [ FDirName $(HAIKU_BUILD_RULES_DIR) HeadersRules ] ; 51include [ FDirName $(HAIKU_BUILD_RULES_DIR) KernelRules ] ; 52include [ FDirName $(HAIKU_BUILD_RULES_DIR) BootRules ] ; 53include [ FDirName $(HAIKU_BUILD_RULES_DIR) ImageRules ] ; 54include [ FDirName $(HAIKU_BUILD_RULES_DIR) CDRules ] ; 55include [ FDirName $(HAIKU_BUILD_RULES_DIR) MainBuildRules ] ; 56include [ FDirName $(HAIKU_BUILD_RULES_DIR) MiscRules ] ; 57include [ FDirName $(HAIKU_BUILD_RULES_DIR) OverriddenJamRules ] ; 58include [ FDirName $(HAIKU_BUILD_RULES_DIR) PackageRules ] ; 59include [ FDirName $(HAIKU_BUILD_RULES_DIR) RepositoryRules ] ; 60include [ FDirName $(HAIKU_BUILD_RULES_DIR) SystemLibraryRules ] ; 61include [ FDirName $(HAIKU_BUILD_RULES_DIR) TestsRules ] ; 62include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildSetup ] ; 63include [ FDirName $(HAIKU_BUILD_RULES_DIR) DefaultBuildProfiles ] ; 64 65# Include the repositories for this architecture. 66local repositoriesDirectory 67 = [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories ] ; 68local repositories = HaikuPorts ; 69if $(HAIKU_BUILD_TYPE) = bootstrap { 70 repositories = HaikuPortsCross ; 71} 72 73local repository ; 74for repository in $(repositories) { 75 local repositoryDirectory 76 = [ FDirName $(repositoriesDirectory) $(repository) ] ; 77 local file = [ Glob $(repositoryDirectory) : $(HAIKU_PACKAGING_ARCH) ] ; 78 if $(file) { 79 HAIKU_REPOSITORY_JAMFILE = $(file) ; 80 include $(file) ; 81 } 82} 83 84# Declare no-op user-overridable build rules. 85rule UserBuildConfigRulePostBuildTargets { } 86rule UserBuildConfigRulePreImage { } 87rule UserBuildConfigRulePostImage { } 88 89# Include UserBuildConfig. 90if ! $(HAIKU_IGNORE_USER_BUILD_CONFIG) { 91 local userBuildConfig 92 = [ GLOB $(HAIKU_BUILD_RULES_DIR) : UserBuildConfig ] ; 93 if $(userBuildConfig) { 94 include $(userBuildConfig) ; 95 } 96 97 # allow for a separate UserBuildConfig per output directory 98 local userBuildConfig 99 = [ GLOB $(HAIKU_OUTPUT_DIR) : UserBuildConfig ] ; 100 if $(userBuildConfig) { 101 include $(userBuildConfig) ; 102 } 103} 104 105DefineDefaultBuildProfiles ; 106 107PrepareConfigVariables ; 108