-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ninja
293 lines (203 loc) · 9.38 KB
/
build.ninja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
ninja_required_version = 1.8.2
ARCH = x86_64
TARGET = ${ARCH}-unknown-linux-musl
LLVM_VER = 15.0.0
BUILDROOT = out/build
SYSROOT = out/target/${TARGET}
INC = -isystem out/target/clang/lib/clang/${LLVM_VER}/include -isystem $SYSROOT/include -Isystem/bioniccompat/include
CC = out/target/bin/${TARGET}-clang -nostdinc $INC
CXX = out/target/bin/${TARGET}-clang++ -nostdinc -nostdinc++ -isystem $SYSROOT/include/c++/v1 $INC
LINKER = out/target/bin/${TARGET}-clang -isysroot $SYSROOT -stdlib=libc++
AR = out/target/bin/${TARGET}-ar
STRIP = out/target/bin/${TARGET}-strip
SYSTEMDIR = out/system
KERNEL_VERSION = 6.5.4-zen-g0538f11f294f
HOSTCC = out/host/bin/clang
HOSTCXX = out/host/bin/clang++ -stdlib++-isystem out/host/include/c++/v1
HOSTAR = out/host/bin/llvm-ar
YASM = out/host/bin/yasm -f elf64 -m amd64
rule cc
command = $CC -fPIC -g -MD -MF $out.d $cflags $includes -c $in -o $out
depfile = $out.d
description = CC $out
rule cxx
command = $CXX -std=c++20 -fPIC -g -MD -MF $out.d $cxxflags $includes -c $in -o $out
depfile = $out.d
description = CXX $out
rule yasm
command = $YASM $asflags $includes -o $out $in && echo -n $$(dirname $out)/ >$out.d && $YASM $asflags $includes -M $in >>$out.d
depfile = $out.d
description = YASM $out
rule ar
command = $AR csrD $out $in
description = AR $out
rule so
command = $LINKER -L$SYSROOT/lib -Wl,--as-needed -Wl,--no-undefined $libs -Wl,-x -shared -g -L$$(dirname $out) -Wl,-soname,$$(basename $out) -o $out $in
description = SO $out
rule soa
command = $LINKER -L$SYSROOT/lib -Wl,--as-needed -Wl,--no-undefined $libs -Wl,-x -shared -g -L$$(dirname $out) -Wl,-soname,$$(basename $out) -o $out -Wl,--whole-archive $in -Wl,--no-whole-archive
description = SO(.a) $out
rule link
command = $LINKER -L$SYSROOT/lib -Wl,--as-needed -Wl,--no-undefined $libs -o $out $in
description = LINK $out
rule strip
command = $STRIP --strip-all -o $out $in
description = STRIP $out
rule copy
command = mkdir -p $$(dirname $out) && cp -f $in $out
description = COPY $out <- $in
rule symlink
command = ln -sf $target $out
description = SYMLINK $out -> $target
rule hostcc
command = $HOSTCC -fPIC -g $cflags $includes -c $in -o $out
description = [HOST] CC $out
rule hostcxx
command = $HOSTCXX -std=c++20 -fPIC -g $cxxflags $includes -c $in -o $out
description = [HOST] CXX $out
rule hostar
command = $HOSTAR csrD $out $in
description = [HOST] AR $out
rule hostld
command = $HOSTCXX -fuse-ld=mold -stdlib=libc++ -Wl,-rpath,out/host/lib $ldflags $in -o $out
description = [HOST] LINK $out
# host versions of target builds
subninja build/host.ninja
subninja build/aidl_host.ninja
build out/host/bin/aidl: copy $BUILDROOT/_host/aidl/aidl
HOSTAIDL = out/host/bin/aidl
rule aidl
command = mkdir -p "${headerDir}" && $HOSTAIDL --lang=${lang} ${optionalFlags} --ninja -d ${out}.d -h ${headerDir} -o ${outDir} ${imports} ${in}
generator = $HOSTAIDL
depfile = ${out}.d
description = [HOST] AIDL ${lang} ${in}
subninja build/protobuf_host.ninja
build out/host/bin/protoc: copy $BUILDROOT/_host/protobuf/aprotoc
HOSTPROTOC = out/host/bin/protoc
rule protoc
command = $HOSTPROTOC --cpp_out=lite:$BUILDROOT/init/proto --dependency_out=$out -I . $in #&& out/soong/host/linux-x86/bin/dep_fixer out/soong/.intermediates/system/core/init/host_init_verifier/linux_glibc_x86_64/gen/proto/system/core/init/subcontext.pb.d
generator = $HOSTPROTOC
description = [HOST] PROTOC $in
subninja build/kmod.ninja
build out/host/bin/depmod: copy $BUILDROOT/_host/kmod/depmod
subninja build/wayland_host.ninja
build out/host/bin/wayland-scanner: copy $BUILDROOT/_host/wayland/wayland-scanner
rule wayland-scanner
command = out/host/bin/wayland-scanner -s $type $in $out
generator = out/host/bin/wayland-scanner
description = [HOST] WAYLAND SCANNER $out
subninja build/bioniccompat.ninja
subninja build/fmtlib.ninja
subninja build/libbase.ninja
build $SYSROOT/lib/libbase.so: copy $BUILDROOT/libbase/libbase.so
subninja build/libbinder.ninja
build $SYSROOT/lib/libbinder.so: copy $BUILDROOT/libbinder/libbinder.so
subninja build/libcap.ninja
build $SYSROOT/include/sys/capability.h: copy external/libcap/libcap/include/sys/capability.h
build $SYSROOT/lib/libcap.so: copy $BUILDROOT/libcap/libcap.so
subninja build/libcgrouprc.ninja
build $SYSROOT/lib/libcgrouprc.so: copy $BUILDROOT/libcgrouprc/libcgrouprc.so
subninja build/libcgrouprc_format.ninja
subninja build/libcutils.ninja
build $SYSROOT/lib/libcutils.so: copy $BUILDROOT/libcutils/libcutils.so
subninja build/libdrm.ninja
build $SYSROOT/lib/libdrm.so: copy $BUILDROOT/libdrm/libdrm.so
subninja build/libevdev.ninja
build $SYSROOT/lib/libevdev.so: copy $BUILDROOT/libevdev/libevdev.so
subninja build/libext2_uuid.ninja
build $SYSROOT/lib/libext2_uuid.so: copy $BUILDROOT/libext2_uuid/libext2_uuid.so
subninja build/libext4_utils.ninja
build $SYSROOT/lib/libext4_utils.so: copy $BUILDROOT/ext4_utils/libext4_utils.so
subninja build/libffi.ninja
subninja build/libinput.ninja
build $SYSROOT/lib/libinput.so: copy $BUILDROOT/libinput/libinput.so
subninja build/libjpeg.ninja
build $SYSROOT/lib/libjpeg.so: copy $BUILDROOT/libjpeg/libjpeg.so
subninja build/liblog.ninja
build $SYSROOT/lib/liblog.so: copy $BUILDROOT/liblog/liblog.so
subninja build/libmodprobe.ninja
subninja build/libpng.ninja
build $SYSROOT/lib/libpng.so: copy $BUILDROOT/libpng/libpng.so
subninja build/libprocessgroup.ninja
build $SYSROOT/lib/libprocessgroup.so: copy $BUILDROOT/libprocessgroup/libprocessgroup.so
subninja build/libprocessgroup_setup.ninja
build $SYSROOT/lib/libprocessgroup_setup.so: copy $BUILDROOT/libprocessgroup_setup/libprocessgroup_setup.so
subninja build/libprocinfo.ninja
subninja build/libpropertyinfoparser.ninja
subninja build/libpropertyinfoserializer.ninja
subninja build/libsystemproperties.ninja
build $SYSROOT/lib/libsystemproperties.so: copy $BUILDROOT/libsystemproperties/libsystemproperties.so
subninja build/libsysutils.ninja
build $SYSROOT/lib/libsysutils.so: copy $BUILDROOT/libsysutils/libsysutils.so
subninja build/libudev.ninja
build $SYSROOT/lib/libudev.so: copy $BUILDROOT/libudev/libudev.so
build $SYSROOT/include/libudev.h: copy external/libudev/udev.h
subninja build/libutils.ninja
build $SYSROOT/lib/libutils.so: copy $BUILDROOT/libutils/libutils.so
subninja build/libva.ninja
build $SYSROOT/lib/libva.so: copy $BUILDROOT/libva/libva.so
build $SYSROOT/lib/libva-drm.so: copy $BUILDROOT/libva/libva-drm.so
build $SYSROOT/lib/libva-wayland.so: copy $BUILDROOT/libva/libva-wayland.so
subninja build/libwebp.ninja
build $SYSROOT/lib/libwebp.so: copy $BUILDROOT/libwebp/libwebp.so
subninja build/libxkbcommon.ninja
build $SYSROOT/lib/libxkbcommon.so: copy $BUILDROOT/libxkbcommon/libxkbcommon.so
subninja build/boringssl.ninja
build $SYSROOT/lib/libcrypto.so: copy $BUILDROOT/boringssl/libcrypto.so
subninja build/cairo.ninja
build $SYSROOT/lib/libcairo.so: copy $BUILDROOT/cairo/libcairo.so
subninja build/elfutils.ninja
build $SYSROOT/lib/libelf.so: copy $BUILDROOT/elfutils/libelf.so
build $SYSROOT/lib/libdw.so: copy $BUILDROOT/elfutils/libdw.so
subninja build/expat.ninja
build $SYSROOT/lib/libexpat.so: copy $BUILDROOT/expat/libexpat.so
subninja build/fontconfig.ninja
build $SYSROOT/lib/libfontconfig.so: copy $BUILDROOT/fontconfig/libfontconfig.so
subninja build/freetype.ninja
build $SYSROOT/lib/libfreetype.so: copy $BUILDROOT/freetype/libfreetype.so
subninja build/fs_mgr.ninja
build $SYSROOT/lib/libfs_mgr.so: copy $BUILDROOT/fs_mgr/libfs_mgr.so
subninja build/harfbuzz.ninja
build $SYSROOT/lib/libharfbuzz.so: copy $BUILDROOT/harfbuzz/libharfbuzz.so
subninja build/init.ninja
subninja build/jsoncpp.ninja
subninja build/logwrapper.ninja
build $SYSROOT/lib/liblogwrap.so: copy $BUILDROOT/logwrapper/liblogwrap.so
subninja build/mksh.ninja
subninja build/pixman.ninja
build $SYSROOT/lib/libpixman-1.so: copy $BUILDROOT/pixman/libpixman-1.so
subninja build/protobuf.ninja
subninja build/initramfs.ninja
build initramfs: phony $BUILDROOT/initramfs.gz
subninja build/mesa.ninja
build $SYSROOT/lib/libgbm.so: copy $BUILDROOT/mesa/libgbm.so
build $SYSROOT/lib/libglapi.so: copy $BUILDROOT/mesa/libglapi.so
build $SYSROOT/lib/libEGL.so: copy $BUILDROOT/mesa/libEGL.so
build $SYSROOT/lib/libGLESv2.so: copy $BUILDROOT/mesa/libGLESv2.so
subninja build/mtdev.ninja
subninja build/seatd.ninja
build $SYSROOT/lib/libseat.so: copy $BUILDROOT/seatd/libseat.so
subninja build/servicemanager.ninja
subninja build/skia.ninja
build $SYSROOT/lib/libskia.so: copy $BUILDROOT/skia/libskia.so
subninja build/strace.ninja
subninja build/system_img.ninja
subninja build/toolbox.ninja
subninja build/toybox.ninja
subninja build/utils.ninja
subninja build/wayland.ninja
build $SYSROOT/lib/libwayland-client.so: copy $BUILDROOT/wayland/libwayland-client.so
build $SYSROOT/lib/libwayland-server.so: copy $BUILDROOT/wayland/libwayland-server.so
build $SYSROOT/lib/libwayland-cursor.so: copy $BUILDROOT/wayland/libwayland-cursor.so
subninja build/wayland-utils.ninja
subninja build/weston.ninja
subninja build/xkeyboard-config.ninja
subninja build/zlib.ninja
build $SYSROOT/lib/libz.so: copy $BUILDROOT/zlib/libz.so
subninja build/zstd.ninja
build $SYSROOT/lib/libzstd.so: copy $BUILDROOT/zstd/libzstd.so
subninja system/os/build.ninja
build $SYSROOT/lib/libbe.so: copy $BUILDROOT/os/libbe.so
build $SYSTEMDIR/tests/sampservice: copy $BUILDROOT/os/services/sampservice/sampservice
build $SYSTEMDIR/system/libexec/app_server: copy $BUILDROOT/os/services/app/app_server
default initramfs system.img