/
Makefile
95 lines (80 loc) · 2.95 KB
/
Makefile
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# ****************************************************************
# * Settings *
# ****************************************************************
# dependencies
SHELL = /bin/sh
POD2HTML = /usr/local/bin/pod2html
POD2MAN = /usr/local/bin/pod2man
MKDIR = /bin/mkdir
GZIP = /bin/gzip
PERL = /usr/local/bin/perl
FIND = /usr/bin/find
# ****************************************************************
# * Other Fields
# ****************************************************************
# directories
LIB = lib
BRIC = ../${LIB}/Bric
# ****************************************************************
# * some things we can figure out here, so we shouldn't
# * have to mess with the settings all the time
# ****************************************************************
# the sourcefiles
PODFILES = $(shell ${FIND} ${BRIC} -name *.pod 2>/dev/null)
SRCFILES = $(PODFILES)
# suffixes:
.SUFFIXES:
.SUFFIXES: .pod .pl .html .man .man.gz
HTML_TARGETS = $(addprefix html/,$(addsuffix .html,$(basename $(notdir ${SRCFILES}))))
define generate-manpage
${POD2MAN} $^ >/tmp/$(notdir $^).man
${GZIP} /tmp/$(notdir $^).man >$@
endef
# ****************************************************************
# * RULES follow
# ****************************************************************
all: doc
doc: ${HTML_TARGETS} man-targets
# ****************************************************************
# * This is a multiple target rule whose effect is to run
# * pod2[whatever] recursively on the $(LIB) dir. The whatever
# * is determined by the first prerequisite.
# ****************************************************************
html:
$(MKDIR) -p html
$(HTML_TARGETS): BASE = $(basename $(notdir $@))
$(HTML_TARGETS): ORIG = $(filter %/${BASE}.pod,${SRCFILES})
$(HTML_TARGETS): html
ifdef PERL2HTML
${PERL2HTML} --bgcolor '#ffffff' --verbosity 1 ${BRIC} html
else
$(POD2HTML) --podpath=Bric --podroot=../${LIB} --verbose \
--flush --htmldir=html --recurse --index --infile=$(ORIG) \
--outfile=$@ --libpods=$(shell echo ${SRCFILES} | tr ' ' ':')
endif
chmod a+r $@
${RM} pod2htm*
man-targets: man man/bricolage.8.gz man/bricolage-dba.8.gz \
man/bricolage-security.8.gz man/bricolage-templates.3.gz \
man/bricolage-advTemplages.3.gz man/bricolage-assetEditing.1.gz \
man/bricolage-elementAdmin.1.gz man/bricolage-htmlTemplate.3.gz
man:
$(MKDIR) -p man
man/bricolage.8.gz: ${BRIC}/Admin.pod
${generate-manpage}
man/bricolage-dba.8.gz: ${BRIC}/DBA.pod
${generate-manpage}
man/bricolage-security.8.gz: ${BRIC}/Security.pod
${generate-manpage}
man/bricolage-templates.3.gz: ${BRIC}/Templates.pod
${generate-manpage}
man/bricolage-advTemplages.3.gz: ${BRIC}/AdvTemplates.pod
${generate-manpage}
man/bricolage-assetEditing.1.gz: ${BRIC}/AssetEditing.pod
${generate-manpage}
man/bricolage-elementAdmin.1.gz: ${BRIC}/ElementAdmin.pod
${generate-manpage}
man/bricolage-htmlTemplate.3.gz: ${BRIC}/HTMLTemplate.pod
${generate-manpage}
clean:
$(RM) -r man html