aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: baa5ab82ec77da6f49adda2fde342500edbfa28f (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
PROJ=sbo-maintainer-tools

# for now, VERSION has to be updated here and also in both scripts.
VERSION=0.5

PREFIX=/usr/local
DESTDIR=

SHAREDIR=$(PREFIX)/share
TESTDIR=$(SHAREDIR)/$(PROJ)/sbopkglint.d
BINDIR=$(PREFIX)/bin
MANDIR=$(PREFIX)/man
MAN1DIR=$(MANDIR)/man1
DOCDIR=$(PREFIX)/doc/$(PROJ)-$(VERSION)

DOCS=README
SCRIPTS=sbopkglint sbolint

all:
	@echo "Use 'make install PREFIX=<path>' to install $(PROJ)."

install: man
	install -d -oroot -groot -m0755 \
		$(DESTDIR)$(TESTDIR) \
		$(DESTDIR)$(BINDIR) \
		$(DESTDIR)$(MAN1DIR) \
		$(DESTDIR)$(DOCDIR)
	install -oroot -groot -m0755 $(SCRIPTS) $(DESTDIR)$(BINDIR)/
	install -oroot -groot -m0644 sbopkglint.d/* $(DESTDIR)$(TESTDIR)/
	install -oroot -groot -m0644 $(DOCS) $(DESTDIR)$(DOCDIR)/
	gzip -9c < sbolint.1 > $(DESTDIR)$(MAN1DIR)/sbolint.1.gz
	gzip -9c < sbopkglint.1 > $(DESTDIR)$(MAN1DIR)/sbopkglint.1.gz

clean:
	rm -f sbopkglint.1 sbolint.1

man: sbopkglint.1 sbolint.1

sbolint.1: sbolint
	./sbolint --man > sbolint.1

sbopkglint.1: sbopkglint
	./sbopkglint --man > sbopkglint.1

# this requires VERSION in this Makefile to be set to the latest git tag.
release: clean
	git archive -o $(PROJ)-$(VERSION).tar.gz --prefix=$(PROJ)-$(VERSION)/ $(VERSION)