-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathjustfile
30 lines (24 loc) · 945 Bytes
/
justfile
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
build-command := "zig build-lib zf/src/clib.zig -O ReleaseSafe -dynamic"
# library filenames
linux := "libzf-linux-x64"
linux-arm := "libzf-linux-arm64"
macos := "libzf-osx-x64"
macos-arm := "libzf-osx-arm64"
windows := "libzf-windows-x64"
_list:
@just --list
# remove all shared libraries
clean:
rm -f lib/*
# build ./lib/libzf.so for the native architecture
build:
{{build-command}} -femit-bin=lib/libzf.so
# build libzf for all supported targets for distribution
build-all:
{{build-command}} -target x86_64-linux -femit-bin=lib/{{linux}}.so
{{build-command}} -target aarch64-linux -femit-bin=lib/{{linux-arm}}.so
{{build-command}} -target x86_64-macos -femit-bin=lib/{{macos}}.so
{{build-command}} -target aarch64-macos -femit-bin=lib/{{macos-arm}}.so
{{build-command}} -target x86_64-windows -femit-bin=lib/{{windows}}.dll
@# Remove windows files that aren't needed
rm lib/*.pdb lib/*.lib