summaryrefslogtreecommitdiff
path: root/example-cross-compile/Makefile
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2024-07-05 00:20:22 +0200
committerJohannes Stoelp <johannes.stoelp@gmail.com>2024-07-05 00:20:22 +0200
commitb07a942993efe44e5dbdff8088b0ed87c79fc433 (patch)
treed526b4fef64627162f75ef72677cac1987625fa1 /example-cross-compile/Makefile
parent898b1c827293c8ae87642be75703c3a0eb99bf22 (diff)
downloadzig-playground-b07a942993efe44e5dbdff8088b0ed87c79fc433.tar.gz
zig-playground-b07a942993efe44e5dbdff8088b0ed87c79fc433.zip
cross: mini zig cross compile
Diffstat (limited to 'example-cross-compile/Makefile')
-rw-r--r--example-cross-compile/Makefile17
1 files changed, 17 insertions, 0 deletions
diff --git a/example-cross-compile/Makefile b/example-cross-compile/Makefile
new file mode 100644
index 0000000..72f611d
--- /dev/null
+++ b/example-cross-compile/Makefile
@@ -0,0 +1,17 @@
+riscv64: lin-riscv64
+aarch64: lin-aarch64
+mips64el: lin-mips64el
+
+lin-%:
+ zig build-exe lin.zig -target $*-linux-musl --name $*.elf
+ file $*.elf
+ qemu-$* $*.elf
+
+win:
+ zig build-exe win.zig -target x86_64-windows -lc
+ file win.exe
+ wine win.exe
+
+clean:
+ git clean -fdx .
+