Skip to content

Commit d11d861

Browse files
committed
chore: Update readme
1 parent 4b13a91 commit d11d861

6 files changed

Lines changed: 447 additions & 365 deletions

File tree

Makefile

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,50 @@
11
PLENARY_DIR ?= ../plenary.nvim
22

3-
.PHONY: build test test-rust test-lua test-version test-bun test-node prepare-bun prepare-node set-npm-version header
3+
PREFIX ?= /usr/local
4+
LIBDIR ?= $(PREFIX)/lib
5+
INCLUDEDIR ?= $(PREFIX)/include
6+
7+
.PHONY: build build-c-lib install uninstall test test-rust test-lua test-version test-bun test-node prepare-bun prepare-node set-npm-version header
48

59
all: format test lint
610

711
build:
812
cargo build --release --features zlob
913

14+
build-c-lib:
15+
cargo build --release -p fff-c --features zlob
16+
1017
header:
1118
cbindgen --config crates/fff-c/cbindgen.toml --crate fff-c --output crates/fff-c/include/fff.h
1219

20+
# Install the C library and header under $(PREFIX) (default /usr/local).
21+
# Override PREFIX for user-local installs, e.g. `make install PREFIX=$$HOME/.local`.
22+
# DESTDIR is honoured for packagers.
23+
install: build-c-lib
24+
install -d $(DESTDIR)$(LIBDIR)
25+
install -d $(DESTDIR)$(INCLUDEDIR)
26+
install -m 0644 crates/fff-c/include/fff.h $(DESTDIR)$(INCLUDEDIR)/fff.h
27+
@if [ -f target/release/libfff_c.dylib ]; then \
28+
install -m 0755 target/release/libfff_c.dylib $(DESTDIR)$(LIBDIR)/libfff_c.dylib; \
29+
echo "Installed $(DESTDIR)$(LIBDIR)/libfff_c.dylib"; \
30+
fi
31+
@if [ -f target/release/libfff_c.so ]; then \
32+
install -m 0755 target/release/libfff_c.so $(DESTDIR)$(LIBDIR)/libfff_c.so; \
33+
echo "Installed $(DESTDIR)$(LIBDIR)/libfff_c.so"; \
34+
fi
35+
@if [ -f target/release/fff_c.dll ]; then \
36+
install -m 0755 target/release/fff_c.dll $(DESTDIR)$(LIBDIR)/fff_c.dll; \
37+
echo "Installed $(DESTDIR)$(LIBDIR)/fff_c.dll"; \
38+
fi
39+
@echo "Installed header $(DESTDIR)$(INCLUDEDIR)/fff.h"
40+
41+
uninstall:
42+
rm -f $(DESTDIR)$(LIBDIR)/libfff_c.dylib
43+
rm -f $(DESTDIR)$(LIBDIR)/libfff_c.so
44+
rm -f $(DESTDIR)$(LIBDIR)/fff_c.dll
45+
rm -f $(DESTDIR)$(INCLUDEDIR)/fff.h
46+
@echo "Removed fff-c from $(DESTDIR)$(PREFIX)"
47+
1348
test-setup:
1449
@if [ ! -d "$(PLENARY_DIR)" ]; then \
1550
echo "Cloning plenary.nvim..."; \

0 commit comments

Comments
 (0)