summaryrefslogtreecommitdiff
path: root/Makefile
blob: ba3daaa3a46cf8298342bd4aa1edb696e3497454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
MANDIR=$(DATADIR)/man
MAN1DIR=$(MANDIR)/man1

all: test

test:
	busted

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
	install -m644 -DT headers.1.in $(DESTDIR)$(MAN1DIR)/headers.1
	sed -i 's|db/|$(HEADERS_DB)/|' $(DESTDIR)$(LUA_LMOD)/headers/default_path.lua
	sed -i 's|@HEADERS_DB@|$(HEADERS_DB)|' $(DESTDIR)$(MAN1DIR)/headers.1

uninstall:
	rm -f $(DESTDIR)$(BINDIR)/headers
	rm -rf $(DESTDIR)$(LUA_LMOD)/headers
	rm -rf $(DESTDIR)$(HEADERS_DB)

.PHONY: all test install uninstall