aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 7351f2d4c5e15ab0932b26435239bfc3cb1f6ac7 (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
48
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 -m0755 \
		$(DESTDIR)$(TESTDIR) \
		$(DESTDIR)$(BINDIR) \
		$(DESTDIR)$(MAN1DIR) \
		$(DESTDIR)$(DOCDIR)
	install -m0755 $(SCRIPTS) $(DESTDIR)$(BINDIR)/
	sed -i 's,@PREFIX@,$(PREFIX),' $(DESTDIR)$(BINDIR)/sbopkglint
	install -m0644 sbopkglint.d/* $(DESTDIR)$(TESTDIR)/
	install -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)