2
2
3
3
PROFILE ?= release
4
4
5
+ .PHONY : default
6
+ default : install-lua
7
+
8
+ .PHONY : install
9
+ install : install-lua
10
+
5
11
.PHONY : all
6
- all : all-rust links
12
+ all : install-all
13
+
14
+ .PHONY : install-all
15
+ install-all : install-lua install-python
7
16
8
17
.PHONY : all-rust
9
- all-rust : lua_lib python_lib
18
+ all-rust : lib-lua lib-python
10
19
20
+ RUST_SOURCES = Cargo.lock src/lib.rs
11
21
CARGO_FLAGS = $(and $(PROFILE:debug= ) ,--$(PROFILE ) )
12
22
13
- .PHONY : lua_lib
14
- lua_lib : target-lua/$(PROFILE ) /libvim_commonmark.so
23
+ .PHONY : lib-lua
24
+ lib-lua : target-lua/$(PROFILE ) /libvim_commonmark.so
15
25
16
- RUST_SOURCES = Cargo.lock $(wildcard src/* .rs)
17
-
18
- target-lua/$(PROFILE ) /libvim_commonmark.so : $(RUST_SOURCES )
26
+ target-lua/$(PROFILE ) /libvim_commonmark.so : $(RUST_SOURCES ) src/lua.rs
19
27
export LUA_INC=/usr/include/luajit-2.0/
20
28
export LUA_LIB=/usr/lib LUA_LIB_NAME=luajit-5.1
21
29
export LUA_LINK=dynamic
22
30
cargo build --no-default-features --features lua --target-dir target-lua $(CARGO_FLAGS )
23
31
24
- .PHONY : python_lib
25
- python_lib : target-python/$(PROFILE ) /libvim_commonmark.so
32
+ .PHONY : lib-python
33
+ lib-python : target-python/$(PROFILE ) /libvim_commonmark.so
26
34
27
- target-python/$(PROFILE ) /libvim_commonmark.so : $(RUST_SOURCES )
35
+ target-python/$(PROFILE ) /libvim_commonmark.so : $(RUST_SOURCES ) src/python.rs
28
36
cargo build --no-default-features --features python --target-dir target-python $(CARGO_FLAGS )
29
37
30
- .PHONY : links
31
- links : lua/libvim_commonmark.so python3 /libvim_commonmark.so
38
+ .PHONY : install-lua
39
+ install-lua : lua/libvim_commonmark.so
32
40
33
41
lua/libvim_commonmark.so : target-lua/$(PROFILE ) /libvim_commonmark.so
34
42
mkdir -p $(@D )
35
43
ln -sf ../$< $@
36
44
45
+ .PHONY : install-python
46
+ install-python : python3/libvim_commonmark.so
47
+
37
48
python3/libvim_commonmark.so : target-python/$(PROFILE ) /libvim_commonmark.so
38
49
mkdir -p $(@D )
39
50
ln -sf ../$< $@
@@ -47,4 +58,3 @@ test-rust:
47
58
export LUA_LIB=/usr/lib LUA_LIB_NAME=luajit-5.1
48
59
export LUA_LINK=dynamic
49
60
cargo test --no-default-features --features lua --target-dir target-lua $(CARGO_FLAGS )
50
-
0 commit comments