6198 Let's EOL cachefs
[illumos-gate.git] / usr / src / man / Makefile.man
blob3f465b98c1d96e685ca6fa5c2919dd8db3f18f9c
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
7 # A full copy of the text of the CDDL should have accompanied this
8 # source.  A copy of the CDDL is also available via the Internet
9 # at http://www.illumos.org/license/CDDL.
13 # Copyright 2011, Richard Lowe
14 # Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
17 MANDOC=         $(ONBLD_TOOLS)/bin/${MACH}/mandoc
18 ROOTMAN=        $(ROOT)/usr/share/man
19 ROOTHASMAN=     $(ROOT)/usr/has/man
20 FILEMODE=       0444
22 # The manual section being built, client Makefiles must set this to, for e.g.
23 # "3perl", with case matching that of the section name as installed.
25 # MANSECT=
27 MANCHECKS=      $(MANFILES:%=%.check)
28 ROOTMANFILES=   $(MANFILES:%=$(ROOTMAN)/man$(MANSECT)/%)
29 ROOTMANLINKS=   $(MANLINKS:%=$(ROOTMAN)/man$(MANSECT)/%)
31 $(ROOTMAN)/man$(MANSECT) $(ROOTHASMAN)/man$(MANSECT):
32                 $(INS.dir)
34 $(ROOTHASMAN)/man$(MANSECT)/%: % $(ROOTHASMAN)/man$(MANSECT)
35                 $(INS.file)
37 $(ROOTMAN)/man$(MANSECT)/% : % $(ROOTMAN)/man$(MANSECT)
38                 $(INS.file)
41 # Note that new mandoc adds some checks for lots of extra whitespace.
42 # We don't want to check our legacy pages for that.  There are thousands
43 # and thousands of them in our man pages.  Please still check them
44 # manually when editing (git pbchk will do so for you.)
46 $(MANCHECKS):
47                 @$(EGREP) -q "^.TH" $(@:%.check=%) || \
48                 ( $(ECHO) "checking $(@:%.check=%)"; \
49                 $(MANDOC) -Tlint $(@:%.check=%) )
51 $(MANLINKS):
52                 $(RM) $@; $(SYMLINK) $(LINKSRC) $@
54 $(ROOTMANLINKS): $(MANLINKS) $(ROOTMAN)/man$(MANSECT)
55                 $(RM) $@; $(CP) -RP $(@F) $(@D)
57 all:
59 check:          $(MANCHECKS)
61 clean:
63 clobber:
64                 $(RM) $(MANLINKS)
66 .PARALLEL:
68 FRC: