]> git.ipfire.org Git - thirdparty/man-pages.git/blob - Makefile
Makefile: Remove line continuation at end of "install" recipe
[thirdparty/man-pages.git] / Makefile
1 # Do "make screen" first, if you want to protect already installed,
2 # more up-to-date manual pages than the ones included in this package.
3 # Do "make install" to copy the pages to their destination.
4 # Do "make gz" or "make bz2" first if you use compressed source pages.
5
6 DESTDIR=
7 prefix?=/usr
8 MANDIR=$(prefix)/share/man
9
10 GZIP=gzip -9
11 BZIP2=bzip2 -9
12 LZMA=xz -9
13
14 all: screen remove install
15
16 allgz: gz all
17
18 allbz: bz2 all
19
20 allxz: xz all
21
22 screen:
23 mkdir -p not_installed
24 for i in man?/*; do \
25 if [ $(MANDIR)/"$$i" -nt "$$i" ]; then \
26 cmp -s $(MANDIR)/"$$i" "$$i" > /dev/null 2>&1; \
27 if [ "$$?" != 0 ]; then mv "$$i" not_installed; fi; \
28 fi; \
29 done
30
31 uninstall remove:
32 for i in man?/*; do \
33 rm -f $(MANDIR)/"$$i" $(MANDIR)/"$$i".gz $(MANDIR)/"$$i".bz2; \
34 done
35
36 gz:
37 for i in man?; do $(GZIP) "$$i"/*; done
38
39 bz2:
40 for i in man?; do $(BZIP2) "$$i"/*; done
41
42 xz:
43 for i in man?; do $(LZMA) "$$i"/*; done
44
45 # Use with
46 # make HTDIR=/some/dir HTOPTS=whatever html
47 # The sed removes the lines "Content-type: text/html\n\n"
48 html:
49 @if [ x$(HTDIR) = x ]; then echo "You must set HTDIR."; else \
50 for i in man?; do \
51 [ -d $(HTDIR)/"$$i" ] || mkdir -p $(HTDIR)/"$$i"; \
52 find "$$i/" -type f | while read f; do \
53 (cd "$$i"; man2html $(HTOPTS) `basename $$f`) | \
54 sed -e '1,2d' > $(HTDIR)/"$$i"/`basename $$f`.html; \
55 done; \
56 done; fi
57
58 install:
59 for i in man?; do \
60 install -d -m 755 $(DESTDIR)$(MANDIR)/"$$i" || exit $$?; \
61 install -m 644 "$$i"/* $(DESTDIR)$(MANDIR)/"$$i" || exit $$?; \
62 done
63
64 # Check if groff reports warnings (may be words of sentences not displayed)
65 # from http://lintian.debian.org/tags/manpage-has-errors-from-man.html
66 check-groff-warnings:
67 GROFF_LOG="$$(mktemp --tmpdir manpages-checksXXXX)" || exit $$?; \
68 for i in man?/*.[1-9]; \
69 do \
70 if grep -q 'SH.*NAME' "$$i"; then \
71 LC_ALL=en_US.UTF-8 MANWIDTH=80 man --warnings -E UTF-8 -l "$$i" > /dev/null 2>| "$$GROFF_LOG"; \
72 [ -s "$$GROFF_LOG" ] && { echo "$$i: "; cat "$$GROFF_LOG"; echo; }; \
73 fi; \
74 done; \
75 rm -f "$$GROFF_LOG"
76
77 # someone might also want to look at /var/catman/cat2 or so ...
78 # a problem is that the location of cat pages varies a lot