~technomancy/antifennel

73b4327711fd32de634243f43a07bceaa6ab2b04 — Phil Hagelberg 10 months ago dec2ce9
Add install target to makefile.
2 files changed, 13 insertions(+), 8 deletions(-)

M Makefile
M README.md
M Makefile => Makefile +9 -3
@@ 1,3 1,8 @@
LUA ?= luajit
DESTDIR ?=
PREFIX ?= /usr/local
BIN_DIR ?= $(PREFIX)/bin

PARSER_LUA=lang/reader.lua \
		lang/operator.lua \
		lang/id_generator.lua \


@@ 12,8 17,6 @@ PARSER_FENNEL=lang/reader.fnl \
		lang/lexer.fnl \
		lang/parser.fnl

LUA ?= luajit

antifennel: antifennel.fnl anticompiler.fnl letter.fnl $(PARSER_FENNEL)
	echo "#!/usr/bin/env $(LUA)" > $@
	$(LUA) ./fennel --skip-include ffi --require-as-include --compile $< >> $@


@@ 64,4 67,7 @@ ci: test count

count: ; cloc $(PARSER_FENNEL) anticompiler.fnl antifennel.lua

.PHONY: test self clean ci update update-fennel update-tests
install: antifennel
	mkdir -p $(DESTDIR)$(BIN_DIR) && cp $< $(DESTDIR)$(BIN_DIR)/

.PHONY: test self clean ci update update-fennel update-tests install

M README.md => README.md +4 -5
@@ 10,12 10,11 @@ see it in action on Fennel's web site without installing anything.

The only prerequisites are having Lua and GNU Make installed.

    $ make
    $ ./antifennel targetfile.lua > targetfile.fnl
    $ make && sudo make install # system-wide in /usr/local/bin
    $ make install PREFIX=$HOME # user-level in ~/bin
    $ antifennel targetfile.lua > targetfile.fnl

The `antifennel` script is self-contained and can be moved or
symlinked onto your `$PATH`; all it requires to run is Lua. It will
default to using `luajit` but you can run `make LUA=lua5.4` to
It will default to using `luajit` but you can run `make LUA=lua5.4` to
override the Lua implementation.

Pass in the `--comments` flag to enable limited support for comments.