From 962f29ba59b3b064d2e6e4d6274f4b4ff09a6412 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Fri, 5 Jul 2024 00:26:27 +0200 Subject: cross: mini cpp cross compile using zig compiler --- example-cross-compile-cpp/Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 example-cross-compile-cpp/Makefile (limited to 'example-cross-compile-cpp/Makefile') diff --git a/example-cross-compile-cpp/Makefile b/example-cross-compile-cpp/Makefile new file mode 100644 index 0000000..6c7f234 --- /dev/null +++ b/example-cross-compile-cpp/Makefile @@ -0,0 +1,18 @@ +riscv64: lin-riscv64 +aarch64: lin-aarch64 +mips64el: lin-mips64el + +lin-%: + zig build-exe lin.cc -target $*-linux-musl -lc --name $*.elf + file $*.elf + qemu-$* $*.elf + +win: + zig build-lib -dynamic -target x86_64-windows -lc windll.cc + zig build-exe win.cc -target x86_64-windows -lc windll.lib + file win.exe windll.dll + wine win.exe + +clean: + git clean -fdx . + -- cgit v1.2.3