Skip to content

Commit a88a892

Browse files
committed
Standardize workspace: Justfile migration and A2ML directive cleanup
1 parent 8f2f785 commit a88a892

5 files changed

Lines changed: 86 additions & 124 deletions

File tree

impl/elixir/Justfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Justfile for Valence Shell Elixir NIF
3+
4+
set shell := ["bash", "-euo", "pipefail", "-c"]
5+
6+
default:
7+
@just --list --unsorted
8+
9+
all:
10+
@erlang_path="$$(erl -eval 'io:format("~s", [lists:concat([code:root_dir(), "/erts-", erlang:system_info(version), "/include"])])' -s init stop -noshell)"
11+
@erl_interface_include="$$(erl -eval 'io:format("~s", [code:lib_dir(erl_interface, include)])' -s init stop -noshell)"
12+
@erl_interface_lib="$$(erl -eval 'io:format("~s", [code:lib_dir(erl_interface, lib)])' -s init stop -noshell)"
13+
@mkdir -p priv
14+
cd ../zig && zig build -Doptimize=ReleaseFast
15+
${CC:-gcc} -fPIC -O2 -Wall -Wextra -I"$$erlang_path" -I"$$erl_interface_include" -I../zig/src -shared -fPIC \
16+
-o priv/valence_ffi.so c_src/valence_nif.c ../zig/zig-out/lib/libvalence_ffi.a -L"$$erl_interface_lib" -lei -lpthread
17+
18+
zig-lib:
19+
cd ../zig && zig build -Doptimize=ReleaseFast
20+
21+
clean:
22+
rm -rf priv
23+
rm -f c_src/*.o

impl/elixir/Makefile

Lines changed: 0 additions & 62 deletions
This file was deleted.

impl/ocaml/Justfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Justfile for Lean4 -> C -> OCaml extraction pipeline
3+
4+
set shell := ["bash", "-euo", "pipefail", "-c"]
5+
6+
lean_src := "../../proofs/lean4"
7+
lean_extraction := "Extraction"
8+
target := "liblean_vsh.so"
9+
10+
default:
11+
@just --list --unsorted
12+
13+
build-lean:
14+
@echo "Building Lean 4 extraction..."
15+
cd {{lean_src}} && lake build {{lean_extraction}}
16+
17+
build-c: build-lean
18+
@lean_prefix="$$(lean --print-prefix)"
19+
@lean_include="$$lean_prefix/include"
20+
@lean_lib="$$lean_prefix/lib/lean"
21+
gcc -shared -fPIC -o {{target}} \
22+
lean_wrapper.c \
23+
{{lean_src}}/.lake/build/ir/{{lean_extraction}}.c \
24+
-I"$$lean_include" -L"$$lean_lib" -lleanshared -Wl,-rpath,"$$lean_lib"
25+
26+
all: build-c
27+
28+
test: all
29+
@if [ -f {{target}} ]; then \
30+
echo "{{target}} exists"; \
31+
ldd {{target}} | grep lean || echo "Warning: Lean library not linked"; \
32+
else \
33+
echo "{{target}} not found"; \
34+
exit 1; \
35+
fi
36+
37+
clean:
38+
rm -f {{target}}
39+
cd {{lean_src}} && lake clean
40+
41+
install: all
42+
sudo cp {{target}} /usr/local/lib/
43+
sudo ldconfig

impl/ocaml/Makefile

Lines changed: 0 additions & 62 deletions
This file was deleted.

proofs/coq/Justfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Justfile for Valence Shell Rocq proofs
3+
4+
set shell := ["bash", "-euo", "pipefail", "-c"]
5+
6+
default:
7+
@just --list --unsorted
8+
9+
build-mk:
10+
coq_makefile -f _CoqProject -o build.mk
11+
12+
all: build-mk
13+
make -f build.mk
14+
15+
clean:
16+
@if [ -f build.mk ]; then make -f build.mk clean; fi
17+
rm -f build.mk build.mk.conf
18+
19+
install: build-mk
20+
make -f build.mk install

0 commit comments

Comments
 (0)