16ecad0f3SAugustin Cavalierif ! [ Match "(.*)-haiku-(.*)" : $(JAMVERSION) ] { 26ecad0f3SAugustin Cavalier Exit "You can only build Haiku with Haiku's Jam, not Perforce Jam or" 36ecad0f3SAugustin Cavalier "some other variant (you are using $(JAMVERSION))." ; 46ecad0f3SAugustin Cavalier} 56ecad0f3SAugustin Cavalier 6338b8dc3SIngo WeinholdSubDir HAIKU_TOP ; 769b97469SIngo Weinhold 8f35b607dSJérôme DuvalNotFile doc_files ; 9f35b607dSJérôme DuvalDepends files : doc_files ; 10f35b607dSJérôme Duval 11f4eb5cf7SMatt Madia# Prepare the optional build features before parsing the Jamfile tree. 12b0944c78SIngo Weinholdlocal architectureObject ; 13b0944c78SIngo Weinholdfor architectureObject in [ MultiArchSubDirSetup ] { 14b0944c78SIngo Weinhold on $(architectureObject) { 15f0cacbb3SIngo Weinhold include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatures ] ; 16afde4473SOliver Tappe 17afde4473SOliver Tappe # Let the target platform depend on the external header directories such 18afde4473SOliver Tappe # that those will be unpacked before anything is built for the target 19afde4473SOliver Tappe # platform. 20afde4473SOliver Tappe Depends $(TARGET_PLATFORM) : [ 21afde4473SOliver Tappe BuildFeatureAttribute gcc_syslibs_devel : c++-headers 22afde4473SOliver Tappe ] [ 23afde4473SOliver Tappe BuildFeatureAttribute gcc_syslibs_devel : gcc-headers 24afde4473SOliver Tappe ] ; 25b0944c78SIngo Weinhold } 26b0944c78SIngo Weinhold} 27f4eb5cf7SMatt Madia 286d8c8a9dSOliver Tappe# Include required packages: 2972e67791SOliver Tappe# primary architecture 306d8c8a9dSOliver TappeAddHaikuImagePackages [ FFilterByBuildFeatures 316ac3a280SJérôme Duval bash bc coreutils curl freetype icu libsolv zlib zstd 326d8c8a9dSOliver Tappe 336d8c8a9dSOliver Tappe regular_image @{ 34ed92a105SJérôme Duval bzip2 ctags diffutils expat ffmpeg findutils gawk glu grep gutenprint 35b875d6d4SKacper Kasper gzip ilmbase jasper jpeg 36181bcc8cSJérôme Duval less libedit libicns libpcap libpng16 libwebp 376454164dSJérôme Duval mesa mesa_devel mesa_swpipe@!gcc2 mesa_swrast@gcc2 38b875d6d4SKacper Kasper netcat openexr 39242c022aSJérôme Duval sed sharutils 40d43720adSJérôme Duval tar tcpdump unzip wget which zip 416d8c8a9dSOliver Tappe }@ 426d8c8a9dSOliver Tappe] ; 43*8547d09eSAugustin CavalierAddHaikuImageSourcePackages [ FFilterByBuildFeatures 44*8547d09eSAugustin Cavalier bash bc coreutils 45*8547d09eSAugustin Cavalier 46*8547d09eSAugustin Cavalier regular_image @{ 47*8547d09eSAugustin Cavalier ctags expat ffmpeg findutils gawk grep gutenprint 48*8547d09eSAugustin Cavalier gzip 49*8547d09eSAugustin Cavalier less libicns 50*8547d09eSAugustin Cavalier sed sharutils 51*8547d09eSAugustin Cavalier tar wget which 52*8547d09eSAugustin Cavalier }@ 53*8547d09eSAugustin Cavalier] ; 54220d0402SOliver Tappeif $(HAIKU_PACKAGING_ARCHS[1]) != x86_gcc2 { 55220d0402SOliver Tappe AddHaikuImagePackages [ FFilterByBuildFeatures gcc_syslibs ] ; 56220d0402SOliver Tappe} 57220d0402SOliver Tappe 58220d0402SOliver Tappeif $(HAIKU_PACKAGING_ARCHS[2]) { 59271e9484SIngo Weinhold # secondary architectures 60271e9484SIngo Weinhold local architectureObject ; 61271e9484SIngo Weinhold for architectureObject 62271e9484SIngo Weinhold in [ MultiArchSubDirSetup $(HAIKU_PACKAGING_ARCHS[2-]) ] { 63271e9484SIngo Weinhold on $(architectureObject) { 646d8c8a9dSOliver Tappe AddHaikuImagePackages [ FFilterByBuildFeatures 656d8c8a9dSOliver Tappe curl freetype icu libsolv zlib 666d8c8a9dSOliver Tappe 676d8c8a9dSOliver Tappe regular_image @{ 6897d08998SJérôme Duval ffmpeg glu jasper jpeg libicns libpng16 libwebp mesa 696d8c8a9dSOliver Tappe }@ 706d8c8a9dSOliver Tappe ] ; 71220d0402SOliver Tappe if $(TARGET_PACKAGING_ARCH) != x86_gcc2 { 726454164dSJérôme Duval AddHaikuImagePackages [ FFilterByBuildFeatures gcc_syslibs 736454164dSJérôme Duval mesa_swpipe ] ; 74220d0402SOliver Tappe } 75220d0402SOliver Tappe } 76271e9484SIngo Weinhold } 7778f4c163SIngo Weinhold} 78429618d2SMatt Madia 79429618d2SMatt Madia# If enabled, make sure that OpenSSL is added to the image. 8057190167SIngo Weinholdif [ FIsBuildFeatureEnabled openssl ] { 8198c6dfa4SIngo Weinhold AddHaikuImagePackages openssl ; 82429618d2SMatt Madia} 83a5c31cbbSMatt Madia 8424796718SIngo Weinhold# add additionally requested packages 8524796718SIngo WeinholdAddHaikuImagePackages $(HAIKU_IMAGE_ADDITIONAL_PACKAGES) ; 8624796718SIngo Weinhold 8748d60fa6SIngo Weinhold# Optionally we allow not to include the "src" subdirectory. 8848d60fa6SIngo Weinholdif $(HAIKU_DONT_INCLUDE_SRC) { 8948d60fa6SIngo Weinhold # Don't include "src", but at least include the stuff needed for the 9048d60fa6SIngo Weinhold # build. 9148d60fa6SIngo Weinhold SubInclude HAIKU_TOP src build ; 9248d60fa6SIngo Weinhold SubInclude HAIKU_TOP src tools ; 9348d60fa6SIngo Weinhold} else { 94338b8dc3SIngo Weinhold SubInclude HAIKU_TOP src ; 9548d60fa6SIngo Weinhold} 96a7ec9c1dSFrançois Revolif $(HAIKU_INCLUDE_3RDPARTY) { 97a7ec9c1dSFrançois Revol SubInclude HAIKU_TOP 3rdparty ; 98a7ec9c1dSFrançois Revol} 9948d60fa6SIngo Weinhold 100be8a6e43SIngo Weinhold# Perform deferred SubIncludes. 101be8a6e43SIngo WeinholdExecuteDeferredSubIncludes ; 102be8a6e43SIngo Weinhold 103689e6794SIngo Weinhold# reset subdir 104689e6794SIngo WeinholdSubDir HAIKU_TOP ; 105ad27081fSIngo Weinhold 106ad27081fSIngo Weinhold# Execute post-build-target user config rules. 107ad27081fSIngo WeinholdUserBuildConfigRulePostBuildTargets ; 108689e6794SIngo Weinhold 109be5e6fefSIngo Weinhold# specify the Haiku repository contents 110be5e6fefSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories Haiku ] ; 111be5e6fefSIngo Weinhold 112ff35d6c1SOliver Tappe# specify the actual Haiku image contents 113e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuImage ] ; 114ff35d6c1SOliver Tappe 115ff35d6c1SOliver Tappe# specify the additional image contents one for each boot type 116e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images NetBootArchive ] ; 117e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images FloppyBootImage ] ; 118e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images CDBootImage ] ; 119e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images CDBootPPCImage ] ; 120e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuCD ] ; 121e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images AnybootImage ] ; 12237aefc9cSIngo Weinhold 12337aefc9cSIngo Weinhold# Check whether all requested optional packages do actually exist. 12437aefc9cSIngo Weinholdlocal package ; 12537aefc9cSIngo Weinholdlocal packageError ; 12637aefc9cSIngo Weinholdfor package in $(HAIKU_ADDED_OPTIONAL_PACKAGES) { 12737aefc9cSIngo Weinhold if ! [ on $(package) return $(HAIKU_OPTIONAL_PACKAGE_EXISTS) ] { 12837aefc9cSIngo Weinhold Echo "ERROR: Requested optional package \"$(package)\" does not" 12937aefc9cSIngo Weinhold "exist." ; 13037aefc9cSIngo Weinhold packageError = 1 ; 13137aefc9cSIngo Weinhold } 13237aefc9cSIngo Weinhold} 13337aefc9cSIngo Weinholdif $(packageError) { 13437aefc9cSIngo Weinhold Exit ; 13537aefc9cSIngo Weinhold} 13680ad173eSMatt Madia 13780ad173eSMatt Madia# Pseudo-target to build all targets that are localized. 138a8fcb885SMatt MadiaNotFile LocalizedTargets ; 139a8fcb885SMatt MadiaDepends LocalizedTargets : $(HAIKU_LOCALIZED_TARGETS) ; 1409de5b022SMatt Madia 1419de5b022SMatt MadiaNotFile catalogs ; 1429de5b022SMatt MadiaDepends catalogs : $(HAIKU_LOCALE_CATALOGS) ; 1439de5b022SMatt Madia 1449de5b022SMatt MadiaNotFile catkeys ; 1459de5b022SMatt MadiaDepends catkeys : $(HAIKU_LOCALE_OUTPUT_CATKEYS) ; 146