aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 9ab3563f8a3a98cc3cf415f5c624146e2337303c (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
PROGRAM = using-git
PKGNAME = using-git
TEXINFO_DIR = .

PREFIX = /usr
DATA = /share

TEXIFLAGS = #--force



.PHONY: all
all:


%.gz: %
	gzip -9c < "$<" > "$@"

%.bz2: %
	bzip2 -9c < "$<" > "$@"

%.xz: %
	xz -e9 < "$<" > "$@"


.PHONY: install
install:

.PHONY: uninstall
uninstall:

.PHONY: clean
clean:
	-rn -r -- bin obj

## Texinfo manual section

.PHONY: doc
all: doc
doc: info pdf ps dvi

.PHONY: info pdf ps dvi
info: $(PROGRAM).info.gz
pdf: $(PROGRAM).pdf.gz
ps: $(PROGRAM).ps.gz
dvi: $(PROGRAM).dvi.gz

#logo.pdf: logo.svg
#        rsvg-convert --format=pdf "$<" > "$@"

#logo.eps: obj/logo.ps
#        ps2eps "$<"

#logo.ps: logo.svg
#        rsvg-convert --format=ps "$<" > "$@"

%.info: $(TEXINFO_DIR)/%.texinfo
	$(MAKEINFO) $(TEXIFLAGS) "$<"

%.pdf: $(TEXINFO_DIR)/%.texinfo
	texi2pdf $(TEXIFLAGS) "$<"

%.dvi: $(TEXINFO_DIR)/%.texinfo
	$(TEXI2DVI) $(TEXIFLAGS) "$<"

%.ps: $(TEXINFO_DIR)/%.texinfo
	texi2pdf $(TEXIFLAGS) --ps "$<"

.PHONY: install-info
install: install-info
install-info: $(PROGRAM).info.gz
	install -Dm644 "$<" -- "$(DESTDIR)$(PREFIX)$(DATA)/info/$(PKGNAME).info.gz"

.PHONY: uninstall-info
uninstall: uninstall-info
uninstall-info:
	-rm -- "$(DESTDIR)$(PREFIX)$(DATA)/info/$(PKGNAME).info.gz"

.PHONY: clean-texinfo
clean: clean-texinfo
clean-texinfo:
	-rm -- *.{info,pdf,ps,dvi}{,.gz,.bz2,.xz} 2>/dev/null
	-rm -- *.{aux,cp,cps,fn,ky,log,pg,pgs,toc,tp,vr,vrs} 2>/dev/null

## License section

.PHONY: install-license
install: install-license
install-license:
	install -d -- "$(DESTDIR)$(PREFIX)$(DATA)/licenses/$(PKGNAME)"
	install -m644 LICENSE -- "$(DESTDIR)$(PREFIX)$(DATA)/licenses/$(PKGNAME)"

.PHONY: uninstall-license
uninstall: uninstall-license
uninstall-license:
	-rm -- "$(DESTDIR)$(PREFIX)$(DATA)/licenses/$(PKGNAME)/LICENSE"
	-rmdir -- "$(DESTDIR)$(PREFIX)$(DATA)/licenses/$(PKGNAME)"