]>
Commit | Line | Data |
---|---|---|
3b676b13 K |
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. | |
fc17e68e | 3 | # Do "make install" to copy the pages to their destination. |
7a5c6cc1 | 4 | # Do "make gz" or "make bz2" first if you use compressed source pages. |
fc17e68e | 5 | |
a477c851 | 6 | MANDIR=$(prefix)/usr/share/man |
404a66cb | 7 | |
b12f1e58 | 8 | GZIP=gzip -9 |
934adb1d | 9 | BZIP2=bzip2 -9 |
1c259a90 | 10 | |
7a5c6cc1 | 11 | all: screen remove install |
3b676b13 | 12 | |
7a5c6cc1 K |
13 | allgz: gz all |
14 | ||
15 | allbz: bz2 all | |
16 | ||
3b676b13 | 17 | screen: |
b59b9a61 | 18 | -mkdir not_installed |
ca28c82b K |
19 | for i in man?/*; do \ |
20 | if [ $(MANDIR)/"$$i" -nt "$$i" ]; then \ | |
21 | cmp -s $(MANDIR)/"$$i" "$$i" > /dev/null 2>&1; \ | |
22 | if [ "$$?" != 0 ]; then mv "$$i" not_installed; fi; \ | |
3b676b13 | 23 | fi; \ |
ca28c82b | 24 | done |
fc17e68e K |
25 | |
26 | remove: | |
ca28c82b K |
27 | for i in man?/* man??/*; do \ |
28 | rm -f $(MANDIR)/"$$i" $(MANDIR)/"$$i".gz $(MANDIR)/"$$i".bz2; \ | |
29 | done | |
fc17e68e | 30 | |
b12f1e58 | 31 | gz: |
ca28c82b | 32 | for i in man? man??; do $(GZIP) "$$i"/*; done |
404a66cb | 33 | |
934adb1d | 34 | bz2: |
ca28c82b | 35 | for i in man? man??; do $(BZIP2) "$$i"/*; done |
934adb1d | 36 | |
164d73fd | 37 | # Use with |
5ce5bba9 | 38 | # make HTDIR=/some/dir HTOPTS=whatever html |
164d73fd K |
39 | # The sed removes the lines "Content-type: text/html\n\n" |
40 | html: | |
41 | @if [ x$(HTDIR) = x ]; then echo "You must set HTDIR."; else \ | |
42 | for i in man?; do \ | |
ca28c82b | 43 | [ -d $(HTDIR)/"$$i" ] || mkdir -p $(HTDIR)/"$$i"; \ |
164d73fd | 44 | find "$$i/" -type f | while read f; do \ |
ca28c82b K |
45 | (cd "$$i"; man2html $(HTOPTS) `basename $$f`) | \ |
46 | sed -e '1,2d' > $(HTDIR)/"$$i"/`basename $$f`.html; \ | |
164d73fd K |
47 | done; \ |
48 | done; fi | |
49 | ||
07060a12 | 50 | README=$(MANDIR)/man1/README |
b12f1e58 | 51 | install: |
6071a7a5 | 52 | for i in man? man??; do \ |
ca28c82b K |
53 | install -d -m 755 $(MANDIR)/"$$i"; \ |
54 | install -m 644 "$$i"/* $(MANDIR)/"$$i"; \ | |
a477c851 | 55 | done; \ |
07060a12 | 56 | rm -f $(README) $(README).gz $(README).bz2 |
a477c851 | 57 | |
1c259a90 | 58 | # someone might also want to look at /var/catman/cat2 or so ... |
b12f1e58 | 59 | # a problem is that the location of cat pages varies a lot |