-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (30 loc) · 733 Bytes
/
Copy pathMakefile
File metadata and controls
40 lines (30 loc) · 733 Bytes
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
31
32
33
34
35
36
37
38
39
40
# Build the Rust native module and place it where the Lua loader expects it
# (lua/lockfile_native.<ext>), plus run the test suites.
CARGO ?= cargo
NVIM ?= nvim
LIB := lockfile_native
UNAME := $(shell uname -s)
ifeq ($(OS),Windows_NT)
EXT := dll
BUILT := target/release/$(LIB).dll
else ifeq ($(UNAME),Darwin)
EXT := so
BUILT := target/release/lib$(LIB).dylib
else
EXT := so
BUILT := target/release/lib$(LIB).so
endif
DEST := lua/$(LIB).$(EXT)
.PHONY: all build test test-rust test-lua clean
all: build
build:
$(CARGO) build --release
cp $(BUILT) $(DEST)
test: test-rust test-lua
test-rust:
$(CARGO) test
test-lua: build
$(NVIM) --headless --noplugin -u NONE -l tests/run.lua
clean:
$(CARGO) clean
rm -f $(DEST)