2012-10-29 01:14:03 +01:00
|
|
|
LUA= $(shell echo `which lua`)
|
|
|
|
LUA_BINDIR= $(shell echo `dirname $(LUA)`)
|
|
|
|
LUA_PREFIX= $(shell echo `dirname $(LUA_BINDIR)`)
|
|
|
|
LUA_SHAREDIR=$(LUA_PREFIX)/share/lua/5.1
|
|
|
|
|
2020-09-30 20:22:07 +02:00
|
|
|
_REPODIR != cd "$(shell dirname $(firstword $(MAKEFILE_LIST)))/" && pwd
|
|
|
|
|
2012-10-29 01:14:03 +01:00
|
|
|
ldoc:
|
|
|
|
|
|
|
|
install: install_parts
|
2017-08-10 21:36:00 +02:00
|
|
|
@echo "lua $(LUA_SHAREDIR)/ldoc.lua \$$*" > "$(DESTDIR)$(LUA_BINDIR)/ldoc"
|
|
|
|
@chmod -v +x "$(DESTDIR)$(LUA_BINDIR)/ldoc"
|
2012-10-29 01:14:03 +01:00
|
|
|
|
|
|
|
install_luajit: install_parts
|
2017-08-10 21:36:00 +02:00
|
|
|
@echo "luajit $(LUA_SHAREDIR)/ldoc.lua \$$*" > "$(DESTDIR)$(LUA_BINDIR)/ldoc"
|
|
|
|
@chmod -v +x "$(DESTDIR)$(LUA_BINDIR)/ldoc"
|
2012-10-29 01:14:03 +01:00
|
|
|
|
|
|
|
install_parts:
|
2017-08-10 21:36:41 +02:00
|
|
|
@if [ ! -d "$(DESTDIR)$(LUA_BINDIR)" ]; then \
|
|
|
|
mkdir -vp "$(DESTDIR)$(LUA_BINDIR)"; \
|
|
|
|
fi
|
2017-08-10 21:36:00 +02:00
|
|
|
@mkdir -vp "$(DESTDIR)$(LUA_SHAREDIR)"
|
|
|
|
@cp -v ldoc.lua "$(DESTDIR)$(LUA_SHAREDIR)"
|
|
|
|
@cp -vr ldoc "$(DESTDIR)$(LUA_SHAREDIR)"
|
2012-10-29 01:14:03 +01:00
|
|
|
|
2012-11-07 17:42:16 +01:00
|
|
|
uninstall:
|
2017-08-10 21:36:00 +02:00
|
|
|
@-rm -v "$(DESTDIR)$(LUA_SHAREDIR)/ldoc.lua"
|
|
|
|
@-rm -vr "$(DESTDIR)$(LUA_SHAREDIR)/ldoc"
|
|
|
|
@-rm -v "$(DESTDIR)$(LUA_BINDIR)/ldoc"
|
2012-11-07 17:42:16 +01:00
|
|
|
|
2012-11-11 17:50:33 +01:00
|
|
|
test: test-basic test-example test-md test-tables
|
2012-11-07 17:42:16 +01:00
|
|
|
|
2020-09-30 20:22:07 +02:00
|
|
|
RUN=&& lua $(_REPODIR)/ldoc.lua . && diff -r docs cdocs && echo ok
|
2012-11-07 17:42:16 +01:00
|
|
|
|
2020-09-30 20:41:56 +02:00
|
|
|
test-prep:
|
|
|
|
find -type d -name doc -execdir rsync -av --del {}/ cdocs/ \;
|
|
|
|
|
2012-11-07 17:42:16 +01:00
|
|
|
test-basic:
|
|
|
|
cd tests $(RUN)
|
|
|
|
|
|
|
|
test-example:
|
2020-09-30 20:41:56 +02:00
|
|
|
cd tests/example $(RUN)
|
2012-11-07 17:42:16 +01:00
|
|
|
|
|
|
|
test-md:
|
2020-09-30 20:41:56 +02:00
|
|
|
cd tests/md-test $(RUN)
|
2012-11-11 17:50:33 +01:00
|
|
|
|
|
|
|
test-tables:
|
2020-09-30 20:41:56 +02:00
|
|
|
cd tests/simple $(RUN)
|
2012-12-29 11:09:34 +01:00
|
|
|
|
|
|
|
test-clean: clean-basic clean-example clean-md clean-tables
|
|
|
|
|
2020-09-30 20:22:07 +02:00
|
|
|
CLEAN=&& lua $(_REPODIR)/ldoc.lua . && rd /S /Q cdocs && cp -rf docs cdocs
|
2012-12-29 11:09:34 +01:00
|
|
|
|
|
|
|
clean-basic:
|
|
|
|
cd tests $(CLEAN)
|
|
|
|
|
|
|
|
clean-example:
|
|
|
|
cd tests && cd example $(CLEAN)
|
|
|
|
|
|
|
|
clean-md:
|
|
|
|
cd tests && cd md-test $(CLEAN)
|
|
|
|
|
|
|
|
clean-tables:
|
|
|
|
cd tests && cd simple $(CLEAN)
|