]> git.ipfire.org Git - thirdparty/man-pages.git/blame - Makefile
Merge prehistory and history
[thirdparty/man-pages.git] / Makefile
CommitLineData
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 6MANDIR=$(prefix)/usr/share/man
404a66cb 7
b12f1e58 8GZIP=gzip -9
934adb1d 9BZIP2=bzip2 -9
1c259a90 10
7a5c6cc1 11all: screen remove install
3b676b13 12
7a5c6cc1
K
13allgz: gz all
14
15allbz: bz2 all
16
3b676b13 17screen:
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
26remove:
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 31gz:
ca28c82b 32 for i in man? man??; do $(GZIP) "$$i"/*; done
404a66cb 33
934adb1d 34bz2:
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"
40html:
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 50README=$(MANDIR)/man1/README
b12f1e58 51install:
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