xref: /haiku/Jamfile (revision 050c34d5d197433dc8cf668f967883864a2f7ec3)
1338b8dc3SIngo WeinholdSubDir HAIKU_TOP ;
269b97469SIngo Weinhold
3f4eb5cf7SMatt Madia# Prepare the optional build features before parsing the Jamfile tree.
4b0944c78SIngo Weinholdlocal architectureObject ;
5b0944c78SIngo Weinholdfor architectureObject in [ MultiArchSubDirSetup ] {
6b0944c78SIngo Weinhold	on $(architectureObject) {
7f0cacbb3SIngo Weinhold		include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatures ] ;
8afde4473SOliver Tappe
9afde4473SOliver Tappe		# Let the target platform depend on the external header directories such
10afde4473SOliver Tappe		# that those will be unpacked before anything is built for the target
11afde4473SOliver Tappe		# platform.
12afde4473SOliver Tappe		Depends $(TARGET_PLATFORM) : [
13afde4473SOliver Tappe			BuildFeatureAttribute gcc_syslibs_devel : c++-headers
14afde4473SOliver Tappe		] [
15afde4473SOliver Tappe			BuildFeatureAttribute gcc_syslibs_devel : gcc-headers
16afde4473SOliver Tappe		] ;
17b0944c78SIngo Weinhold	}
18b0944c78SIngo Weinhold}
19f4eb5cf7SMatt Madia
206d8c8a9dSOliver Tappe# Include required packages:
2172e67791SOliver Tappe# primary architecture
224f44282cSAdrien DestuguesAddHaikuImageSystemPackages [ FFilterByBuildFeatures
23bc242885SAugustin Cavalier	bash bc freetype zlib
246d8c8a9dSOliver Tappe
25*050c34d5SAugustin Cavalier	!gcc2 @{ coreutils icu74 wget }@
26*050c34d5SAugustin Cavalier	gcc2 @{ coreutils_x86 wget_x86 icu icu74_x86@secondary_x86 }@
276d8c8a9dSOliver Tappe	regular_image @{
28a85ea80fSPulkoMandy		bzip2 expat ffmpeg6 glu gutenprint9 gzip
295e15819dSAugustin Cavalier		lame less libedit libicns
3013e2db96SNiels Sascha Reedijk		mesa mesa_devel mesa_swpipe@!gcc2 mesa_swrast@gcc2
315e15819dSAugustin Cavalier		netcat
32242c022aSJérôme Duval		sed sharutils
33*050c34d5SAugustin Cavalier		unzip which zip
343b3bcbf7SAdrien Destugues
3513e2db96SNiels Sascha Reedijk		!gcc2 @{ diffutils findutils gawk grep tar tcpdump zstd }@
3613e2db96SNiels Sascha Reedijk		gcc2 @{
3713e2db96SNiels Sascha Reedijk			diffutils_x86@secondary_x86 findutils_x86@secondary_x86
3813e2db96SNiels Sascha Reedijk			mawk grep_x86@secondary_x86 tar_x86@secondary_x86
3913e2db96SNiels Sascha Reedijk			tcpdump_x86@secondary_x86
4013e2db96SNiels Sascha Reedijk		}@
416d8c8a9dSOliver Tappe	}@
426d8c8a9dSOliver Tappe] ;
438547d09eSAugustin CavalierAddHaikuImageSourcePackages [ FFilterByBuildFeatures
44a81d1650SAugustin Cavalier	bash bc
45a81d1650SAugustin Cavalier
46a81d1650SAugustin Cavalier	!gcc2 @{ coreutils }@
47a81d1650SAugustin Cavalier	gcc2 @{ coreutils_x86 }@
488547d09eSAugustin Cavalier
498547d09eSAugustin Cavalier	regular_image @{
50a85ea80fSPulkoMandy		expat ffmpeg6 findutils grep gutenprint9 gzip
5113e2db96SNiels Sascha Reedijk		lame less libicns
528547d09eSAugustin Cavalier		sed sharutils
538547d09eSAugustin Cavalier		tar wget which
5413e2db96SNiels Sascha Reedijk		!gcc2 @{ gawk }@
5513e2db96SNiels Sascha Reedijk		gcc2 @{ mawk }@
568547d09eSAugustin Cavalier	}@
578547d09eSAugustin Cavalier] ;
58220d0402SOliver Tappeif $(HAIKU_PACKAGING_ARCHS[1]) != x86_gcc2 {
594f44282cSAdrien Destugues	AddHaikuImageSystemPackages [ FFilterByBuildFeatures gcc_syslibs ] ;
60220d0402SOliver Tappe}
61220d0402SOliver Tappe
62220d0402SOliver Tappeif $(HAIKU_PACKAGING_ARCHS[2]) {
63271e9484SIngo Weinhold	# secondary architectures
64271e9484SIngo Weinhold	local architectureObject ;
65271e9484SIngo Weinhold	for architectureObject
66271e9484SIngo Weinhold			in [ MultiArchSubDirSetup $(HAIKU_PACKAGING_ARCHS[2-]) ] {
67271e9484SIngo Weinhold		on $(architectureObject) {
684f44282cSAdrien Destugues			AddHaikuImageSystemPackages [ FFilterByBuildFeatures
69bc242885SAugustin Cavalier				freetype icu zlib
706d8c8a9dSOliver Tappe
716d8c8a9dSOliver Tappe				regular_image @{
725b5c8f7dSPulkoMandy					ffmpeg6 glu jasper jpeg libavif libicns libpng16 libwebp mesa
736d8c8a9dSOliver Tappe				}@
746d8c8a9dSOliver Tappe			] ;
75220d0402SOliver Tappe			if $(TARGET_PACKAGING_ARCH) != x86_gcc2 {
764f44282cSAdrien Destugues				AddHaikuImageSystemPackages [ FFilterByBuildFeatures gcc_syslibs
776454164dSJérôme Duval					mesa_swpipe ] ;
78220d0402SOliver Tappe			}
79220d0402SOliver Tappe		}
80271e9484SIngo Weinhold	}
8178f4c163SIngo Weinhold}
82429618d2SMatt Madia
83429618d2SMatt Madia# If enabled, make sure that OpenSSL is added to the image.
8457190167SIngo Weinholdif [ FIsBuildFeatureEnabled openssl ] {
850ea56347SPulkoMandy	AddHaikuImageSystemPackages openssl3 ;
86429618d2SMatt Madia}
87a5c31cbbSMatt Madia
8824796718SIngo Weinhold# add additionally requested packages
894f44282cSAdrien DestuguesAddHaikuImageSystemPackages $(HAIKU_IMAGE_ADDITIONAL_PACKAGES) ;
9024796718SIngo Weinhold
9148d60fa6SIngo Weinhold# Optionally we allow not to include the "src" subdirectory.
9248d60fa6SIngo Weinholdif $(HAIKU_DONT_INCLUDE_SRC) {
9348d60fa6SIngo Weinhold	# Don't include "src", but at least include the stuff needed for the
9448d60fa6SIngo Weinhold	# build.
9548d60fa6SIngo Weinhold	SubInclude HAIKU_TOP src build ;
9648d60fa6SIngo Weinhold	SubInclude HAIKU_TOP src tools ;
9748d60fa6SIngo Weinhold} else {
98338b8dc3SIngo Weinhold	SubInclude HAIKU_TOP src ;
9948d60fa6SIngo Weinhold}
100a7ec9c1dSFrançois Revolif $(HAIKU_INCLUDE_3RDPARTY) {
101a7ec9c1dSFrançois Revol	SubInclude HAIKU_TOP 3rdparty ;
102a7ec9c1dSFrançois Revol}
10348d60fa6SIngo Weinhold
104be8a6e43SIngo Weinhold# Perform deferred SubIncludes.
105be8a6e43SIngo WeinholdExecuteDeferredSubIncludes ;
106be8a6e43SIngo Weinhold
107689e6794SIngo Weinhold# reset subdir
108689e6794SIngo WeinholdSubDir HAIKU_TOP ;
109ad27081fSIngo Weinhold
110ad27081fSIngo Weinhold# Execute post-build-target user config rules.
111ad27081fSIngo WeinholdUserBuildConfigRulePostBuildTargets	;
112689e6794SIngo Weinhold
113be5e6fefSIngo Weinhold# specify the Haiku repository contents
114be5e6fefSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories Haiku ] ;
115be5e6fefSIngo Weinhold
116ff35d6c1SOliver Tappe# specify the actual Haiku image contents
117e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuImage ] ;
118ff35d6c1SOliver Tappe
119ff35d6c1SOliver Tappe# specify the additional image contents one for each boot type
120e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images NetBootArchive ] ;
121e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images FloppyBootImage ] ;
122e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images CDBootImage ] ;
123e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuCD ] ;
124e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images AnybootImage ] ;
125dd45d433SAlexander von Gluck IVinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images MMCImage ] ;
12637aefc9cSIngo Weinhold
12737aefc9cSIngo Weinhold# Check whether all requested optional packages do actually exist.
12837aefc9cSIngo Weinholdlocal package ;
12937aefc9cSIngo Weinholdlocal packageError ;
13037aefc9cSIngo Weinholdfor package in $(HAIKU_ADDED_OPTIONAL_PACKAGES) {
13137aefc9cSIngo Weinhold	if ! [ on $(package) return $(HAIKU_OPTIONAL_PACKAGE_EXISTS) ] {
13237aefc9cSIngo Weinhold		Echo "ERROR: Requested optional package \"$(package)\" does not"
13337aefc9cSIngo Weinhold			"exist." ;
13437aefc9cSIngo Weinhold		packageError = 1 ;
13537aefc9cSIngo Weinhold	}
13637aefc9cSIngo Weinhold}
13737aefc9cSIngo Weinholdif $(packageError) {
13837aefc9cSIngo Weinhold	Exit ;
13937aefc9cSIngo Weinhold}
14080ad173eSMatt Madia
14180ad173eSMatt Madia# Pseudo-target to build all targets that are localized.
142a8fcb885SMatt MadiaNotFile LocalizedTargets ;
143a8fcb885SMatt MadiaDepends LocalizedTargets : $(HAIKU_LOCALIZED_TARGETS) ;
1449de5b022SMatt Madia
1459de5b022SMatt MadiaNotFile catalogs ;
1469de5b022SMatt MadiaDepends catalogs : $(HAIKU_LOCALE_CATALOGS) ;
1479de5b022SMatt Madia
1489de5b022SMatt MadiaNotFile catkeys ;
1499de5b022SMatt MadiaDepends catkeys : $(HAIKU_LOCALE_OUTPUT_CATKEYS) ;
150