summaryrefslogtreecommitdiff
path: root/docs/docbook/Makefile.in
blob: aa326faaf38a0fe89d053b6f43167115282dcb78 (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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
#################################################################
# Makefile.in for Samba Documentation
# Authors:	James Moore <jmoore@php.net>
# 		Gerald Carter <jerry@samba.org>
# 		Jelmer Vernooij <jelmer@samba.org>
#
# Please see http://www.samba.org/samba/cvs.html
# for information on getting the latest  
# source and documentation source files.  
#
#
MANPAGES_NAMES=findsmb.1 smbclient.1 \
	smbspool.8 lmhosts.5 \
	smbcontrol.1 smbstatus.1 \
	smbd.8 net.8 smbtar.1 nmbd.8 \
	smbmnt.8 smbumount.8 nmblookup.1 \
	smbmount.8 swat.8 rpcclient.1 \
	smbpasswd.5 testparm.1 samba.7 \
	smbpasswd.8 testprns.1 \
	smb.conf.5 wbinfo.1 pdbedit.8 \
	smbcacls.1 smbsh.1 winbindd.8 \
	tdbbackup.8 vfstest.1 \
	profiles.1 smbtree.1 ntlm_auth.1 \
	editreg.1 smbcquotas.1

## This part contains only rules. You shouldn't need to change it 
## if you are adding docs

TEXSTYLESHEET = @TEXSTYLESHEET@
XSLTPROC = @XSLTPROC@ @PAPERSIZE@ --stringparam samba-book 1 --stringparam duplicate_ulinks "@DUPLICATE_ULINKS@" @FONTSIZE@ @CROP@
PDFLATEX = TEXINPUTS=xslt/latex:.: @PDFLATEX@ --interaction nonstopmode
LATEX = TEXINPUTS=xslt/latex:.: @LATEX@ --interaction nonstopmode
DVIPS = @DVIPS@
PNGTOPNM = @PNGTOPNM@
PNMTOPS = @PNMTOPS@
XMLTO = @XMLTO@
SRCDIR = @srcdir@
MANDIR=../manpages
MANPROJDOC = manpages
PROJDOC = projdoc
MAKEINDEX = @MAKEINDEX@
IMAGEPROJDIR = $(PROJDOC)/imagefiles
DEVDOC = devdoc
SMBDOTCONFDOC = smbdotconf
PSDIR = ..
PDFDIR = ..
DVIDIR = ..
TXTDIR = ../textdocs
FAQPROJDOC = faq
FAQDIR = ../faq
HTMLDIR=../htmldocs

MANPAGES=$(patsubst %,$(MANDIR)/%,$(MANPAGES_NAMES))
MANPAGES_HTML=$(patsubst %,$(HTMLDIR)/%.html,$(MANPAGES_NAMES))

PROJDOC_IMAGES_PNG = $(wildcard $(IMAGEPROJDIR)/*.png)
PROJDOC_IMAGES_EPS=$(patsubst %.png,%.eps,$(wildcard $(IMAGEPROJDIR)/*.png))
PROJDOC_DEPS = $(PROJDOC)/*.xml $(PROJDOC)/attributions.xml $(MANPROJDOC)/*.xml $(SMBDOTCONFDOC)/smb.conf.5.xml $(SMBDOTCONFDOC)/parameters.all.xml $(SMBDOTCONFDOC)/parameters.global.xml $(SMBDOTCONFDOC)/parameters.service.xml 
DEVDOC_DEPS = $(DEVDOC)/*.xml $(DEVDOC)/attributions.xml

all: 
	@echo "Supported make targets:"
	@echo "pdf - Build PDF version of book"
	@echo "tex - Build Latex version of book"
	@echo "dvi - Build Device Independant File of book"
	@echo "ps - Build PostScript version of book"
	@echo "everything - Build all of the above"
	@echo "manpages - Build manpages"
	@echo "txt - Build plain text version of HOWTO Collection and Developers Guide"
	@echo -n "html-single - Build single file HTML version of HOWTO Collection"
	@echo " and developers guide"
	@echo "html - Build HTML version of HOWTO Collection and Developers Guide"
	@echo "htmlman - Build html version of manpages"
	@echo "htmlfaq - Build html version of the FAQ"
	@echo "undocumented - Output list of undocumented smb.conf options"
	@echo "everything - Build all of the above"

everything: manpages pdf html-single html htmlman htmlfaq txt ps

# Global rules

pdf: $(PDFDIR) $(PDFDIR)/Samba-HOWTO-Collection.pdf $(PDFDIR)/Samba-Developers-Guide.pdf
dvi: $(DVIDIR) $(DVIDIR)/Samba-HOWTO-Collection.dvi $(DVIDIR)/Samba-Developers-Guide.dvi
ps: $(PSDIR) $(PSDIR)/Samba-HOWTO-Collection.ps $(PSDIR)/Samba-Developers-Guide.ps
hpdf: $(PDFDIR) $(PDFDIR)/Samba-HOWTO-Collection.pdf
txt: $(TXTDIR) $(TXTDIR)/Samba-HOWTO-Collection.txt $(TXTDIR)/Samba-Developers-Guide.txt
htmlman: $(HTMLDIR) $(MANPAGES_HTML) CSS
htmlfaq: $(HTMLDIR) CSS
	@$(XSLTPROC) --stringparam base.dir "$(FAQDIR)/" --stringparam root.filename samba-faq xslt/html-chunk.xsl $(FAQPROJDOC)/sambafaq.xml
html-single: $(HTMLDIR) CSS $(HTMLDIR)/Samba-HOWTO-Collection.html  $(HTMLDIR)/Samba-Developers-Guide.html
html: $(HTMLDIR) CSS $(PROJDOC_DEPS)
	@$(XSLTPROC) xslt/html-chunk.xsl $(PROJDOC)/samba-doc.xml
manpages: $(MANDIR) $(MANPAGES)
tex: samba-doc.tex dev-doc.tex

Samba-HOWTO-Collection.xml: $(PROJDOC)/samba-doc.xml $(PROJDOC_DEPS)
	$(XSLTPROC) --xinclude --output $@ xslt/expand-sambadoc.xsl $<

Samba-Developers-Guide.xml: $(DEVDOC)/dev-doc.xml $(DEVDOC_DEPS)
	$(XSLTPROC) --xinclude --output $@ xslt/expand-sambadoc.xsl $<

$(PROJDOC)/attributions.xml: $(PROJDOC)/samba-doc.xml $(SMBDOTCONFDOC)/parameters.all.xml $(SMBDOTCONFDOC)/parameters.global.xml $(SMBDOTCONFDOC)/parameters.service.xml 
	@echo > $@ # Make sure we don't get recursive dependencies, etc!
	@echo "Generating attributions page"
	@$(XSLTPROC) --output $@ xslt/generate-attributions.xsl $<

$(DEVDOC)/attributions.xml: $(DEVDOC)/dev-doc.xml
	@echo > $@ # Make sure we don't get recursive dependencies, etc!
	@echo "Generating attributions page"
	@$(XSLTPROC) --output $@ xslt/generate-attributions.xsl $<

clean: 
	@rm -f *.xml $(MANPAGES) $(TXTDIR)/*.txt $(PSDIR)/*.ps $(PDFDIR)/*.pdf 
	@rm -f $(MANPROJDOC)/smb.conf.5.xml $(SMBDOTCONFDOC)/parameters.*.xml $(DVIDIR)/*.dvi
	@rm -f samba-doc.* dev-doc.* $(PROJDOC)/attributions.xml
	@rm -f $(IMAGEPROJDIR)/*.eps

# Text files
$(TXTDIR):
	mkdir $(TXTDIR)

$(TXTDIR)/%.txt: %.xml
	@echo "Converting $< to plain text..."
	@$(XMLTO) txt -o $(TXTDIR) $<

# Tex files
%.tex: %.xml
	@echo "Converting $< to LaTeX..."
	@$(XSLTPROC) --output $@ xslt/latex.xsl $<
	
# Adobe PDF files
$(PDFDIR)/%.pdf: %.tex epsimages
	@echo "Building LaTeX sources via $(PDFLATEX)..."
	@$(PDFLATEX) $< | grep 'Rerun to get cross-references right' && \
	$(PDFLATEX) $< | grep 'Rerun to get cross-references right' && \
	$(PDFLATEX) $< || echo
	@echo "done"

epsimages: $(PROJDOC_IMAGES_EPS)

# DVI files
$(DVIDIR)/%.dvi: %.tex epsimages
	@echo "Building LaTeX sources via $(LATEX)..."
	@$(LATEX) $< 2>&1 | grep 'Rerun to get cross-references right' && \
	$(LATEX) $< 2>&1 | grep 'Rerun to get cross-references right' && \
	$(LATEX) $< 2>&1 || echo
	@echo "done"

%.eps: %.png
	@$(PNGTOPNM) $< | $(PNMTOPS) > $@

# PostScript files
$(PSDIR)/%.ps: $(DVIDIR)/%.dvi
	$(DVIPS) -o $@ $<

# Single large HTML files

$(HTMLDIR):
	@mkdir $(HTMLDIR)

CSS: $(HTMLDIR) xslt/html/samba.css
	@cp xslt/html/samba.css $(HTMLDIR)/

$(HTMLDIR)/Samba-HOWTO-Collection.html: $(PROJDOC)/samba-doc.xml $(PROJDOC_DEPS) $(PROJDOC_IMAGES_PNG)
	@$(XSLTPROC) --output $@ xslt/html.xsl $<

$(HTMLDIR)/Samba-Developers-Guide.html: $(DEVDOC)/dev-doc.xml $(DEVDOC_DEPS)
	@$(XSLTPROC) --output $@ xslt/html.xsl $<


$(HTMLDIR)/%.html: $(MANPROJDOC)/%.xml
	@$(XSLTPROC) --output $@ xslt/html.xsl $<

# Manpages
$(SMBDOTCONFDOC)/parameters.all.xml: $(SMBDOTCONFDOC)/generate-file-list.sh
	@cd $(SMBDOTCONFDOC) && \
	/bin/sh generate-file-list.sh >parameters.all.xml && \
	cd ..

$(SMBDOTCONFDOC)/parameters.global.xml: $(SMBDOTCONFDOC)/parameters.all.xml $(SMBDOTCONFDOC)/generate-context.xsl
	@cd $(SMBDOTCONFDOC) && \
	$(XSLTPROC) --xinclude \
	--param smb.context "'G'" \
	--output parameters.global.xml \
	generate-context.xsl parameters.all.xml && \
	cd ..

$(SMBDOTCONFDOC)/parameters.service.xml: $(SMBDOTCONFDOC)/parameters.all.xml $(SMBDOTCONFDOC)/generate-context.xsl
	@cd $(SMBDOTCONFDOC) && \
	$(XSLTPROC) --xinclude \
	--param smb.context "'S'" \
	--output parameters.service.xml \
	generate-context.xsl parameters.all.xml && \
	cd ..

$(MANPROJDOC)/smb.conf.5.xml: $(SMBDOTCONFDOC)/smb.conf.5.xml $(SMBDOTCONFDOC)/parameters.all.xml \
 			$(SMBDOTCONFDOC)/parameters.global.xml $(SMBDOTCONFDOC)/parameters.service.xml \
 			xslt/expand-sambadoc.xsl
	@$(XSLTPROC) --xinclude --output $(MANPROJDOC)/smb.conf.5.xml xslt/expand-sambadoc.xsl $(SMBDOTCONFDOC)/smb.conf.5.xml

$(MANDIR): 
	mkdir $(MANDIR)

$(MANDIR)/%: $(MANPROJDOC)/%.xml
	@$(XSLTPROC) xslt/expand-sambadoc.xsl $< | $(XSLTPROC) xslt/man.xsl - > $@

undocumented: $(SMBDOTCONFDOC)/parameters.all.xml
	$(PERL) scripts/find_missing_doc.pl ../..