Lines Matching +full:multi +full:- +full:touch
1 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
13 CBUILD := $(shell gcc -dumpmachine)
14 HOST_ARCH := $(firstword $(subst -, ,$(CBUILD)))
19 MIRROR := https://download.wireguard.com/qemu-test/distfiles/
21 KERNEL_BUILD_PATH := $(BUILD_PATH)/kernel$(if $(findstring yes,$(DEBUG_KERNEL)),-debug)
28 $(1)_NAME := $(2)-$$($(1)_VERSION)
36 mkdir -p $(DISTFILES_PATH)
37 …-x $$@.lock -c '[ -f $$@ ] && exit 0; wget -O $$@.tmp $(MIRROR)$(1) || wget -O $$@.tmp $(2)$(1) ||…
46 … $(call tar_download,WIREGUARD_TOOLS,wireguard-tools,1.0.20210914,.tar.xz,https://git.zx2c4.com/wi…
48 export CFLAGS := -O3 -pipe
50 CFLAGS += -march=native
57 CHOST := aarch64-linux-musl
61 QEMU_VPORT_RESULT := virtio-serial-device
63 QEMU_MACHINE := -cpu host -machine virt,gic_version=host,accel=kvm
65 QEMU_MACHINE := -cpu max -machine virt
66 CFLAGS += -march=armv8-a
69 CHOST := aarch64_be-linux-musl
73 QEMU_VPORT_RESULT := virtio-serial-device
75 QEMU_MACHINE := -cpu host -machine virt,gic_version=host,accel=kvm
77 QEMU_MACHINE := -cpu max -machine virt
78 CFLAGS += -march=armv8-a
81 CHOST := arm-linux-musleabi
85 QEMU_VPORT_RESULT := virtio-serial-device
87 QEMU_MACHINE := -cpu host -machine virt,gic_version=host,accel=kvm
89 QEMU_MACHINE := -cpu max -machine virt
90 CFLAGS += -march=armv7-a -mabi=aapcs-linux
93 CHOST := armeb-linux-musleabi
97 QEMU_VPORT_RESULT := virtio-serial-device
99 QEMU_MACHINE := -cpu host -machine virt,gic_version=host,accel=kvm
101 QEMU_MACHINE := -cpu max -machine virt
102 CFLAGS += -march=armv7-a -mabi=aapcs-linux
103 LDFLAGS += -Wl,--be8
106 CHOST := x86_64-linux-musl
110 QEMU_VPORT_RESULT := virtio-serial-device
112 QEMU_MACHINE := -cpu host -machine microvm,accel=kvm,pit=off,pic=off,rtc=off,acpi=off
114 QEMU_MACHINE := -cpu max -machine microvm,acpi=off
117 CHOST := i686-linux-musl
121 QEMU_VPORT_RESULT := virtio-serial-device
123 QEMU_MACHINE := -cpu host -machine microvm,accel=kvm,pit=off,pic=off,rtc=off,acpi=off
125 QEMU_MACHINE := -cpu coreduo -machine microvm,acpi=off
128 CHOST := mips64-linux-musl
133 QEMU_MACHINE := -cpu host -machine malta,accel=kvm
134 CFLAGS += -EB
136 QEMU_MACHINE := -cpu MIPS64R2-generic -machine malta -smp 1
137 CFLAGS += -march=mips64r2 -EB
140 CHOST := mips64el-linux-musl
145 QEMU_MACHINE := -cpu host -machine malta,accel=kvm
146 CFLAGS += -EL
148 QEMU_MACHINE := -cpu MIPS64R2-generic -machine malta -smp 1
149 CFLAGS += -march=mips64r2 -EL
152 CHOST := mips-linux-musl
157 QEMU_MACHINE := -cpu host -machine malta,accel=kvm
158 CFLAGS += -EB
160 QEMU_MACHINE := -cpu 24Kf -machine malta -smp 1
161 CFLAGS += -march=mips32r2 -EB
164 CHOST := mipsel-linux-musl
169 QEMU_MACHINE := -cpu host -machine malta,accel=kvm
170 CFLAGS += -EL
172 QEMU_MACHINE := -cpu 24Kf -machine malta -smp 1
173 CFLAGS += -march=mips32r2 -EL
176 CHOST := powerpc64-linux-musl
181 QEMU_MACHINE := -cpu host,accel=kvm -machine pseries
183 QEMU_MACHINE := -machine pseries -device spapr-rng,rng=rng -object rng-random,id=rng
186 CHOST := powerpc64le-linux-musl
191 QEMU_MACHINE := -cpu host,accel=kvm -machine pseries
193 QEMU_MACHINE := -machine pseries -device spapr-rng,rng=rng -object rng-random,id=rng
196 CHOST := powerpc-linux-musl
201 QEMU_MACHINE := -cpu host,accel=kvm -machine ppce500
203 QEMU_MACHINE := -machine ppce500
206 CHOST := m68k-linux-musl
210 KERNEL_CMDLINE := $(shell sed -n 's/CONFIG_CMDLINE=\(.*\)/\1/p' arch/m68k.config)
211 QEMU_VPORT_RESULT := virtio-serial-device
213 QEMU_MACHINE := -cpu host,accel=kvm -machine virt -append $(KERNEL_CMDLINE)
215 QEMU_MACHINE := -machine virt -smp 1 -append $(KERNEL_CMDLINE)
218 CHOST := riscv64-linux-musl
222 QEMU_VPORT_RESULT := virtio-serial-device
224 QEMU_MACHINE := -cpu host,accel=kvm -machine virt
226 QEMU_MACHINE := -cpu rv64 -machine virt
229 CHOST := riscv32-linux-musl
233 QEMU_VPORT_RESULT := virtio-serial-device
235 QEMU_MACHINE := -cpu host,accel=kvm -machine virt
237 QEMU_MACHINE := -cpu rv32 -machine virt
240 CHOST := s390x-linux-musl
244 KERNEL_CMDLINE := $(shell sed -n 's/CONFIG_CMDLINE=\(.*\)/\1/p' arch/s390x.config)
245 QEMU_VPORT_RESULT := virtio-serial-ccw
247 QEMU_MACHINE := -cpu host,accel=kvm -machine s390-ccw-virtio -append $(KERNEL_CMDLINE)
249 QEMU_MACHINE := -cpu max -machine s390-ccw-virtio -append $(KERNEL_CMDLINE)
252 CHOST := $(HOST_ARCH)-linux-musl
255 KERNEL_CMDLINE := $(shell sed -n 's/CONFIG_CMDLINE=\(.*\)/\1/p' arch/um.config)
260 TOOLCHAIN_FILENAME := $(CHOST)-cross.tgz
262 TOOLCHAIN_PATH := $(BUILD_PATH)/$(CHOST)-cross
263 TOOLCHAIN_DIR := https://download.wireguard.com/qemu-test/toolchains/20211123/
264 $(eval $(call file_download,toolchain-sha256sums-20211123,$(TOOLCHAIN_DIR)SHA256SUMS#,83da033fd8c79…
265 …_download,$(TOOLCHAIN_FILENAME),$(TOOLCHAIN_DIR),,$(DISTFILES_PATH)/toolchain-sha256sums-20211123))
267 STRIP := $(CHOST)-strip
268 CROSS_COMPILE_FLAG := --build=$(CBUILD) --host=$(CHOST)
271 export CROSS_COMPILE := $(CHOST)-
274 export CC := $(CHOST)-gcc
288 rm -f $(BUILD_PATH)/result
290 timeout --foreground 20m qemu-system-$(QEMU_ARCH) \
291 -nodefaults \
292 -nographic \
293 -smp $(NR_CPUS) \
295 -m $$(grep -q CONFIG_DEBUG_KMEMLEAK=y $(KERNEL_BUILD_PATH)/.config && echo 1G || echo 256M) \
296 -serial stdio \
297 -chardev file,path=$(BUILD_PATH)/result,id=result \
298 …$(if $(QEMU_VPORT_RESULT),-device $(QEMU_VPORT_RESULT) -device virtserialport$(comma)chardev=resul…
299 -no-reboot \
300 -monitor none \
301 -kernel $<
303 timeout --foreground 20m $< \
305 mem=$$(grep -q CONFIG_DEBUG_KMEMLEAK=y $(KERNEL_BUILD_PATH)/.config && echo 1G || echo 256M) \
309 grep -Fq success $(BUILD_PATH)/result
311 $(BUILD_PATH)/init-cpio-spec.txt: $(TOOLCHAIN_PATH)/.installed $(BUILD_PATH)/init
312 mkdir -p $(BUILD_PATH)
325 echo "file /bin/xtables-legacy-multi $(IPTABLES_PATH)/iptables/xtables-legacy-multi 755 0 0" >> $@
326 echo "slink /bin/iptables xtables-legacy-multi 777 0 0" >> $@
330 …echo "slink $$($(CHOST)-readelf -p .interp '$(BUILD_PATH)/init'| grep -o '/lib/.*') libc.so 777 0 …
333 mkdir -p $(KERNEL_BUILD_PATH)
335 …printf 'CONFIG_NR_CPUS=$(NR_CPUS)\nCONFIG_INITRAMFS_SOURCE="$(BUILD_PATH)/init-cpio-spec.txt"\n' >…
337 $(MAKE) -C $(KERNEL_PATH) O=$(KERNEL_BUILD_PATH) ARCH=$(KERNEL_ARCH) allnoconfig
338 …cd $(KERNEL_BUILD_PATH) && ARCH=$(KERNEL_ARCH) $(KERNEL_PATH)/scripts/kconfig/merge_config.sh -n $…
339 …PATH) && ARCH=$(KERNEL_ARCH) $(KERNEL_PATH)/scripts/kconfig/merge_config.sh -n $(KERNEL_BUILD_PATH…
341 …-cpio-spec.txt $(IPERF_PATH)/src/iperf3 $(IPUTILS_PATH)/ping $(BASH_PATH)/bash $(IPROUTE2_PATH)/mi…
342 $(MAKE) -C $(KERNEL_PATH) O=$(KERNEL_BUILD_PATH) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(CROSS_COMPILE)
347 rm -rf $(TOOLCHAIN_PATH)/$(CHOST)/include/linux
348 …$(MAKE) -C $(KERNEL_PATH) O=$(KERNEL_BUILD_PATH) INSTALL_HDR_PATH=$(TOOLCHAIN_PATH)/$(CHOST) ARCH=…
350 touch $@
353 mkdir -p $(BUILD_PATH)
354 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
355 $(STRIP) -s $(TOOLCHAIN_PATH)/$(CHOST)/lib/libc.so
357 mkdir -p $(TOOLCHAIN_PATH)/bin/ccache
358 ln -s $(CCACHE_PATH) $(TOOLCHAIN_PATH)/bin/ccache/$(CC)
360 touch $@
363 mkdir -p $(BUILD_PATH)
364 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
365 sed -i '1s/^/#include <stdint.h>/' $(IPERF_PATH)/src/cjson.h $(IPERF_PATH)/src/timer.h
366 sed -i -r 's/-p?g//g' $(IPERF_PATH)/src/Makefile*
367 touch $@
370 cd $(IPERF_PATH) && autoreconf -fi
371 …ATH) && CFLAGS="$(CFLAGS) -D_GNU_SOURCE" ./configure --prefix=/ $(CROSS_COMPILE_FLAG) --enable-sta…
372 $(MAKE) -C $(IPERF_PATH)
373 $(STRIP) -s $@
376 mkdir -p $(BUILD_PATH)
377 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
378 touch $@
381 $(MAKE) -C $(WIREGUARD_TOOLS_PATH)/src wg
382 $(STRIP) -s $@
385 mkdir -p $(BUILD_PATH)
386 $(CC) -o $@ $(CFLAGS) $(LDFLAGS) -std=gnu11 $<
387 $(STRIP) -s $@
390 mkdir -p $(BUILD_PATH)
391 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
392 touch $@
395 sed -i /atexit/d $(IPUTILS_PATH)/ping.c
396 …H) && $(CC) $(CFLAGS) -std=c99 -o $@ ping.c ping_common.c ping6_common.c iputils_common.c -D_GNU_S…
397 $(STRIP) -s $@
400 mkdir -p $(BUILD_PATH)
401 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
402 touch $@
405 …--prefix=/ $(CROSS_COMPILE_FLAG) --without-bash-malloc --disable-debugger --disable-help-builtin -…
406 $(MAKE) -C $(BASH_PATH)
407 $(STRIP) -s $@
410 mkdir -p $(BUILD_PATH)
411 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
412 …-config\nTC_CONFIG_XT:=n\nTC_CONFIG_ATM:=n\nTC_CONFIG_IPSET:=n\nIP_CONFIG_SETNS:=y\nHAVE_ELF:=n\nH…
413 …done:\n\tflock -x $$@.lock $$(MAKE) -C lib\n\ttouch $$@\nip/ip: libutil.a.done\n\t$$(MAKE) -C ip i…
414 touch $@
417 $(MAKE) -C $(IPROUTE2_PATH) PREFIX=/ ip/ip
418 $(STRIP) -s $@
421 $(MAKE) -C $(IPROUTE2_PATH) PREFIX=/ misc/ss
422 $(STRIP) -s $@
425 mkdir -p $(BUILD_PATH)
426 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
427 …sed -i -e "/nfnetlink=[01]/s:=[01]:=0:" -e "/nfconntrack=[01]/s:=[01]:=0:" $(IPTABLES_PATH)/config…
428 touch $@
430 $(IPTABLES_PATH)/iptables/xtables-legacy-multi: | $(IPTABLES_PATH)/.installed $(USERSPACE_DEPS)
431 …--prefix=/ $(CROSS_COMPILE_FLAG) --enable-static --disable-shared --disable-nftables --disable-bpf…
432 $(MAKE) -C $(IPTABLES_PATH)
433 $(STRIP) -s $@
436 mkdir -p $(BUILD_PATH)
437 flock -s $<.lock tar -C $(BUILD_PATH) -xf $<
438 touch $@
441 …--prefix=/ $(CROSS_COMPILE_FLAG) --enable-static --disable-shared --without-ndiff --without-zenmap…
442 $(MAKE) -C $(NMAP_PATH)/libpcap
443 $(MAKE) -C $(NMAP_PATH)/ncat
444 $(STRIP) -s $@
447 rm -rf $(BUILD_PATH)
450 rm -rf $(DISTFILES_PATH)
454 rm -rf $(CCACHE_DIR)
458 …$(MAKE) -C $(KERNEL_PATH) O=$(KERNEL_BUILD_PATH) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(CROSS_COMPILE…