-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrules.mk
More file actions
48 lines (34 loc) · 924 Bytes
/
rules.mk
File metadata and controls
48 lines (34 loc) · 924 Bytes
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
#
# Makefile
# Easwy Yang
# 2009/04/13
# Tools
FOP=/usr/bin/fop
XSLTPROC=/usr/bin/xsltproc
# Config files
export DOCDIR = $(firstword $(subst /doc, ,$(CURDIR)))/doc
HTMLXSL=$(DOCDIR)/docbook_html.xsl
FOXSL=$(DOCDIR)/docbook_fo.xsl
FOPCONF=$(DOCDIR)/fop.xconf
# Source files
XML_FILE=$(wildcard *.xml)
# HTML files
HTML_FILE=$(patsubst %.xml,%.html,$(XML_FILE))
HTML_OBJ=$(addprefix html/, $(HTML_FILE))
# PDF files
PDF_FILE=$(patsubst %.xml,%.pdf,$(XML_FILE))
PDF_OBJ=$(addprefix pdf/, $(PDF_FILE))
# STYLESHEET
STYLE=http://easwy.com/blog/uploads/css/style.css
.PHONY: default html pdf clean
default : $(HTML_OBJ)
all: html pdf
html: $(HTML_OBJ)
pdf: $(PDF_OBJ)
html/%.html : %.xml
$(XSLTPROC) --stringparam html.stylesheet "$(STYLE)" -o $@ $(HTMLXSL) $<
pdf/%.pdf : %.xml
$(XSLTPROC) -o pdf/$*.fo $(FOXSL) $<
$(FOP) -c $(FOPCONF) pdf/$*.fo -pdf $@
clean:
@rm html/*.html pdf/*.fo pdf/*.pdf 2> /dev/null