1SubDir HAIKU_TOP ;
2
3NotFile doc_files ;
4Depends files : doc_files ;
5
6# Prepare the optional build features before parsing the Jamfile tree.
7local architectureObject ;
8for architectureObject in [ MultiArchSubDirSetup ] {
9	on $(architectureObject) {
10		include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatures ] ;
11
12		# Let the target platform depend on the external header directories such
13		# that those will be unpacked before anything is built for the target
14		# platform.
15		Depends $(TARGET_PLATFORM) : [
16			BuildFeatureAttribute gcc_syslibs_devel : c++-headers
17		] [
18			BuildFeatureAttribute gcc_syslibs_devel : gcc-headers
19		] ;
20	}
21}
22
23# Include required packages:
24# primary architecture
25AddHaikuImagePackages [ FFilterByBuildFeatures
26	bash coreutils curl freetype icu libsolv zlib
27
28	regular_image @{
29		bzip2 ctags diffutils expat ffmpeg findutils gawk glu grep gutenprint
30		gzip jasper jpeg
31		less libicns libpcap libpng16 libwebp
32		mesa mesa_devel mesa_swrast
33		netcat
34		sed sharutils
35		tar tcpdump unzip wget which zip
36	}@
37] ;
38if $(HAIKU_PACKAGING_ARCHS[1]) != x86_gcc2 {
39	AddHaikuImagePackages [ FFilterByBuildFeatures gcc_syslibs ] ;
40}
41
42if $(HAIKU_PACKAGING_ARCHS[2]) {
43	# secondary architectures
44	local architectureObject ;
45	for architectureObject
46			in [ MultiArchSubDirSetup $(HAIKU_PACKAGING_ARCHS[2-]) ] {
47		on $(architectureObject) {
48			AddHaikuImagePackages [ FFilterByBuildFeatures
49				curl freetype icu libsolv zlib
50
51				regular_image @{
52					ffmpeg glu jasper jpeg libicns libpng libwebp mesa
53				}@
54			] ;
55			if $(TARGET_PACKAGING_ARCH) != x86_gcc2 {
56				AddHaikuImagePackages [ FFilterByBuildFeatures gcc_syslibs ] ;
57			}
58		}
59	}
60}
61
62# If enabled, make sure that OpenSSL is added to the image.
63if [ FIsBuildFeatureEnabled openssl ] {
64	AddHaikuImagePackages openssl ;
65}
66
67# add additionally requested packages
68AddHaikuImagePackages $(HAIKU_IMAGE_ADDITIONAL_PACKAGES) ;
69
70# Optionally we allow not to include the "src" subdirectory.
71if $(HAIKU_DONT_INCLUDE_SRC) {
72	# Don't include "src", but at least include the stuff needed for the
73	# build.
74	SubInclude HAIKU_TOP src build ;
75	SubInclude HAIKU_TOP src tools ;
76} else {
77	SubInclude HAIKU_TOP src ;
78}
79if $(HAIKU_INCLUDE_3RDPARTY) {
80	SubInclude HAIKU_TOP 3rdparty ;
81}
82
83# Perform deferred SubIncludes.
84ExecuteDeferredSubIncludes ;
85
86# reset subdir
87SubDir HAIKU_TOP ;
88
89# Execute post-build-target user config rules.
90UserBuildConfigRulePostBuildTargets	;
91
92# specify the Haiku repository contents
93include [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories Haiku ] ;
94
95# specify the actual Haiku image contents
96include [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuImage ] ;
97
98# specify the additional image contents one for each boot type
99include [ FDirName $(HAIKU_BUILD_RULES_DIR) images NetBootArchive ] ;
100include [ FDirName $(HAIKU_BUILD_RULES_DIR) images FloppyBootImage ] ;
101include [ FDirName $(HAIKU_BUILD_RULES_DIR) images CDBootImage ] ;
102include [ FDirName $(HAIKU_BUILD_RULES_DIR) images CDBootPPCImage ] ;
103include [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuCD ] ;
104include [ FDirName $(HAIKU_BUILD_RULES_DIR) images AnybootImage ] ;
105
106# Check whether all requested optional packages do actually exist.
107local package ;
108local packageError ;
109for package in $(HAIKU_ADDED_OPTIONAL_PACKAGES) {
110	if ! [ on $(package) return $(HAIKU_OPTIONAL_PACKAGE_EXISTS) ] {
111		Echo "ERROR: Requested optional package \"$(package)\" does not"
112			"exist." ;
113		packageError = 1 ;
114	}
115}
116if $(packageError) {
117	Exit ;
118}
119
120# Pseudo-target to build all targets that are localized.
121NotFile LocalizedTargets ;
122Depends LocalizedTargets : $(HAIKU_LOCALIZED_TARGETS) ;
123
124NotFile catalogs ;
125Depends catalogs : $(HAIKU_LOCALE_CATALOGS) ;
126
127NotFile catkeys ;
128Depends catkeys : $(HAIKU_LOCALE_OUTPUT_CATKEYS) ;
129