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