xref: /haiku/Jamrules (revision ed25955ada10b7bb84e4a1d62ed481779490d5bd)
1338b8dc3SIngo Weinhold# Haiku Jamrules
2979afc6fSAxel Dörfler
3338b8dc3SIngo Weinhold# Main directories used by the build.
4338b8dc3SIngo WeinholdHAIKU_OUTPUT_DIR					?= [ FDirName $(HAIKU_TOP) generated ] ;
5e6d5152fSOliver TappeHAIKU_BUILD_OUTPUT_DIR				?= [ FDirName $(HAIKU_OUTPUT_DIR) build ] ;
6e6d5152fSOliver TappeHAIKU_BUILD_DIR						?= [ FDirName $(HAIKU_TOP) build ] ;
7e6d5152fSOliver TappeHAIKU_BUILD_RULES_DIR				?= [ FDirName $(HAIKU_BUILD_DIR) jam ] ;
8e6d5152fSOliver TappeHAIKU_OBJECT_DIR					?= [ FDirName $(HAIKU_OUTPUT_DIR)
9413a591cSMatt Madia											objects ] ;
10e6d5152fSOliver TappeHAIKU_CATALOGS_OBJECT_DIR			?= [ FDirName $(HAIKU_OBJECT_DIR)
110a53d94bSMatt Madia											catalogs ] ;
12e6d5152fSOliver TappeHAIKU_COMMON_PLATFORM_OBJECT_DIR	?= [ FDirName $(HAIKU_OBJECT_DIR) common ] ;
13e6d5152fSOliver TappeHAIKU_DOWNLOAD_DIR					?= [ FDirName $(HAIKU_OUTPUT_DIR)
141467a878SAxel Dörfler											download ] ;
15e6d5152fSOliver TappeHAIKU_OPTIONAL_BUILD_PACKAGES_DIR	?= [ FDirName $(HAIKU_OUTPUT_DIR)
16ff81d306SIngo Weinhold											build_packages ] ;
174ff6d49fSIngo Weinhold
184ff6d49fSIngo Weinhold# Cache files for header scanning and jamfile caching
194ff6d49fSIngo WeinholdHCACHEFILE = header_cache ;
204ff6d49fSIngo WeinholdJCACHEFILE = jamfile_cache ;
21338b8dc3SIngo WeinholdLOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(HAIKU_BUILD_OUTPUT_DIR) ;
229eea4522SIngo Weinhold
23889903f9SIngo Weinhold# include BuildConfig
24889903f9SIngo Weinholdlocal buildConfig = [ GLOB $(HAIKU_BUILD_OUTPUT_DIR) : BuildConfig ] ;
25889903f9SIngo Weinholdif ! $(buildConfig) {
26889903f9SIngo Weinhold	ECHO "No `BuildConfig' found in $(HAIKU_BUILD_OUTPUT_DIR)!" ;
27889903f9SIngo Weinhold	EXIT "Run ./configure in the source tree's root directory first!" ;
28889903f9SIngo Weinhold}
29889903f9SIngo WeinholdLOCATE on BuildConfig = $(HAIKU_BUILD_OUTPUT_DIR) ;
30889903f9SIngo Weinholdinclude BuildConfig ;
31889903f9SIngo Weinhold
32b0944c78SIngo Weinhold# set HAIKU_PACKAGING_ARCH, the primary packaging architecture
33c0e8cc1aSIngo WeinholdHAIKU_PACKAGING_ARCH = $(HAIKU_PACKAGING_ARCHS[1]) ;
34c0e8cc1aSIngo Weinhold
35338b8dc3SIngo Weinhold# The build setup and rules are neatly organized in several files. Include
36338b8dc3SIngo Weinhold# them now. Start with the side-effect-less rules, since they are the most
37338b8dc3SIngo Weinhold# likely to be used in the top level context (i.e. not only in rules).
38338b8dc3SIngo Weinhold# At the end include BuildSetup that sets up global variables etc. The
39338b8dc3SIngo Weinhold# optional user-defined UserBuildConfig is included thereafter.
40338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) HelperRules ] ;
4125b12e83SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) MathRules ] ;
42b0944c78SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) ArchitectureRules ] ;
43338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) BeOSRules ] ;
44d31a50eeSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatureRules ] ;
45b891b0acSOliver Tappeinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) LocaleRules ] ;
4637aefc9cSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) CommandLineArguments ] ;
47338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) ConfigRules ] ;
48338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) DocumentationRules ] ;
49338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) FileRules ] ;
50338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) HeadersRules ] ;
51338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) KernelRules ] ;
5265ad1ba3SAlex Smithinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) BootRules ] ;
53338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) ImageRules ] ;
54e2c3dec9SMichael Lotzinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) CDRules ] ;
55338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) MainBuildRules ] ;
56338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) MiscRules ] ;
57338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) OverriddenJamRules ] ;
58338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) PackageRules ] ;
5998c6dfa4SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) RepositoryRules ] ;
60*ed25955aSOliver Tappeinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) SystemLibraryRules ] ;
61338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) TestsRules ] ;
62338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildSetup ] ;
63b9eec519SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) DefaultBuildProfiles ] ;
64b1e5b60cSAxel Dörfler
6598c6dfa4SIngo Weinhold# Include the repositories for this architecture.
6698c6dfa4SIngo Weinholdlocal repositoriesDirectory
6798c6dfa4SIngo Weinhold	= [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories ] ;
68e173a1ecSIngo Weinholdlocal repositories = HaikuPorts ;
69a8c098a3SOliver Tappeif $(HAIKU_BUILD_TYPE) = bootstrap {
70e173a1ecSIngo Weinhold	repositories = HaikuPortsCross ;
71e173a1ecSIngo Weinhold}
72e173a1ecSIngo Weinhold
7398c6dfa4SIngo Weinholdlocal repository ;
74e173a1ecSIngo Weinholdfor repository in $(repositories) {
7598c6dfa4SIngo Weinhold	local repositoryDirectory
7698c6dfa4SIngo Weinhold		= [ FDirName $(repositoriesDirectory) $(repository) ] ;
7798c6dfa4SIngo Weinhold	local file = [ Glob $(repositoryDirectory) : $(HAIKU_PACKAGING_ARCH) ] ;
7898c6dfa4SIngo Weinhold	if $(file) {
79d72ce066SIngo Weinhold		HAIKU_REPOSITORY_JAMFILE = $(file) ;
8098c6dfa4SIngo Weinhold		include $(file) ;
8198c6dfa4SIngo Weinhold	}
8298c6dfa4SIngo Weinhold}
8398c6dfa4SIngo Weinhold
8430ed37c8SIngo Weinhold# Declare no-op user-overridable build rules.
8530ed37c8SIngo Weinholdrule UserBuildConfigRulePostBuildTargets	{ }
8630ed37c8SIngo Weinholdrule UserBuildConfigRulePreImage			{ }
8730ed37c8SIngo Weinholdrule UserBuildConfigRulePostImage			{ }
8830ed37c8SIngo Weinhold
89338b8dc3SIngo Weinhold# Include UserBuildConfig.
90a4a52ab2SIngo Weinholdif ! $(HAIKU_IGNORE_USER_BUILD_CONFIG) {
91338b8dc3SIngo Weinhold	local userBuildConfig
92338b8dc3SIngo Weinhold		= [ GLOB $(HAIKU_BUILD_RULES_DIR) : UserBuildConfig ] ;
93338b8dc3SIngo Weinhold	if $(userBuildConfig) {
94338b8dc3SIngo Weinhold		include $(userBuildConfig) ;
958c17a26bSIngo Weinhold	}
96d5ec51caSMichael Lotz
97d5ec51caSMichael Lotz	# allow for a separate UserBuildConfig per output directory
98d5ec51caSMichael Lotz	local userBuildConfig
99d5ec51caSMichael Lotz		= [ GLOB $(HAIKU_OUTPUT_DIR) : UserBuildConfig ] ;
100d5ec51caSMichael Lotz	if $(userBuildConfig) {
101d5ec51caSMichael Lotz		include $(userBuildConfig) ;
102d5ec51caSMichael Lotz	}
1038c17a26bSIngo Weinhold}
1048c17a26bSIngo Weinhold
105b9eec519SIngo WeinholdDefineDefaultBuildProfiles ;
106a0a9d225SIngo Weinhold
107338b8dc3SIngo WeinholdPrepareConfigVariables ;
108