xref: /haiku/Jamrules (revision a679600d828ebb641330dcb032e48de430710925)
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) objects ] ;
9HAIKU_COMMON_PLATFORM_OBJECT_DIR	= [ FDirName $(HAIKU_OBJECT_DIR) common ] ;
10HAIKU_DOWNLOAD_DIR					= [ FDirName $(HAIKU_OUTPUT_DIR) download ] ;
11
12# Cache files for header scanning and jamfile caching
13HCACHEFILE = header_cache ;
14JCACHEFILE = jamfile_cache ;
15LOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(HAIKU_BUILD_OUTPUT_DIR) ;
16
17# The build setup and rules are neatly organized in several files. Include
18# them now. Start with the side-effect-less rules, since they are the most
19# likely to be used in the top level context (i.e. not only in rules).
20# At the end include BuildSetup that sets up global variables etc. The
21# optional user-defined UserBuildConfig is included thereafter.
22include [ FDirName $(HAIKU_BUILD_RULES_DIR) HelperRules ] ;
23include [ FDirName $(HAIKU_BUILD_RULES_DIR) MathRules ] ;
24include [ FDirName $(HAIKU_BUILD_RULES_DIR) BeOSRules ] ;
25include [ FDirName $(HAIKU_BUILD_RULES_DIR) ConfigRules ] ;
26include [ FDirName $(HAIKU_BUILD_RULES_DIR) DocumentationRules ] ;
27include [ FDirName $(HAIKU_BUILD_RULES_DIR) FileRules ] ;
28include [ FDirName $(HAIKU_BUILD_RULES_DIR) FreetypeRules ] ;
29include [ FDirName $(HAIKU_BUILD_RULES_DIR) HeadersRules ] ;
30include [ FDirName $(HAIKU_BUILD_RULES_DIR) KernelRules ] ;
31include [ FDirName $(HAIKU_BUILD_RULES_DIR) ImageRules ] ;
32include [ FDirName $(HAIKU_BUILD_RULES_DIR) MainBuildRules ] ;
33include [ FDirName $(HAIKU_BUILD_RULES_DIR) MiscRules ] ;
34include [ FDirName $(HAIKU_BUILD_RULES_DIR) OverriddenJamRules ] ;
35include [ FDirName $(HAIKU_BUILD_RULES_DIR) PackageRules ] ;
36include [ FDirName $(HAIKU_BUILD_RULES_DIR) TestsRules ] ;
37include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildSetup ] ;
38
39# Include UserBuildConfig.
40{
41	local userBuildConfig
42		= [ GLOB $(HAIKU_BUILD_RULES_DIR) : UserBuildConfig ] ;
43	if $(userBuildConfig) {
44		include $(userBuildConfig) ;
45	}
46}
47
48include [ FDirName $(HAIKU_BUILD_RULES_DIR) ReleaseBuildProfiles ] ;
49
50# If a build profile was specified on the command line, now is the time to
51# check whether it is unknown or one of the default profiles.
52if $(HAIKU_BUILD_PROFILE) && ! $(HAIKU_BUILD_PROFILE_DEFINED) {
53	# define the obvious default profiles
54	if $(HAIKU_BUILD_PROFILE) in image vmware-image install {
55		DefineBuildProfile $(HAIKU_BUILD_PROFILE) : $(HAIKU_BUILD_PROFILE) ;
56	} else {
57		Exit "Build profile" $(HAIKU_BUILD_PROFILE) "not defined." ;
58	}
59}
60
61PrepareConfigVariables ;
62