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 22*4f44282cSAdrien DestuguesAddHaikuImageSystemPackages [ FFilterByBuildFeatures 236ac3a280SJérôme Duval bash bc coreutils curl freetype icu libsolv zlib zstd 246d8c8a9dSOliver Tappe 256d8c8a9dSOliver Tappe regular_image @{ 2677d551c2SAugustin Cavalier bzip2 ctags diffutils expat ffmpeg findutils gawk glu grep gutenprint8 27b875d6d4SKacper Kasper gzip ilmbase jasper jpeg 28181bcc8cSJérôme Duval less libedit libicns libpcap libpng16 libwebp 296454164dSJérôme Duval mesa mesa_devel mesa_swpipe@!gcc2 mesa_swrast@gcc2 30b875d6d4SKacper Kasper netcat openexr 31242c022aSJérôme Duval sed sharutils 32d43720adSJérôme Duval tar tcpdump unzip wget which zip 336d8c8a9dSOliver Tappe }@ 346d8c8a9dSOliver Tappe] ; 358547d09eSAugustin CavalierAddHaikuImageSourcePackages [ FFilterByBuildFeatures 368547d09eSAugustin Cavalier bash bc coreutils 378547d09eSAugustin Cavalier 388547d09eSAugustin Cavalier regular_image @{ 3977d551c2SAugustin Cavalier ctags expat ffmpeg findutils gawk grep gutenprint8 408547d09eSAugustin Cavalier gzip 418547d09eSAugustin Cavalier less libicns 428547d09eSAugustin Cavalier sed sharutils 438547d09eSAugustin Cavalier tar wget which 448547d09eSAugustin Cavalier }@ 458547d09eSAugustin Cavalier] ; 46220d0402SOliver Tappeif $(HAIKU_PACKAGING_ARCHS[1]) != x86_gcc2 { 47*4f44282cSAdrien Destugues AddHaikuImageSystemPackages [ FFilterByBuildFeatures gcc_syslibs ] ; 48220d0402SOliver Tappe} 49220d0402SOliver Tappe 50220d0402SOliver Tappeif $(HAIKU_PACKAGING_ARCHS[2]) { 51271e9484SIngo Weinhold # secondary architectures 52271e9484SIngo Weinhold local architectureObject ; 53271e9484SIngo Weinhold for architectureObject 54271e9484SIngo Weinhold in [ MultiArchSubDirSetup $(HAIKU_PACKAGING_ARCHS[2-]) ] { 55271e9484SIngo Weinhold on $(architectureObject) { 56*4f44282cSAdrien Destugues AddHaikuImageSystemPackages [ FFilterByBuildFeatures 576d8c8a9dSOliver Tappe curl freetype icu libsolv zlib 586d8c8a9dSOliver Tappe 596d8c8a9dSOliver Tappe regular_image @{ 6097d08998SJérôme Duval ffmpeg glu jasper jpeg libicns libpng16 libwebp mesa 616d8c8a9dSOliver Tappe }@ 626d8c8a9dSOliver Tappe ] ; 63220d0402SOliver Tappe if $(TARGET_PACKAGING_ARCH) != x86_gcc2 { 64*4f44282cSAdrien Destugues AddHaikuImageSystemPackages [ FFilterByBuildFeatures gcc_syslibs 656454164dSJérôme Duval mesa_swpipe ] ; 66220d0402SOliver Tappe } 67220d0402SOliver Tappe } 68271e9484SIngo Weinhold } 6978f4c163SIngo Weinhold} 70429618d2SMatt Madia 71429618d2SMatt Madia# If enabled, make sure that OpenSSL is added to the image. 7257190167SIngo Weinholdif [ FIsBuildFeatureEnabled openssl ] { 73*4f44282cSAdrien Destugues AddHaikuImageSystemPackages openssl ; 74429618d2SMatt Madia} 75a5c31cbbSMatt Madia 7624796718SIngo Weinhold# add additionally requested packages 77*4f44282cSAdrien DestuguesAddHaikuImageSystemPackages $(HAIKU_IMAGE_ADDITIONAL_PACKAGES) ; 7824796718SIngo Weinhold 7948d60fa6SIngo Weinhold# Optionally we allow not to include the "src" subdirectory. 8048d60fa6SIngo Weinholdif $(HAIKU_DONT_INCLUDE_SRC) { 8148d60fa6SIngo Weinhold # Don't include "src", but at least include the stuff needed for the 8248d60fa6SIngo Weinhold # build. 8348d60fa6SIngo Weinhold SubInclude HAIKU_TOP src build ; 8448d60fa6SIngo Weinhold SubInclude HAIKU_TOP src tools ; 8548d60fa6SIngo Weinhold} else { 86338b8dc3SIngo Weinhold SubInclude HAIKU_TOP src ; 8748d60fa6SIngo Weinhold} 88a7ec9c1dSFrançois Revolif $(HAIKU_INCLUDE_3RDPARTY) { 89a7ec9c1dSFrançois Revol SubInclude HAIKU_TOP 3rdparty ; 90a7ec9c1dSFrançois Revol} 9148d60fa6SIngo Weinhold 92be8a6e43SIngo Weinhold# Perform deferred SubIncludes. 93be8a6e43SIngo WeinholdExecuteDeferredSubIncludes ; 94be8a6e43SIngo Weinhold 95689e6794SIngo Weinhold# reset subdir 96689e6794SIngo WeinholdSubDir HAIKU_TOP ; 97ad27081fSIngo Weinhold 98ad27081fSIngo Weinhold# Execute post-build-target user config rules. 99ad27081fSIngo WeinholdUserBuildConfigRulePostBuildTargets ; 100689e6794SIngo Weinhold 101be5e6fefSIngo Weinhold# specify the Haiku repository contents 102be5e6fefSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories Haiku ] ; 103be5e6fefSIngo Weinhold 104ff35d6c1SOliver Tappe# specify the actual Haiku image contents 105e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuImage ] ; 106ff35d6c1SOliver Tappe 107ff35d6c1SOliver Tappe# specify the additional image contents one for each boot type 108e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images NetBootArchive ] ; 109e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images FloppyBootImage ] ; 110e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images CDBootImage ] ; 111e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuCD ] ; 112e8c5236aSIngo Weinholdinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images AnybootImage ] ; 113dd45d433SAlexander von Gluck IVinclude [ FDirName $(HAIKU_BUILD_RULES_DIR) images MMCImage ] ; 11437aefc9cSIngo Weinhold 11537aefc9cSIngo Weinhold# Check whether all requested optional packages do actually exist. 11637aefc9cSIngo Weinholdlocal package ; 11737aefc9cSIngo Weinholdlocal packageError ; 11837aefc9cSIngo Weinholdfor package in $(HAIKU_ADDED_OPTIONAL_PACKAGES) { 11937aefc9cSIngo Weinhold if ! [ on $(package) return $(HAIKU_OPTIONAL_PACKAGE_EXISTS) ] { 12037aefc9cSIngo Weinhold Echo "ERROR: Requested optional package \"$(package)\" does not" 12137aefc9cSIngo Weinhold "exist." ; 12237aefc9cSIngo Weinhold packageError = 1 ; 12337aefc9cSIngo Weinhold } 12437aefc9cSIngo Weinhold} 12537aefc9cSIngo Weinholdif $(packageError) { 12637aefc9cSIngo Weinhold Exit ; 12737aefc9cSIngo Weinhold} 12880ad173eSMatt Madia 12980ad173eSMatt Madia# Pseudo-target to build all targets that are localized. 130a8fcb885SMatt MadiaNotFile LocalizedTargets ; 131a8fcb885SMatt MadiaDepends LocalizedTargets : $(HAIKU_LOCALIZED_TARGETS) ; 1329de5b022SMatt Madia 1339de5b022SMatt MadiaNotFile catalogs ; 1349de5b022SMatt MadiaDepends catalogs : $(HAIKU_LOCALE_CATALOGS) ; 1359de5b022SMatt Madia 1369de5b022SMatt MadiaNotFile catkeys ; 1379de5b022SMatt MadiaDepends catkeys : $(HAIKU_LOCALE_OUTPUT_CATKEYS) ; 138