fennel-ls/Makefile
Phil Hagelberg 4a121f70b0 Add selfcheck make target.
Also cleans up repeated path options in the makefile, and cleans up
warnings where fennel-ls warns on itself.

There were some unused functions; I just put a _ before their name but
that might be a bit silly. Maybe they should be removed? Or just left alone?
2023-11-26 10:41:21 -08:00

44 lines
840 B
Makefile

LUA ?= lua
FENNEL=$(LUA) fennel
EXE=fennel-ls
SRC=$(wildcard src/*.fnl)
SRC+=$(wildcard src/fennel-ls/*.fnl)
SRC+=$(wildcard src/fennel-ls/doc/*.fnl)
DESTDIR ?=
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
OPTS=--add-package-path "./src/?.lua" --add-fennel-path "./src/?.fnl"
.PHONY: clean test install ci selfcheck
all: $(EXE)
$(EXE): $(SRC)
echo "#!/usr/bin/env $(LUA)" > $@
$(FENNEL) $(OPTS) --require-as-include --compile src/fennel-ls.fnl >> $@
chmod 755 $@
clean:
rm -f $(EXE)
test:
TESTING=1 $(FENNEL) $(OPTS) test/init.fnl
testall:
$(MAKE) test LUA=lua5.1
$(MAKE) test LUA=lua5.2
$(MAKE) test LUA=lua5.3
$(MAKE) test LUA=lua5.4
$(MAKE) test LUA=luajit
install: $(EXE)
mkdir -p $(DESTDIR)$(BINDIR) && cp $< $(DESTDIR)$(BINDIR)/
ci: testall $(EXE)
selfcheck:
$(FENNEL) $(OPTS) src/fennel-ls.fnl --check $(SRC)