summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 21 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 28eceec..01478ad 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,26 @@
+LUA_VERSION=5.4
+DESTDIR=
+PREFIX=/usr/local
+PREFIX_EXEC=$(PREFIX)
+BINDIR=$(PREFIX_EXEC)/bin
+DATADIR=$(PREFIX)/share
+LUA_LMOD=$(DATADIR)/lua/$(LUA_VERSION)
+HEADERS_DB=$(DATADIR)/headers
+
all: test
test:
busted
-.PHONY: all test
+install:
+ install -m755 -DT headers.lua $(DESTDIR)$(BINDIR)/headers
+ install -m644 -Dt $(DESTDIR)$(LUA_LMOD)/headers headers/*.lua
+ install -m644 -Dt $(DESTDIR)$(HEADERS_DB) db/*.lua
+ sed -i 's|db/|$(HEADERS_DB)/|' $(DESTDIR)$(LUA_LMOD)/headers/default_path.lua
+
+uninstall:
+ rm -f $(DESTDIR)$(BINDIR)/headers
+ rm -rf $(DESTDIR)$(LUA_LMOD)/headers
+ rm -rf $(DESTDIR)$(HEADERS_DB)
+
+.PHONY: all test install uninstall