xref: /haiku/Jamrules (revision b891b0acaeb1ff1980ebb6af6b6768ec9b9be8d0)
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 ] ;
8338b8dc3SIngo WeinholdHAIKU_OBJECT_DIR					= [ FDirName $(HAIKU_OUTPUT_DIR) objects ] ;
9338b8dc3SIngo WeinholdHAIKU_COMMON_PLATFORM_OBJECT_DIR	= [ FDirName $(HAIKU_OBJECT_DIR) common ] ;
101467a878SAxel DörflerHAIKU_DOWNLOAD_DIR					= [ FDirName $(HAIKU_OUTPUT_DIR)
111467a878SAxel Dörfler											download ] ;
12ff81d306SIngo WeinholdHAIKU_OPTIONAL_BUILD_PACKAGES_DIR	= [ FDirName $(HAIKU_OUTPUT_DIR)
13ff81d306SIngo Weinhold											build_packages ] ;
144ff6d49fSIngo Weinhold
154ff6d49fSIngo Weinhold# Cache files for header scanning and jamfile caching
164ff6d49fSIngo WeinholdHCACHEFILE = header_cache ;
174ff6d49fSIngo WeinholdJCACHEFILE = jamfile_cache ;
18338b8dc3SIngo WeinholdLOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(HAIKU_BUILD_OUTPUT_DIR) ;
199eea4522SIngo Weinhold
20889903f9SIngo Weinhold# include BuildConfig
21889903f9SIngo Weinholdlocal buildConfig = [ GLOB $(HAIKU_BUILD_OUTPUT_DIR) : BuildConfig ] ;
22889903f9SIngo Weinholdif ! $(buildConfig) {
23889903f9SIngo Weinhold	ECHO "No `BuildConfig' found in $(HAIKU_BUILD_OUTPUT_DIR)!" ;
24889903f9SIngo Weinhold	EXIT "Run ./configure in the source tree's root directory first!" ;
25889903f9SIngo Weinhold}
26889903f9SIngo WeinholdLOCATE on BuildConfig = $(HAIKU_BUILD_OUTPUT_DIR) ;
27889903f9SIngo Weinholdinclude BuildConfig ;
28889903f9SIngo Weinhold
29338b8dc3SIngo Weinhold# The build setup and rules are neatly organized in several files. Include
30338b8dc3SIngo Weinhold# them now. Start with the side-effect-less rules, since they are the most
31338b8dc3SIngo Weinhold# likely to be used in the top level context (i.e. not only in rules).
32338b8dc3SIngo Weinhold# At the end include BuildSetup that sets up global variables etc. The
33338b8dc3SIngo Weinhold# optional user-defined UserBuildConfig is included thereafter.
34338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) HelperRules ] ;
3525b12e83SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) MathRules ] ;
36338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) BeOSRules ] ;
37*b891b0acSOliver Tappeinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) LocaleRules ] ;
3837aefc9cSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) CommandLineArguments ] ;
39338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) ConfigRules ] ;
40338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) DocumentationRules ] ;
41338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) FileRules ] ;
42338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) FreetypeRules ] ;
43338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) HeadersRules ] ;
44338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) KernelRules ] ;
45338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) ImageRules ] ;
46e2c3dec9SMichael Lotzinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) CDRules ] ;
47338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) MainBuildRules ] ;
48338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) MiscRules ] ;
49338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) OverriddenJamRules ] ;
50338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) PackageRules ] ;
51338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) TestsRules ] ;
52338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildSetup ] ;
53b1e5b60cSAxel Dörfler
5430ed37c8SIngo Weinhold# Declare no-op user-overridable build rules.
5530ed37c8SIngo Weinholdrule UserBuildConfigRulePostBuildTargets	{ }
5630ed37c8SIngo Weinholdrule UserBuildConfigRulePreImage			{ }
5730ed37c8SIngo Weinholdrule UserBuildConfigRulePostImage			{ }
5830ed37c8SIngo Weinhold
59338b8dc3SIngo Weinhold# Include UserBuildConfig.
60a4a52ab2SIngo Weinholdif ! $(HAIKU_IGNORE_USER_BUILD_CONFIG) {
61338b8dc3SIngo Weinhold	local userBuildConfig
62338b8dc3SIngo Weinhold		= [ GLOB $(HAIKU_BUILD_RULES_DIR) : UserBuildConfig ] ;
63338b8dc3SIngo Weinhold	if $(userBuildConfig) {
64338b8dc3SIngo Weinhold		include $(userBuildConfig) ;
658c17a26bSIngo Weinhold	}
66d5ec51caSMichael Lotz
67d5ec51caSMichael Lotz	# allow for a separate UserBuildConfig per output directory
68d5ec51caSMichael Lotz	local userBuildConfig
69d5ec51caSMichael Lotz		= [ GLOB $(HAIKU_OUTPUT_DIR) : UserBuildConfig ] ;
70d5ec51caSMichael Lotz	if $(userBuildConfig) {
71d5ec51caSMichael Lotz		include $(userBuildConfig) ;
72d5ec51caSMichael Lotz	}
738c17a26bSIngo Weinhold}
748c17a26bSIngo Weinhold
75a679600dSAxel Dörflerinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) ReleaseBuildProfiles ] ;
76a679600dSAxel Dörfler
77a0a9d225SIngo Weinhold# If a build profile was specified on the command line, now is the time to
78a0a9d225SIngo Weinhold# check whether it is unknown or one of the default profiles.
79a0a9d225SIngo Weinholdif $(HAIKU_BUILD_PROFILE) && ! $(HAIKU_BUILD_PROFILE_DEFINED) {
80a0a9d225SIngo Weinhold	# define the obvious default profiles
81634d2297SIngo Weinhold	if $(HAIKU_BUILD_PROFILE) in anyboot-image cd-image image install
82634d2297SIngo Weinhold			vmware-image {
83a0a9d225SIngo Weinhold		DefineBuildProfile $(HAIKU_BUILD_PROFILE) : $(HAIKU_BUILD_PROFILE) ;
84a0a9d225SIngo Weinhold	} else {
85a0a9d225SIngo Weinhold		Exit "Build profile" $(HAIKU_BUILD_PROFILE) "not defined." ;
86a0a9d225SIngo Weinhold	}
87a0a9d225SIngo Weinhold}
88a0a9d225SIngo Weinhold
89feb750d3SFrançois Revol# Include embedded board-specific file.
90feb750d3SFrançois Revol# UserBuildConfig can override HAIKU_BOOT_BOARD.
91feb750d3SFrançois Revolif $(HAIKU_BOOT_BOARD) {
921467a878SAxel Dörfler	include [ FDirName $(HAIKU_BUILD_RULES_DIR) board $(HAIKU_BOOT_BOARD)
931467a878SAxel Dörfler		BoardSetup ] ;
94feb750d3SFrançois Revol}
95feb750d3SFrançois Revol
96338b8dc3SIngo WeinholdPrepareConfigVariables ;
97