-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
515 lines (425 loc) · 17.4 KB
/
Copy pathMakefile
File metadata and controls
515 lines (425 loc) · 17.4 KB
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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# Flags for some of the stuff I build
ALL_OUTPUT := $(CURDIR)
O ?= $(ALL_OUTPUT)
R := $(ALL_OUTPUT)/release$(cf)$(vgccversion)
HERE := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
SRC := $(HERE)
S := $(SRC)
SHELL=/bin/bash -o pipefail
_MAKEFLAGS = -Rr
platform = $(shell uname -s)
B = $(platform:Darwin=build)$(cf)$(vgccversion)
tools0 = $(platform:Darwin=/win/tools:/Volumes/cmake-3.28.3-macos10.10-universal/CMake.app/Contents/bin:)
tools = $(tools0:Linux=)
cflags_global = $(cf:-a=-fsanitize=address)
install_target = install
# ---------- project specific options ----------
%.perfc: cov.flags="EXTRA_CFLAGS=-fprofile-arcs -ftest-coverage"
%.perf %.perfc %.perfc.g: output=$O/build.$(@:.g=)
%.perf %.perfc:
mkdir -p $(output)
cd $*/tools/perf && $(MAKE) O=$(output) V=1\
NO_JEVENTS=1 NO_LIBTRACEEVENT=1 $(cov.flags)
%.perfc.g:
cd $O/$*/tools/perf && gcov -dp $(shell find $(output) -iname '*.o')
perf.dnf:
dnf install elfutils-devel elfutils-libelf-devel
perf-static: bzip2-1.0.6.m xz.m elfutils.m
mkdir -p $O/static.perf
cd linux/tools/perf &&\
$(MAKE) O=$O/static.perf V=1 LDFLAGS="-static -L$R/lib"\
EXTRA_CFLAGS=-I$R/include
llama.cpp.options = -DBUILD_SHARED_LIBS=OFF -DGGML_CCACHE=OFF -DGGML_CUDA=ON\
-DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.2/bin/nvcc\
-DCMAKE_INSTALL_RPATH='/usr/local/cuda-12.2/lib64;$$ORIGIN'\
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
tigervnc.dnf:
dnf install --setopt=install_weak_deps=False\
/usr/include/jpeglib.h /usr/lib64/pkgconfig/pam.pc
Clang_DIR = /Volumes/clang+llvm-9.0.0-x86_64-darwin-apple
elfutils.options = --enable-maintainer-mode
binutils-gdb.options.Darwin = --disable-gold --disable-ld --enable-targets=all
binutils-gdb.options = --disable-gold --enable-targets=all\
CFLAGS="-g -O2 -Wno-error=cast-function-type -Wno-error=stringop-truncation\
-Wno-error=format-truncation -Wno-error=format-overflow"
binutils-gdb.envvars = MAKEINFO=:
qemu.envvars.Darwin = PKG_CONFIG=$R/bin/pkg-config
qemu6.envvars.Darwin = $(qemu.envvars.Darwin)
qemu%: options = --target-list=x86_64-softmmu --disable-docs\
--disable-guest-agent --disable-curl\
--enable-slirp
# --enable-virtfs works only on Linux
qemu%: options.Linux = --enable-gtk
qemu%: options.Darwin = --disable-live-block-migration
pkg-config.options = --with-internal-glib
swig.options += -D WITH_PCRE=OFF
# CMAKE_INSTALL_MODE requires cmake 3.22
llvm_common.options =\
-U LLVM_DIR -U Clang_DIR\
-D CMAKE_CXX_COMPILER=clang++\
-D CMAKE_C_COMPILER=clang\
-D CMAKE_BUILD_TYPE=RelWithDebInfo\
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO='-Os -g -DNDEBUG'\
-D LLVM_TARGETS_TO_BUILD=X86\
-D LLDB_ENABLE_LIBEDIT=1\
-D BUILD_SHARED_LIBS=1\
-D LLVM_ENABLE_ASSERTIONS=1
llvm.options = $(llvm_common.options) -D LLVM_INCLUDE_TESTS=1\
-D LLVM_INSTALL_GTEST=1\
-D CMAKE_BUILD_WITH_INSTALL_RPATH=1
# Doesn't work in cmake 3.20
# -DCMAKE_AR="ls nonsence"
clang.options = $(llvm_common.options)\
-D CLANG_INCLUDE_TESTS=0\
-D LLVM_INCLUDE_TESTS=0\
-D LLVM_TABLEGEN_FLAGS="-I$R/include"
lldb.options = $(clang.options)\
-D CMAKE_EXE_LINKER_FLAGS=-g\
-D LLVM_MAIN_INCLUDE_DIR="$R/include"\
-D LLDB_USE_SYSTEM_DEBUGSERVER=ON\
-D LLDB_INCLUDE_TESTS=1\
-D LLDB_ENABLE_PYTHON=1
lld.options = $(clang.options)
rtags.options = -D\
LIBCLANG_LLVM_CONFIG_EXECUTABLE="$(Clang_DIR)/bin/llvm-config"\
-D CMAKE_CXX_COMPILER="$(Clang_DIR)/bin/clang++"
qtbase.options = -extprefix "$R" -v -opensource -confirm-license\
-qtlibinfix AndroidEmu
fuzzy_dictionary.envvars =\
CXXFLAGS="-target x86_64-gnu-linux -v\
-I /Library/Developer/CommandLineTools/usr/include/c++/v1\
-I /win/third_party/release/glibc.2.7/include\
-I /win/third_party/glibc/Kernel-headers"\
LDFLAGS="-target x86_64-gnu-linux -v\
-fuse-ld=/Volumes/clang+llvm-9.0.0-x86_64-darwin-apple/bin/ld.lld"
# fuzzy_dictionary.envvars = CXX="clang++ -v"
fuzzy_dictionary.targets = fuzzy_dictionary_lib
core6.options = --target x86_64-gnu-linux\
"CPPFLAGS=-target x86_64-gnu-linux\
-Wno-inconsistent-missing-override\
-I /Library/Developer/CommandLineTools/usr/include/c++/v1\
-I /win/third_party/release/glibc.2.7/include\
-I /win/third_party/glibc/Kernel-headers"\
"LDFLAGS=-target x86_64-gnu-linux -v\
-fuse-ld=/Volumes/clang+llvm-9.0.0-x86_64-darwin-apple/bin/ld.lld\
--sysroot=/win/third_party/release/glibc.2.7\
-rtlib=compiler-rt"
core6.overrides = MAKE="make -W kodwebd/stdafx.h.gch -W\
kdb/stdafx.h.gch"
core6.deps = $S/portable_autotools/realpath
__pdf2djvu.options = "POPPLER_CFLAGS=-I $(HERE)/../third_party/include"\
"POPPLER_LIBS=-L $(HERE)/../third_party/lib"
pdf2djvu.overrides = -f ../pdf2djvu/Makefile
usb.options = CFLAGS="-Wno-incompatible-pointer-types -Wno-format"
keyfuzz.options = --disable-lynx
_build%evince: options=-Ddjvu=enabled -Dnautilus=false\
-Dintrospection=false -Dgtk_doc=false -Duser_doc=false\
-Dgspell=disabled
zsh%: options = --with-tcsetpgrp
emacs%: options = --with-tiff=no --with-xpm=no --with-gnutls=no\
--with-jpeg=no --with-gif=no
# If I use PKG_CONFIG_LIBDIR system packages are not found
network-manager-applet% nma1%: options = -Dwwan=false -Dteam=false
network-manager-applet% nma1% xfce4-panel% thunar% :\
envvars =\
PKG_CONFIG_PATH=$R/lib64/pkgconfig:$R/lib/x86_64-linux-gnu/pkgconfig
libnma%: options = -Dgcr=false -Dintrospection=false -Dvapi=false
network-manager-applet.n: libnma.m
#
# To build with OS paths baked in:
# scl enable gcc-toolset-12 'make evince.n B=global R=/usr'
#
_cmake.options=-DCMAKE_USE_OPENSSL=OFF
xfce4-panel.n: libxfce4ui.m
bluez%: options = --enable-obex --disable-client --disable-mesh
libass.n: harfbuzz.m fribidi.m freetype2.m
freetype2.m: bzip2.m zlib.m
bzip2.m:
$(MAKE) bzip2.install_ DISABLE_MESON=disable
new-emacs.n: new-fake-manuals
%fake-manuals:
mkdir -p $*emacs/info
echo "Fake" > $*emacs/info/emacs
echo "Fake" > $*emacs/info/emacs.info
noinstall.qemu make.qemu qemu6.n: pkg-config.m glib.m pixman.m
# qemu must skip meson.build
qemu8.n_: qemu8.m_
qemu%.n_: qemu%.m_
aqemu.make: pkg-config.install_ glib.install_ pixman.install_
lldb.Darwin.deps = swig.m libedit.m
lldb.n: $(lldb.$(platform).deps) clang.m
lldb.apt:
apt install --no-install-recommends libedit-dev swig
clang.m: llvm.m
aqemu.make: pkg-config.install_ glib.install_ pixman.install_
heaptrack.apt:
apt install -y libunwind-dev libdw-dev libboost-dev\
libboost-iostreams-dev libboost-program-options-dev\
libboost-system-dev libboost-filesystem-dev
%heaptrack: options = -Wno-dev
thunar.n thunar1.n: libxfce4ui.m
thunar1.n: gtk.m
thunar%: options = -Dterminal=disabled -D introspection=false
thunar1%: cflags = -Werror -fsanitize=address
vte%: options = -Dgnutls=false -Dvapi=false
thunar-new.n: libxfce4ui-new.m
thunar-new.n: envvars = CC=clang
libxfce4ui-new.m: gtk-new.m
gtk-new.m: glib-new.m gvfs-new.m
gtk-new.options = -Dwayland-backend=false -Dmedia-gstreamer=disabled\
-Dvulkan=disabled -Dbuild-tests=false
gvfs-new.m: glib-new.m
gvfs-new.options = -Dtmpfilesdir=no -Dsystemduserunitdir=no -Dgcr=false\
-Dadmin=false -Dhttp=false -Ddnssd=false -Dgudev=false -Dfuse=false\
-Dudisks2=false -Dlogind=false -Dafc=false -Dgoa=false -Dkeyring=false\
-Dbluray=false -Dlibusb=false -Dsmb=false -Darchive=false -Dcdda=false\
-Dgoogle=false -Donedrive=false -Dgphoto2=false -Dmtp=false\
-Dafp=false -Dnfs=false -Dsftp=false -Dwsdd=false -Dburn=false
# This target doesn't work on ninja
# subversion.options = -D SVN_ENABLE_RA_SERF=0 -D SVN_ENABLE_SWIG_PERL=1
# subversion%: install_target = install-swig-pl
# Use subversion.make. Need to run "install" target first
subversion.overrides = install-swig-pl
subversion.options = --with-swig-perl --with-lz4=internal\
--with-utf8proc=internal --with-serf
# $O/$B.subversion/build.ninja: cmake-disabled
T = samba/source3
samba/source3.options = CFLAGS="-O -Wno-deprecated-declaration"
$R/samba.make.successful.log.txt: $T/Makefile $(MAKEFILE_LIST) $f
(cd $T && $(MAKE)) 2>&1 |tee -a $@.tmp.txt
mv -v $@.tmp.txt $@
4samba.n: zlib.m pkg-config.m
4samba.options = --without-gpgme --disable-python --without-winbind\
--without-ads --without-ldap --disable-cups --disable-iprint\
--without-pam --without-quotas --without-sendfile-support --without-utmp\
--disable-avahi --without-acl-support --without-dnsupdate\
--without-syslog --without-automount --without-dmapi --without-fam\
--without-libarchive --without-regedit --without-winexe\
--without-fake-kaserver --disable-glusterfs --disable-cephfs\
--disable-spotlight --without-systemd --without-ad-dc --without-json
HB = /win/hb
gnutls.includes0 = -I$(HB)/Cellar/gnutls/3.6.15/include\
-I$(HB)/Cellar/nettle/3.7.1/include\
-I$(HB)/Cellar/libtasn1/4.16.0_1/include\
-I$(HB)/Cellar/libidn2/2.3.0/include\
-I$(HB)/Cellar/p11-kit/0.23.22/include/p11-kit-1
gnutls.includes = -I$(HB)/include
# These are the options for configuring+building source3/ directory
# separately - that's not possible since version 4!
hbsamba.source3.options.common = --without-winbind\
--without-ads --without-ldap --disable-cups --disable-iprint\
--without-pam --without-quotas --without-sendfile-support --without-utmp\
--disable-avahi --without-acl-support\
--without-syslog --without-automount --without-dmapi --without-fam\
--without-libarchive --without-regedit\
--without-fake-kaserver --disable-glusterfs --disable-cephfs\
--disable-spotlight
hbsamba.source3.options = $(hbsamba.source3.options.common)\
--without-dnsupdate
hbsamba.source3.options.4.13 = $(hbsamba.source3.options) --without-winexe
hbsamba.options.4.11 = $(hbsamba.source3.options)\
--without-gpgme --disable-python\
--without-systemd --without-ad-dc --without-json
hbsamba415.options = $(hbsamba.options.4.11)
hbsamba.options = $(hbsamba.options.4.11)
samba4.options = --without-winbind --without-ads --without-ldap --disable-cups --disable-iprint --without-pam --without-quotas --without-sendfile-support --without-utmp --disable-avahi --without-acl-support --without-syslog --without-automount --without-dmapi --without-fam --without-libarchive --without-regedit --without-fake-kaserver --disable-glusterfs --disable-cephfs --disable-spotlight --without-gpgme --disable-python --without-systemd --without-ad-dc --without-json --without-ldb-lmdb --with-winexe --with-system-mitkrb5\
CFLAGS=-ZXCVBNM
samba4.dnf:
dnf install --setopt=install_weak_deps=False\
/usr/lib64/pkgconfig/gnutls.pc perl-Parse-Yapp\
mingw64-gcc-c++ /usr/include/krb5.h perl-FindBin
YAPPDIR = $S/Parse-Yapp-1.21
# hbsamba_.n: topconfdir = $S/$*/source3
wafout = $S/$*/bin
hbsamba.n: env = PERL5LIB=$(YAPPDIR)/lib
hbsamba.n hbsamba415.n: cenv = ln -sfv /usr/lib/libreadline.dylib $(wafout) &&\
PATH=$(HB)/bin:$(YAPPDIR):$(PATH)\
CPPFLAGS="$(gnutls.includes)"\
LDFLAGS="-L$(wafout)" $(env)
# If I change this to hbsamb%.n: per target vars don't work
hbsamba.n: $R/hbsamba.wafhb.successful.log.txt
@echo $^ is up to date
hbsamba415.n: env = PERL5LIB=$(YAPPDIR)/lib
hbsamba415.n: $R/hbsamba415.wafhb.successful.log.txt
@echo $^ is up to date
topconfdir = $S/$*
# $(HB)/bin to find pkg-config & it finds everything else
$S/%/bin/c4che/default_cache.py: $S/%/*/bin/waf $S/%/wscript\
$(MAKEFILE_LIST) $f
cd $S/$* && $(cenv) $< configure\
-t $(topconfdir) --prefix="$R" $($*.options)
$R/%.wafhb.successful.log.txt: $S/%/*/bin/waf $S/%/wscript\
$S/%/bin/c4che/default_cache.py $(MAKEFILE_LIST) $f
mkdir -p $(dir $@)
(cd $S/$* && $(env) caffeinate nice $< build -kvt $(topconfdir)) 2>&1 |\
tee -a $@.tmp.txt
mv $@.tmp.txt $@
$(AFSCTOOL) -cfvvv $S/$*
# ----------- debug ----------------------------
.PHONY: make.% %.make noinstall.% %.noinstall _build.% %.n %.m
vars:
@echo R = $R
@echo S = $S
@echo O = $O
@echo MAKEFLAGS = $(MAKEFLAGS)
@echo B = $B
@echo X = $X
@echo MAKE = $(MAKE)
subvars:
$(MAKE) vars
# ----------- common rules ---------------------
AFSCTOOL.Darwin = $(HERE)/afsctool/afsctool
AFSCTOOL = $(AFSCTOOL.$(platform))
COMPRESS_AND.Linux = @
COMPRESS_AND.Darwin = $(AFSCTOOL) -cfvvv $O/$B.$* &&
COMPRESS_R_AND.Linux = @
COMPRESS_R_AND.Darwin = $(AFSCTOOL) -cfvvv $R &&
COMPRESS_AND = $(COMPRESS_AND.$(platform))
COMPRESS_R_AND = $(COMPRESS_R_AND.$(platform))
$(AFSCTOOL.Darwin): $(AFSCTOOL.Darwin).c
gcc -o $@ $^
.PRECIOUS: $O/$B.%/Makefile $O/$B.%/build.ninja\
%/configure %/Makefile.in %/Makefile\
$R/%.installed.logc $R/%.make.successful.log.txt\
$O/$B.%/%.ninja.success.logc $R/%.waf.successful.log.txt\
$R/%.wafconf.successful.log.txt\
$(AFSCTOOL)
$f $(lldb.t):
echo Force=$f
noinstall.% %.noinstall %.n:
$(MAKE) $*.build_
%.build_ %.n_: $R/%.waf.successful.log.txt $(AFSCTOOL) $f
$(COMPRESS_AND) echo $^ is up to date
%.build_ %.n_: $O/$B.%/%.ninja.success.logc $(AFSCTOOL) $f
$(COMPRESS_AND) echo $^ is up to date
%.build_ %.n_ %.m_: $R/%.make.successful.log.txt $(AFSCTOOL) $f
$(COMPRESS_AND) echo $^ is up to date
%.m:
$(MAKE) $*.install_ "envvars=$(envvars)"
%.install_: $R/%.installed.logc $(AFSCTOOL) $f
$(COMPRESS_R_AND) echo $^ is up to date
# Build specifically with configure/make
%.make: $(AFSCTOOL) $(MAKEFILE_LIST) $O/$B.%/Makefile
PATH=$(tools)$(PATH) $(MAKE) $R/$*.make.successful.log.txt
$(COMPRESS_AND) echo $^ is up to date
$R/%.installed.logc: $S/%/*.gyp $(MAKEFILE_LIST) $(%.t)
(cd $* && GREP_OPTIONS= $($*.envvars)\
gyp --depth=. --format=ninja-linux &&\
ninja -vC out/Release $($*.t)) 2>&1 |tee -a $@.tmp.txt
mv -v $@.tmp.txt $@
$R/%.installed.logc: $O/$B.%/%.ninja.success.logc $(MAKEFILE_LIST)
mkdir -p $(dir $@)
(cd $O/$B.$* && PATH=$(tools)$(PATH)\
CMAKE_INSTALL_MODE=SYMLINK ninja $(install_target)) 2>&1 |\
tee $@.tmp.txt
mv -v $@.tmp.txt $@
$R/%.installed.logc: $R/%.make.successful.log.txt $(MAKEFILE_LIST) $f
mkdir -p $(dir $@)
(cd $O/$B.$* && $(MAKE) V=1 VERBOSE=1 install) 2>&1 | tee -a $@.tmp.txt
mv -v $@.tmp.txt $@
# Build dir = -o $S/$B.$* . Apparently not supported in samba
___$R/%.waf.successful.log.txt: $S/%/*/bin/waf $S/%/wscript\
$(MAKEFILE_LIST) $R/%.wafconf.successful.log.txt $S/%/Makefile $f
mkdir -p $(dir $@)
cd $S/$* && PATH=$R/bin:$(PATH) make 2>&1|\
tee $@.tmp && mv -v $@.tmp $@
# Source dir = -t $S/$*
$R/%.waf.successful.log.txt: $S/%/*/bin/waf $S/%/wscript\
$(MAKEFILE_LIST) $R/%.wafconf.successful.log.txt $f
mkdir -p $(dir $@)
cd $S/$* &&\
PATH=$R/bin:$(PATH) PYTHONHASHSEED=1 WAF_MAKE=1 $< build -v 2>&1|\
tee $@.tmp && mv -v $@.tmp $@
$R/%.wafconf.successful.log.txt: $S/%/*/bin/waf $S/%/wscript\
$(MAKEFILE_LIST) $S/%/configure $f
mkdir -p $(dir $@)
cd $S/$* &&\
PATH=$R/bin:$(PATH) CFLAGS=-O2 ./configure $($*.options)\
2>&1| tee $@.tmp && mv -v $@.tmp $@
$R/%.wafconf.successful.log.txt: $S/%/*/bin/waf $S/%/wscript\
$(MAKEFILE_LIST) $f
mkdir -p $(dir $@) $S/$B.$*
PATH=$R/bin:$(PATH) PYTHONHASHSEED=1 $< configure\
-t $S/$* --prefix="$R" $($*.options) 2>&1|\
tee $@.tmp && mv -v $@.tmp $@
$R/%.make.successful.log.txt: $O/$B.%/Makefile $(MAKEFILE_LIST) $f
mkdir -p $(dir $@)
(cd $O/$B.$* && $(MAKE) -w V=1 VERBOSE=1 $($*.overrides) --trace) 2>&1 |\
tee -a $@.tmp.txt
mv -v $@.tmp.txt $@
$O/$B.%/Makefile: $S/%/configure $(MAKEFILE_LIST) $(deps)
chmod +x $(dir $<)/configure
mkdir -p $(dir $@)
cd $(dir $@) &&\
$($*.envvars) PATH=$(tools)$R/bin:$(PATH)\
$(dir $<)/configure $(options) $(options.$(platform))\
$($*.options) $($*.options.$(platform)) --prefix="$R" 2>&1|\
tee _configure.log\
CAFF = $(shell which caffeinate)
$O/$B.%/%.ninja.success.logc: $O/$B.%/build.ninja $(AFSCTOOL)\
$(MAKEFILE_LIST) $f $(%.t)
mkdir -p $(dir $@)
(cd $O/$B.$* &&\
echo "vg: Entering directory '$$(pwd)'" &&\
PATH=$(tools)$(PATH)\
$(CAFF) nice ninja $($*.t) -d explain -vj3 ) 2>&1 |\
tee $@.tmp.txt
$(COMPRESS_AND) echo $^ is up to date
mv -v $@.tmp.txt $@
$O/$B.%/build.ninja: $S/%/meson.build $S/%/meson/meson.py\
$(MAKEFILE_LIST)
mkdir -p $O/$B.$*
cd $O/$B.$* &&\
$($*.envvars) python3 $S/$*/meson/meson.py --prefix="$R"\
$($*.options) $(options) $S/$*
$O/$B.%/build.ninja: $S/%/meson.build $(MAKEFILE_LIST) $(DISABLE_MESON)\
$f
# pkg-config --list-all
mkdir -p $O/$B.$*
# If build files are present --reconfigure is mandatory, but it's an
# error to pass that when there are none.
# TODO Change in $(options) doesn't work now
test -f $@ ||\
$($*.envvars) $(envvars)\
PATH=$(tools)$(PATH)\
CFLAGS="-I$R/include $(cflags_global) $(cflags)" python3\
$S/meson/meson.py setup\
--prefix="$R" $($*.options) $(options) $O/$B.$* $S/$* 2>&1|\
tee $O/$B.$*/meson_.log
$O/$B.%/build.ninja: $S/%/CMakeLists.txt $(MAKEFILE_LIST)
mkdir -p $O/$B.$*
@echo "vg: Entering directory '$(HERE)/$*'"
# --trace
# --debug-find-pkg=LLVM
# --debug-find
$($*.envvars) PATH=$(tools)$(PATH) CMAKE_INSTALL_MODE=SYMLINK cmake\
-DCMAKE_PREFIX_PATH="$R"\
-DCMAKE_INSTALL_PREFIX="$R"\
-DCMAKE_C_FLAGS="-I$R/include"\
-DCMAKE_CXX_FLAGS="-I$R/include"\
-DCMAKE_MODULE_PATH="$R/lib/cmake/llvm:$R/lib/cmake/clang"\
-DCMAKE_EXPORT_COMPILE_COMMANDS=YES -D BUILD_TESTING=0\
-D CMAKE_BUILD_TYPE=RelWithDebInfo -G Ninja $($*.options)\
-S $(HERE)/$* -B $O/$B.$* 2>&1| tee _cmake.log
%.makefile_in_src: %/Makefile
cd $(dir $^) && make --trace
# cd $(dir $^) && make --trace install PREFIX=$R
%/Makefile: %/configure $(MAKEFILE_LIST) $(deps)
mkdir -p $(dir $@)
cd $(dir $@) &&\
$($*.envvars) ./configure\
$($*.options) --prefix="$R" 2>&1| tee _configure.log\
%/Makefile.in: %/configure %/Makefile.am
cd $(dir $@) &&\
libtoolize -c -f &&\
automake --add-missing --copy --force-missing
%/configure: %/autogen.sh
cd $(dir $@) && NOCONFIGURE=1 bash $< 2>&1 | tee autogen.log
%/configure: %/configure.ac
cd $(dir $@) && autoreconf -iv
%/configure: %/configure.in
cd $(dir $@) && autoheader -v && aclocal --verbose && autoconf -v
clean:
rm -rfv $O/$B.* $R
13:
scl enable gcc-toolset-13 -- $(MAKE) $t vgccversion=$@