forked from ClusterLabs/pacemaker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.common
75 lines (59 loc) · 2.74 KB
/
Makefile.common
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Not all current distros support AM_V_P
# https://www.gnu.org/software/automake/manual/html_node/Automake-silent_002drules-Option.html
V ?= $(AM_DEFAULT_VERBOSITY)
PCMK_V = $(pcmk__v_$(V))
pcmk__v_0 = :
pcmk__v_1 =
PCMK_quiet = $(pcmk_quiet_$(V))
pcmk_quiet_0 = >/dev/null 2>&1
pcmk_quiet_1 =
AM_V_XSL = $(am__v_XSL_$(V))
am__v_XSL_0 = @echo " XSL " $@;
am__v_XSL_1 =
AM_V_MAN = $(am__v_MAN_$(V))
am__v_MAN_0 = @echo " MAN " $@;
am__v_MAN_1 =
AM_V_ASCII = $(am__v_ASCII_$(V))
am__v_ASCII_0 = @echo " ASCII " $@;
am__v_ASCII_1 =
AM_V_PUB = $(am__v_PUB_$(V))
am__v_PUB_0 = @echo " PUB $@: $(DOCBOOK_FORMATS)";
am__v_PUB_1 =
MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl
if BUILD_HELP
man8_MANS = $(sbin_PROGRAMS:%=%.8) $(sbin_SCRIPTS:%=%.8)
endif
%.8: % $(MAN8DEPS)
chmod a+x $(abs_builddir)/$<
$(PCMK_V) PATH=$(abs_builddir):$$PATH $(abs_builddir)/$< --help
$(PCMK_V) PATH=$(abs_builddir):$$PATH $(abs_builddir)/$< --version
$(AM_V_MAN)PATH=$(abs_builddir):$$PATH $(HELP2MAN) --output $@ --no-info --section 8 --name "Part of the Pacemaker cluster resource manager" $(abs_builddir)/$<
%.xml: %
$(AM_V_GEN)$(abs_builddir)/$< metadata > $@
%.dbook: %.xml
$(AM_V_XSL)$(XSLTPROC) --nonet --novalid --stringparam man.name $* $(DBOOK_OPTS) $(top_srcdir)/xml/ocf-meta2man.xsl $(abs_builddir)/$< > $(abs_builddir)/$@
%.7: %.dbook
$(AM_V_XSL)$(XSLTPROC) $(MANPAGE_XSLT) $(abs_builddir)/$< $(PCMK_quiet)
# Build docbook from asciidoc because XML is a PITA to edit
#
# Build each chapter as a book (since the numbering isn't right for
# articles and only books can have appendicies) and then strip out the
# bits we don't want/need
#
%.xml: %.txt
$(AM_V_ASCII)asciidoc -b docbook -a cli_name=$(ASCIIDOC_CLI_TYPE) -a $(ASCIIDOC_CLI_TYPE)=true -d book -o $@ $<
$(AM_V_at)sed -i 's///' $@
$(AM_V_at)sed -i 's///' $@ # Fix line endings
$(AM_V_at)sed -i 's/\ lang="en"//' $@ # Never specify a language in the chapters
$(AM_V_at)sed -i 's/simpara/para/g' $@ # publican doesn't correctly render footnotes with simpara
$(AM_V_at)sed -i 's/.*<date>.*//g' $@ # Remove dangling tag
$(AM_V_at)sed -i 's/.*preface>//g' $@ # Remove preface elements
$(AM_V_at)sed -i 's:<title></title>::g' $@ # Remove empty title
$(AM_V_at)sed -i 's/chapter/section/g' $@ # Chapters become sections, so that books can become chapters
$(AM_V_at)sed -i 's/<.*bookinfo.*>//g' $@ # Strip out bookinfo, we don't need it
-grep -qis "<appendix" $@ && sed -i 's/.*book>//' $@ # We just want the appendix tag
-grep -vqis "<appendix" $@ && sed -i 's/book>/chapter>/g' $@ # Rename to chapter
# echo Rebuilt $@ from $<