Add a make install target, and instructions for Emacs.

Might be nice to be able to run make install as this is pretty
standard. For people who don't like sudo, they can set $PREFIX to a
user-writable location of their choice.
This commit is contained in:
Phil Hagelberg 2023-02-13 21:10:35 -08:00 committed by XeroOl
parent 2eb99a7283
commit f4298b02be
2 changed files with 17 additions and 2 deletions

View File

@ -4,7 +4,11 @@ EXE=fennel-ls
SRC=$(wildcard src/*.fnl)
SRC+=$(wildcard src/fennel-ls/*.fnl)
.PHONY: clean test
DESTDIR ?=
PREFIX ?= /usr/local
BIN_DIR ?= $(PREFIX)/bin
.PHONY: clean test install
all: $(EXE)
@ -20,3 +24,6 @@ clean:
test:
# requires busted to be installed
FENNEL_PATH="./src/?.fnl;./src/?/init.fnl" $(FENNEL) --correlate test/init.fnl --verbose
install: $(EXE)
mkdir -p $(DESTDIR)$(BIN_DIR) && cp $< $(DESTDIR)$(BIN_DIR)/

View File

@ -90,7 +90,8 @@ You can match my environment to develop with the following steps.
1. Build the binary
```sh
make
make && sudo make install # to install into /usr/local/bin
make install PREFIX=$HOME # if you have ~/bin on your $PATH
```
2. Configure your editor to use this language server
@ -117,6 +118,13 @@ lspconfig["fennel-ls"].setup(
)
```
For Emacs, (eglot, built-in to 29+) put this in your config:
```lisp
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs '(fennel-mode . ("fennel-ls"))))
```
It should be possible to set up for other clients, but I haven't looked into these steps. If you get it working in any other environments, I'd love to know! It would be great to have instructions on how to set up other editors!
## Caveats