xref: /titanic_41/usr/src/man/Makefile.man (revision 32a712da90cea6ff9a05f51e7844944ccfa28d5e)
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
14*32a712daSGarrett D'Amore# Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
15a9478106SYuri Pankov#
16c10c16deSRichard Lowe
17*32a712daSGarrett 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
27*32a712daSGarrett D'AmoreMANCHECKS=	$(MANFILES:%=%.check)
28c10c16deSRichard LoweROOTMANFILES= 	$(MANFILES:%=$(ROOTMAN)/man$(MANSECT)/%)
29a9478106SYuri PankovROOTMANLINKS=	$(MANLINKS:%=$(ROOTMAN)/man$(MANSECT)/%)
30c10c16deSRichard Lowe
31c10c16deSRichard Lowe$(ROOTMAN)/man$(MANSECT)/% $(ROOTHASMAN)/man$(MANSECT)/%: %
32c10c16deSRichard Lowe		$(INS.file)
33c10c16deSRichard Lowe
34*32a712daSGarrett D'Amore$(MANCHECKS):
35*32a712daSGarrett D'Amore		@$(ECHO) "checking $(@:%.check=%)"; \
36*32a712daSGarrett D'Amore		$(MANDOC) -Tlint $(@:%.check=%)
37*32a712daSGarrett D'Amore
38a9478106SYuri Pankov$(MANLINKS):
39a9478106SYuri Pankov		$(RM) $@; $(SYMLINK) $(LINKSRC) $@
40a9478106SYuri Pankov
41a9478106SYuri Pankov$(ROOTMANLINKS): $(MANLINKS)
42a9478106SYuri Pankov		$(RM) $@; $(CP) -RP $(@F) $(@D)
43c10c16deSRichard Lowe
44c10c16deSRichard Loweall:
45c10c16deSRichard Lowe
46*32a712daSGarrett D'Amorecheck:		$(MANCHECKS)
47*32a712daSGarrett D'Amore
48c10c16deSRichard Loweclean:
49c10c16deSRichard Lowe
50c10c16deSRichard Loweclobber:
51a9478106SYuri Pankov		$(RM) $(MANLINKS)
52c10c16deSRichard Lowe
53c10c16deSRichard Lowe.PARALLEL:
54c10c16deSRichard Lowe
55c10c16deSRichard LoweFRC:
56