fennel-ls/Makefile
Phil Hagelberg 3eeebdbf11
Build a shebanged executable instead of a binary.
This makes the build itself a lot more portable. The executable of
course relies on lua being installed on the machine, but this will
nearly always be the case for a program used by Fennel developers.

Bonus: removes the direct use of the fennel.utils module which was
only used for the table? function and was causing a warning.
2022-09-08 11:41:01 -05:00

23 lines
496 B
Makefile

FENNEL=./fennel
EXE=fennel-ls
SRC=$(wildcard src/*.fnl)
SRC+=$(wildcard src/fennel-ls/*.fnl)
.PHONY: clean test
all: $(EXE)
$(EXE): $(SRC)
echo "#!/usr/bin/env lua" > $@
LUA_PATH="./src/?.lua;./src/?/init.lua" FENNEL_PATH="./src/?.fnl;./src/?/init.fnl" \
$(FENNEL) --require-as-include --compile src/fennel-ls.fnl >> $@
chmod 755 $@
clean:
rm -f $(EXE)
test:
# requires busted to be installed
FENNEL_PATH="./src/?.fnl;./src/?/init.fnl" $(FENNEL) --correlate test/init.fnl --verbose