summaryrefslogtreecommitdiff
path: root/buildlib/sgml_manpage.mak
blob: 607ead3735be208a46bb5a55b6dbd069e4ef1138 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# -*- make -*-

# This handles man pages in DocBook SGMLL format. We convert to the respective
# output in the source directory then copy over to the final dest. This
# means yodl is only needed if compiling from CVS

# Input
# $(SOURCE) - The documents to use, in the form foo.sect, ie apt-cache.8
#             the sgml files are called apt-cache.8.sgml

# See defaults.mak for information about LOCAL

# Some local definitions
ifdef NSGMLS
ifdef SGMLSPL
ifdef DOCBOOK2MAN

LOCAL := sgml-manpage-$(firstword $(SOURCE))
$(LOCAL)-LIST := $(SOURCE)

# Install generation hooks
doc: $($(LOCAL)-LIST)
veryclean: veryclean/$(LOCAL)

$($(LOCAL)-LIST) :: % : %.sgml $(INCLUDES)
	echo Creating man page $@
	$(NSGMLS) $< | $(SGMLSPL) $(DOCBOOK2MAN) 

# Clean rule
.PHONY: veryclean/$(LOCAL)
veryclean/$(LOCAL):
	-rm -rf $($(@F)-LIST)

HAVE_SGML=yes
endif
endif
endif

INCLUDES :=

ifndef HAVE_SGML
# Strip from the source list any man pages we dont have compiled already
SOURCE := $(wildcard $(SOURCE))
endif

# Chain to the manpage rule
ifneq ($(words $(SOURCE)),0)
include $(MANPAGE_H)
endif