aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 7e5273736bee005715e3aa376f65773bd8b11ec4 (plain) (blame)
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
62
63
.POSIX:
PREFIX       = /usr/local
MANPREFIX    = $(PREFIX)/share/man
DATE         = 2021-06-25
VERSION      = 0.2.2
NAME         = git-permalink
MAILING_LIST = public-inbox
TRANSLATIONS = pt fr eo

.SUFFIXES: .in

.in:
	sed -e 's/@VERSION@/$(VERSION)/g' -e 's/@DATE@/$(DATE)/g' < $< > $@

manpages.en.in = \
	doc/git-permalink.en.1.in

manpages.in = $(manpages.en.in) \
	doc/git-permalink.pt.1.in \
	doc/git-permalink.fr.1.in \
	doc/git-permalink.eo.1.in

manpages = $(manpages.in:.in=)

all: src/git-permalink $(manpages)
	chmod +x src/git-permalink

check: all
	sh tests/cli-opts.sh
	sh tests/install-uninstall.sh
	sh tests/remotes.sh

dev-check: check public
	sh aux/assert-shellcheck.sh
	sh aux/workflow/assert-todos.sh
	sh aux/workflow/assert-changelog.sh -n $(NAME)
	sh aux/workflow/assert-readme.sh -n $(NAME) -m $(MAILING_LIST)
	sh aux/workflow/assert-manpages.sh $(NAME) $(MAILING_LIST)

install: all
	mkdir -p $(DESTDIR)$(PREFIX)/bin
	cp src/git-permalink $(DESTDIR)$(PREFIX)/bin
	sh aux/workflow/manpages.sh -ip $(DESTDIR)$(MANPREFIX) $(manpages)

uninstall:
	rm -f $(DESTDIR)$(PREFIX)/bin/$(NAME)
	sh aux/workflow/manpages.sh -up $(DESTDIR)$(MANPREFIX) $(manpages)

clean:
	rm -rf public/ src/git-permalink $(manpages)

dist:
	sh aux/workflow/dist.sh $(DATE) $(VERSION) $(NAME) $(NAME) $(MAILING_LIST)

l10n-gen:
	sh aux/workflow/l10n.sh -l '$(TRANSLATIONS)' $(manpages.en.in)

public: l10n-gen all README.md TODOs.md CHANGELOG.md
	sh aux/workflow/public.sh $(NAME) $(NAME) $(MAILING_LIST) public
	sh aux/workflow/manpages.sh -Ho public $(manpages)

spellcheck: public
	sh aux/workflow/assert-spelling.sh -l '$(TRANSLATIONS) en' $$(find public -type f -name '*.html')