xref: /haiku/Jamrules (revision 889903f9ddd32ff7a953b3093b6e9bb4ebe2fd65)
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 ] ;
1096b421b8SIngo WeinholdHAIKU_DOWNLOAD_DIR					= [ FDirName $(HAIKU_OUTPUT_DIR) download ] ;
114ff6d49fSIngo Weinhold
124ff6d49fSIngo Weinhold# Cache files for header scanning and jamfile caching
134ff6d49fSIngo WeinholdHCACHEFILE = header_cache ;
144ff6d49fSIngo WeinholdJCACHEFILE = jamfile_cache ;
15338b8dc3SIngo WeinholdLOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(HAIKU_BUILD_OUTPUT_DIR) ;
169eea4522SIngo Weinhold
17*889903f9SIngo Weinhold# include BuildConfig
18*889903f9SIngo Weinholdlocal buildConfig = [ GLOB $(HAIKU_BUILD_OUTPUT_DIR) : BuildConfig ] ;
19*889903f9SIngo Weinholdif ! $(buildConfig) {
20*889903f9SIngo Weinhold	ECHO "No `BuildConfig' found in $(HAIKU_BUILD_OUTPUT_DIR)!" ;
21*889903f9SIngo Weinhold	EXIT "Run ./configure in the source tree's root directory first!" ;
22*889903f9SIngo Weinhold}
23*889903f9SIngo WeinholdLOCATE on BuildConfig = $(HAIKU_BUILD_OUTPUT_DIR) ;
24*889903f9SIngo Weinholdinclude BuildConfig ;
25*889903f9SIngo Weinhold
26338b8dc3SIngo Weinhold# The build setup and rules are neatly organized in several files. Include
27338b8dc3SIngo Weinhold# them now. Start with the side-effect-less rules, since they are the most
28338b8dc3SIngo Weinhold# likely to be used in the top level context (i.e. not only in rules).
29338b8dc3SIngo Weinhold# At the end include BuildSetup that sets up global variables etc. The
30338b8dc3SIngo Weinhold# optional user-defined UserBuildConfig is included thereafter.
31338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) HelperRules ] ;
3225b12e83SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) MathRules ] ;
33338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) BeOSRules ] ;
34338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) ConfigRules ] ;
35338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) DocumentationRules ] ;
36338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) FileRules ] ;
37338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) FreetypeRules ] ;
38338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) HeadersRules ] ;
39338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) KernelRules ] ;
40338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) ImageRules ] ;
41338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) MainBuildRules ] ;
42338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) MiscRules ] ;
43338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) OverriddenJamRules ] ;
44338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) PackageRules ] ;
45338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) TestsRules ] ;
46338b8dc3SIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildSetup ] ;
47b1e5b60cSAxel Dörfler
48338b8dc3SIngo Weinhold# Include UserBuildConfig.
498c17a26bSIngo Weinhold{
50338b8dc3SIngo Weinhold	local userBuildConfig
51338b8dc3SIngo Weinhold		= [ GLOB $(HAIKU_BUILD_RULES_DIR) : UserBuildConfig ] ;
52338b8dc3SIngo Weinhold	if $(userBuildConfig) {
53338b8dc3SIngo Weinhold		include $(userBuildConfig) ;
548c17a26bSIngo Weinhold	}
558c17a26bSIngo Weinhold}
568c17a26bSIngo Weinhold
57a679600dSAxel Dörflerinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) ReleaseBuildProfiles ] ;
58a679600dSAxel Dörfler
59a0a9d225SIngo Weinhold# If a build profile was specified on the command line, now is the time to
60a0a9d225SIngo Weinhold# check whether it is unknown or one of the default profiles.
61a0a9d225SIngo Weinholdif $(HAIKU_BUILD_PROFILE) && ! $(HAIKU_BUILD_PROFILE_DEFINED) {
62a0a9d225SIngo Weinhold	# define the obvious default profiles
63a0a9d225SIngo Weinhold	if $(HAIKU_BUILD_PROFILE) in image vmware-image install {
64a0a9d225SIngo Weinhold		DefineBuildProfile $(HAIKU_BUILD_PROFILE) : $(HAIKU_BUILD_PROFILE) ;
65a0a9d225SIngo Weinhold	} else {
66a0a9d225SIngo Weinhold		Exit "Build profile" $(HAIKU_BUILD_PROFILE) "not defined." ;
67a0a9d225SIngo Weinhold	}
68a0a9d225SIngo Weinhold}
69a0a9d225SIngo Weinhold
70338b8dc3SIngo WeinholdPrepareConfigVariables ;
71