summaryrefslogtreecommitdiff
path: root/doc/en/makefile
blob: a4fb232d4c3dcc4a5a5ff9321c30d8d4a2d46d92 (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
# -*- make -*-
BASE=../..
SUBDIR=doc/en

# Bring in the default rules
include ../../buildlib/defaults.mak

# Do not use XMLTO, build the manpages directly with XSLTPROC
ifdef XSLTPROC
# generate a list of accepted man page translations
SOURCE = $(patsubst ../%.xml,%,$(wildcard ../*.?.xml))
INCLUDES = ../apt.ent ../apt-verbatim.ent
STYLESHEET=../manpage-style.xsl

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

# Install generation hooks
manpages: $($(LOCAL)-LIST) apt.8

$($(LOCAL)-LIST) :: % : ../%.xml $(STYLESHEET) $(INCLUDES)
	echo Creating man page $@
	$(XSLTPROC) -o $@ $(STYLESHEET) $<

apt.8: ../apt.8
	cp -a ../apt.8 apt.8

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

# Chain to the manpage rule
SOURCE = apt.8
include $(MANPAGE_H)