xref: /titanic_41/usr/src/man/Makefile.man (revision 154382d2ab98ad971798eb60525568e3ea233c7a)
1c10c16deSRichard Lowe#
2c10c16deSRichard Lowe# This file and its contents are supplied under the terms of the
3c10c16deSRichard Lowe# Common Development and Distribution License ("CDDL"), version 1.0.
4c10c16deSRichard Lowe# You may only use this file in accordance with the terms of version
5c10c16deSRichard Lowe# 1.0 of the CDDL.
6c10c16deSRichard Lowe#
7c10c16deSRichard Lowe# A full copy of the text of the CDDL should have accompanied this
8c10c16deSRichard Lowe# source.  A copy of the CDDL is also available via the Internet
9c10c16deSRichard Lowe# at http://www.illumos.org/license/CDDL.
10c10c16deSRichard Lowe#
11c10c16deSRichard Lowe
12a9478106SYuri Pankov#
13c10c16deSRichard Lowe# Copyright 2011, Richard Lowe
1432a712daSGarrett D'Amore# Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
15a9478106SYuri Pankov#
16c10c16deSRichard Lowe
1732a712daSGarrett D'AmoreMANDOC=		$(ONBLD_TOOLS)/bin/${MACH}/mandoc
18c10c16deSRichard LoweROOTMAN=	$(ROOT)/usr/share/man
19c10c16deSRichard LoweROOTHASMAN=	$(ROOT)/usr/has/man
20c10c16deSRichard LoweFILEMODE=	0444
21c10c16deSRichard Lowe
22c10c16deSRichard Lowe# The manual section being built, client Makefiles must set this to, for e.g.
23c10c16deSRichard Lowe# "3perl", with case matching that of the section name as installed.
24c10c16deSRichard Lowe#
25c10c16deSRichard Lowe# MANSECT=
26c10c16deSRichard Lowe
2732a712daSGarrett D'AmoreMANCHECKS=	$(MANFILES:%=%.check)
28c10c16deSRichard LoweROOTMANFILES= 	$(MANFILES:%=$(ROOTMAN)/man$(MANSECT)/%)
29a9478106SYuri PankovROOTMANLINKS=	$(MANLINKS:%=$(ROOTMAN)/man$(MANSECT)/%)
30c10c16deSRichard Lowe
31*154382d2SRobert Mustacchi$(ROOTMAN)/man$(MANSECT) $(ROOTHASMAN)/man$(MANSECT):
32*154382d2SRobert Mustacchi		$(INS.dir)
33*154382d2SRobert Mustacchi
34*154382d2SRobert Mustacchi$(ROOTHASMAN)/man$(MANSECT)/%: % $(ROOTHASMAN)/man$(MANSECT)
35*154382d2SRobert Mustacchi		$(INS.file)
36*154382d2SRobert Mustacchi
37*154382d2SRobert Mustacchi$(ROOTMAN)/man$(MANSECT)/% : % $(ROOTMAN)/man$(MANSECT)
38c10c16deSRichard Lowe		$(INS.file)
39c10c16deSRichard Lowe
40ffb8ebfaSGarrett D'Amore#
41ffb8ebfaSGarrett D'Amore# Note that new mandoc adds some checks for lots of extra whitespace.
42ffb8ebfaSGarrett D'Amore# We don't want to check our legacy pages for that.  There are thousands
43ffb8ebfaSGarrett D'Amore# and thousands of them in our man pages.  Please still check them
44ffb8ebfaSGarrett D'Amore# manually when editing (git pbchk will do so for you.)
45ffb8ebfaSGarrett D'Amore#
4632a712daSGarrett D'Amore$(MANCHECKS):
47ffb8ebfaSGarrett D'Amore		@$(EGREP) -q "^.TH" $(@:%.check=%) || \
48ffb8ebfaSGarrett D'Amore		( $(ECHO) "checking $(@:%.check=%)"; \
49ffb8ebfaSGarrett D'Amore		$(MANDOC) -Tlint $(@:%.check=%) )
5032a712daSGarrett D'Amore
51a9478106SYuri Pankov$(MANLINKS):
52a9478106SYuri Pankov		$(RM) $@; $(SYMLINK) $(LINKSRC) $@
53a9478106SYuri Pankov
54*154382d2SRobert Mustacchi$(ROOTMANLINKS): $(MANLINKS) $(ROOTMAN)/man$(MANSECT)
55a9478106SYuri Pankov		$(RM) $@; $(CP) -RP $(@F) $(@D)
56c10c16deSRichard Lowe
57c10c16deSRichard Loweall:
58c10c16deSRichard Lowe
5932a712daSGarrett D'Amorecheck:		$(MANCHECKS)
6032a712daSGarrett D'Amore
61c10c16deSRichard Loweclean:
62c10c16deSRichard Lowe
63c10c16deSRichard Loweclobber:
64a9478106SYuri Pankov		$(RM) $(MANLINKS)
65c10c16deSRichard Lowe
66c10c16deSRichard Lowe.PARALLEL:
67c10c16deSRichard Lowe
68c10c16deSRichard LoweFRC:
69