xref: /haiku/Jamrules (revision 413a591c7826fe198ece7036c5e474697bf813f5)
1338b8dc3SIngo Weinhold# Haiku Jamrules
2979afc6fSAxel Dörfler
3338b8dc3SIngo Weinhold# Main directories used by the build.
4338b8dc3SIngo WeinholdHAIKU_OUTPUT_DIR					?= [ FDirName $(HAIKU_TOP) generated ] ;
5338b8dc3SIngo WeinholdHAIKU_BUILD_OUTPUT_DIR				= [ FDirName $(HAIKU_OUTPUT_DIR) build ] ;
6338b8dc3SIngo WeinholdHAIKU_BUILD_DIR						= [ FDirName $(HAIKU_TOP) build ] ;
7338b8dc3SIngo WeinholdHAIKU_BUILD_RULES_DIR				= [ FDirName $(HAIKU_BUILD_DIR) jam ] ;
8*413a591cSMatt MadiaHAIKU_OBJECT_DIR					= [ FDirName $(HAIKU_OUTPUT_DIR)
9*413a591cSMatt Madia											objects ] ;
10338b8dc3SIngo WeinholdHAIKU_COMMON_PLATFORM_OBJECT_DIR	= [ FDirName $(HAIKU_OBJECT_DIR) common ] ;
111467a878SAxel DörflerHAIKU_DOWNLOAD_DIR					= [ FDirName $(HAIKU_OUTPUT_DIR)
121467a878SAxel Dörfler											download ] ;
13ff81d306SIngo WeinholdHAIKU_OPTIONAL_BUILD_PACKAGES_DIR	= [ FDirName $(HAIKU_OUTPUT_DIR)
14ff81d306SIngo Weinhold											build_packages ] ;
154ff6d49fSIngo Weinhold
164ff6d49fSIngo Weinhold# Cache files for header scanning and jamfile caching
174ff6d49fSIngo WeinholdHCACHEFILE = header_cache ;
184ff6d49fSIngo WeinholdJCACHEFILE = jamfile_cache ;
19338b8dc3SIngo WeinholdLOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(HAIKU_BUILD_OUTPUT_DIR) ;
209eea4522SIngo Weinhold
21889903f9SIngo Weinhold# include BuildConfig
22889903f9SIngo Weinholdlocal buildConfig = [ GLOB $(HAIKU_BUILD_OUTPUT_DIR) : BuildConfig ] ;
23889903f9SIngo Weinholdif ! $(buildConfig) {
24889903f9SIngo Weinhold	ECHO "No `BuildConfig' found in $(HAIKU_BUILD_OUTPUT_DIR)!" ;
25889903f9SIngo Weinhold	EXIT "Run ./configure in the source tree's root directory first!" ;
26889903f9SIngo Weinhold}
27889903f9SIngo WeinholdLOCATE on BuildConfig = $(HAIKU_BUILD_OUTPUT_DIR) ;
28889903f9SIngo Weinholdinclude BuildConfig ;
29889903f9SIngo Weinhold
30338b8dc3SIngo Weinhold# The build setup and rules are neatly organized in several files. Include
31338b8dc3SIngo Weinhold# them now. Start with the side-effect-less rules, since they are the most
32338b8dc3SIngo Weinhold# likely to be used in the top level context (i.e. not only in rules).
33338b8dc3SIngo Weinhold# At the end include BuildSetup that sets up global variables etc. The
34338b8dc3SIngo Weinhold# optional user-defined UserBuildConfig is included thereafter.
35338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) HelperRules ] ;
3625b12e83SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) MathRules ] ;
37338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) BeOSRules ] ;
38b891b0acSOliver Tappeinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) LocaleRules ] ;
3937aefc9cSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) CommandLineArguments ] ;
40338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) ConfigRules ] ;
41338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) DocumentationRules ] ;
42338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) FileRules ] ;
43338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) FreetypeRules ] ;
44338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) HeadersRules ] ;
45338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) KernelRules ] ;
46338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) ImageRules ] ;
47e2c3dec9SMichael Lotzinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) CDRules ] ;
48338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) MainBuildRules ] ;
49338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) MiscRules ] ;
50338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) OverriddenJamRules ] ;
51338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) PackageRules ] ;
52338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) TestsRules ] ;
53338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildSetup ] ;
54b1e5b60cSAxel Dörfler
5530ed37c8SIngo Weinhold# Declare no-op user-overridable build rules.
5630ed37c8SIngo Weinholdrule UserBuildConfigRulePostBuildTargets	{ }
5730ed37c8SIngo Weinholdrule UserBuildConfigRulePreImage			{ }
5830ed37c8SIngo Weinholdrule UserBuildConfigRulePostImage			{ }
5930ed37c8SIngo Weinhold
60338b8dc3SIngo Weinhold# Include UserBuildConfig.
61a4a52ab2SIngo Weinholdif ! $(HAIKU_IGNORE_USER_BUILD_CONFIG) {
62338b8dc3SIngo Weinhold	local userBuildConfig
63338b8dc3SIngo Weinhold		= [ GLOB $(HAIKU_BUILD_RULES_DIR) : UserBuildConfig ] ;
64338b8dc3SIngo Weinhold	if $(userBuildConfig) {
65338b8dc3SIngo Weinhold		include $(userBuildConfig) ;
668c17a26bSIngo Weinhold	}
67d5ec51caSMichael Lotz
68d5ec51caSMichael Lotz	# allow for a separate UserBuildConfig per output directory
69d5ec51caSMichael Lotz	local userBuildConfig
70d5ec51caSMichael Lotz		= [ GLOB $(HAIKU_OUTPUT_DIR) : UserBuildConfig ] ;
71d5ec51caSMichael Lotz	if $(userBuildConfig) {
72d5ec51caSMichael Lotz		include $(userBuildConfig) ;
73d5ec51caSMichael Lotz	}
748c17a26bSIngo Weinhold}
758c17a26bSIngo Weinhold
76a679600dSAxel Dörflerinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) ReleaseBuildProfiles ] ;
77a679600dSAxel Dörfler
78a0a9d225SIngo Weinhold# If a build profile was specified on the command line, now is the time to
79a0a9d225SIngo Weinhold# check whether it is unknown or one of the default profiles.
80a0a9d225SIngo Weinholdif $(HAIKU_BUILD_PROFILE) && ! $(HAIKU_BUILD_PROFILE_DEFINED) {
81a0a9d225SIngo Weinhold	# define the obvious default profiles
82634d2297SIngo Weinhold	if $(HAIKU_BUILD_PROFILE) in anyboot-image cd-image image install
83634d2297SIngo Weinhold			vmware-image {
84a0a9d225SIngo Weinhold		DefineBuildProfile $(HAIKU_BUILD_PROFILE) : $(HAIKU_BUILD_PROFILE) ;
85a0a9d225SIngo Weinhold	} else {
86a0a9d225SIngo Weinhold		Exit "Build profile" $(HAIKU_BUILD_PROFILE) "not defined." ;
87a0a9d225SIngo Weinhold	}
88a0a9d225SIngo Weinhold}
89a0a9d225SIngo Weinhold
90feb750d3SFrançois Revol# Include embedded board-specific file.
91feb750d3SFrançois Revol# UserBuildConfig can override HAIKU_BOOT_BOARD.
92feb750d3SFrançois Revolif $(HAIKU_BOOT_BOARD) {
931467a878SAxel Dörfler	include [ FDirName $(HAIKU_BUILD_RULES_DIR) board $(HAIKU_BOOT_BOARD)
941467a878SAxel Dörfler		BoardSetup ] ;
95feb750d3SFrançois Revol}
96feb750d3SFrançois Revol
97338b8dc3SIngo WeinholdPrepareConfigVariables ;
98