vfs: check userland buffers before reading them.
[haiku.git] / Jamrules
blob803dd220ab3be74febe8115a3830b8b036639e8a
1 # Haiku Jamrules
3 # Make sure we have an absolute HAIKU_TOP
4 if $(HAIKU_TOP) = "." {
5         HAIKU_TOP = $(PWD) ;
8 # Main directories used by the build.
9 HAIKU_OUTPUT_DIR                                        ?= [ FDirName $(HAIKU_TOP) generated ] ;
10 HAIKU_BUILD_OUTPUT_DIR                          ?= [ FDirName $(HAIKU_OUTPUT_DIR) build ] ;
11 HAIKU_BUILD_DIR                                         ?= [ FDirName $(HAIKU_TOP) build ] ;
12 HAIKU_BUILD_RULES_DIR                           ?= [ FDirName $(HAIKU_BUILD_DIR) jam ] ;
13 HAIKU_OBJECT_DIR                                        ?= [ FDirName $(HAIKU_OUTPUT_DIR)
14                                                                                         objects ] ;
15 HAIKU_CATALOGS_OBJECT_DIR                       ?= [ FDirName $(HAIKU_OBJECT_DIR)
16                                                                                         catalogs ] ;
17 HAIKU_COMMON_PLATFORM_OBJECT_DIR        ?= [ FDirName $(HAIKU_OBJECT_DIR) common ] ;
18 HAIKU_DOWNLOAD_DIR                                      ?= [ FDirName $(HAIKU_OUTPUT_DIR)
19                                                                                         download ] ;
20 HAIKU_OPTIONAL_BUILD_PACKAGES_DIR       ?= [ FDirName $(HAIKU_OUTPUT_DIR)
21                                                                                         build_packages ] ;
23 # Cache files for header scanning and jamfile caching
24 HCACHEFILE = header_cache ;
25 JCACHEFILE = jamfile_cache ;
26 LOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(HAIKU_BUILD_OUTPUT_DIR) ;
28 # include BuildConfig
29 local buildConfig = [ GLOB $(HAIKU_BUILD_OUTPUT_DIR) : BuildConfig ] ;
30 if ! $(buildConfig) {
31         ECHO "No `BuildConfig' found in $(HAIKU_BUILD_OUTPUT_DIR)!" ;
32         EXIT "Run ./configure in the source tree's root directory first!" ;
34 LOCATE on BuildConfig = $(HAIKU_BUILD_OUTPUT_DIR) ;
35 include BuildConfig ;
37 # set HAIKU_PACKAGING_ARCH, the primary packaging architecture
38 HAIKU_PACKAGING_ARCH = $(HAIKU_PACKAGING_ARCHS[1]) ;
40 # The build setup and rules are neatly organized in several files. Include
41 # them now. Start with the side-effect-less rules, since they are the most
42 # likely to be used in the top level context (i.e. not only in rules).
43 # At the end include BuildSetup that sets up global variables etc. The
44 # optional user-defined UserBuildConfig is included thereafter.
45 include [ FDirName $(HAIKU_BUILD_RULES_DIR) HelperRules ] ;
46 include [ FDirName $(HAIKU_BUILD_RULES_DIR) MathRules ] ;
47 include [ FDirName $(HAIKU_BUILD_RULES_DIR) ArchitectureRules ] ;
48 include [ FDirName $(HAIKU_BUILD_RULES_DIR) BeOSRules ] ;
49 include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatureRules ] ;
50 include [ FDirName $(HAIKU_BUILD_RULES_DIR) LocaleRules ] ;
51 include [ FDirName $(HAIKU_BUILD_RULES_DIR) CommandLineArguments ] ;
52 include [ FDirName $(HAIKU_BUILD_RULES_DIR) ConfigRules ] ;
53 include [ FDirName $(HAIKU_BUILD_RULES_DIR) FileRules ] ;
54 include [ FDirName $(HAIKU_BUILD_RULES_DIR) HeadersRules ] ;
55 include [ FDirName $(HAIKU_BUILD_RULES_DIR) KernelRules ] ;
56 include [ FDirName $(HAIKU_BUILD_RULES_DIR) BootRules ] ;
57 include [ FDirName $(HAIKU_BUILD_RULES_DIR) ImageRules ] ;
58 include [ FDirName $(HAIKU_BUILD_RULES_DIR) CDRules ] ;
59 include [ FDirName $(HAIKU_BUILD_RULES_DIR) MainBuildRules ] ;
60 include [ FDirName $(HAIKU_BUILD_RULES_DIR) MiscRules ] ;
61 include [ FDirName $(HAIKU_BUILD_RULES_DIR) OverriddenJamRules ] ;
62 include [ FDirName $(HAIKU_BUILD_RULES_DIR) PackageRules ] ;
63 include [ FDirName $(HAIKU_BUILD_RULES_DIR) RepositoryRules ] ;
64 include [ FDirName $(HAIKU_BUILD_RULES_DIR) SystemLibraryRules ] ;
65 include [ FDirName $(HAIKU_BUILD_RULES_DIR) TestsRules ] ;
66 include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildSetup ] ;
67 include [ FDirName $(HAIKU_BUILD_RULES_DIR) DefaultBuildProfiles ] ;
69 # Include the repositories for this architecture.
70 local repositoriesDirectory
71         = [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories ] ;
72 local repositories = HaikuPorts ;
73 if $(HAIKU_BUILD_TYPE) = bootstrap {
74         repositories = HaikuPortsCross ;
77 local repository ;
78 for repository in $(repositories) {
79         local repositoryDirectory
80                 = [ FDirName $(repositoriesDirectory) $(repository) ] ;
81         local file = [ Glob $(repositoryDirectory) : $(HAIKU_PACKAGING_ARCH) ] ;
82         if $(file) {
83                 HAIKU_REPOSITORY_JAMFILE = $(file) ;
84                 include $(file) ;
85         }
88 # Declare no-op user-overridable build rules.
89 rule UserBuildConfigRulePostBuildTargets        { }
90 rule UserBuildConfigRulePreImage                        { }
91 rule UserBuildConfigRulePostImage                       { }
93 # Include UserBuildConfig.
94 if ! $(HAIKU_IGNORE_USER_BUILD_CONFIG) {
95         local userBuildConfig
96                 = [ GLOB $(HAIKU_BUILD_RULES_DIR) : UserBuildConfig ] ;
97         if $(userBuildConfig) {
98                 include $(userBuildConfig) ;
99         }
101         # allow for a separate UserBuildConfig per output directory
102         local userBuildConfig
103                 = [ GLOB $(HAIKU_OUTPUT_DIR) : UserBuildConfig ] ;
104         if $(userBuildConfig) {
105                 include $(userBuildConfig) ;
106         }
109 DefineDefaultBuildProfiles ;
111 PrepareConfigVariables ;