aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: eda16b9b5ad152c8f6abdcdad6d2489d3057f0e2 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
PROJ=sbo-maintainer-tools

# note to self: after changing this, "make version" to update all 4 scripts.
VERSION=0.9.0

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 QUICKSTART TODO pre-commit-sbolint
SCRIPTS=sbopkglint sbolint sbofixinfo

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
	gzip -9c < sbofixinfo.1 > $(DESTDIR)$(MAN1DIR)/sbofixinfo.1.gz
	gzip -9c < sbodl.1 > $(DESTDIR)$(MAN1DIR)/sbodl.1.gz

clean:
	rm -f sbopkglint.1 sbolint.1 sbofixinfo.1 sbodl.1

man: sbopkglint.1 sbolint.1 sbofixinfo.1 sbodl.1

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

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

sbofixinfo.1: sbofixinfo
	./sbofixinfo --man > sbofixinfo.1

sbodl.1: sbodl
	./sbodl --man > sbodl.1

version:
	sh update-version.sh $(VERSION)

# 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)

.PHONY: all install clean version release