~ricardo-cropalato/ubuntu-desktop-course/ubuntu-desktop-course-pt-br-ricardo-cropalato

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
# This is an example Makefile for converting the docbook XML to 
# PDF and HTML.


# This is quite a hack, a patch that integrates the call of the 
# top level Makefile is welcome.

ifeq ($(CURDIR)x,x)
	CURDIR = $(shell pwd)
endif

DIRTARGETS = $(addsuffix stamp,$(wildcard */))
HTMLTARGETS = $(addsuffix .html,$(basename $(wildcard *.xml))) 
PDFTARGETS = $(addsuffix .pdf,$(basename $(wildcard *.xml))) 


all: $(DIRTARGETS) $(HTMLTARGETS) $(PDFTARGETS)

XSLTPROC = /usr/bin/xsltproc
DBLATEX = /usr/bin/dblatex
XSL ?= $(CURDIR)/lib/ubuntu.xsl

%/stamp: %/
	@$(MAKE) CURDIR=$(CURDIR) XSL=$(XSL) -f $(CURDIR)/Makefile -C $<

# If you need to specify a custom XSL here, dblatex accepts the -p switch
%.pdf: %.xml 
	@$(DBLATEX) -tpdf -o $@ $<

%.html: %.xml $(XSL)
	@$(XSLTPROC) -o $@ $(XSL) $<

clean:
	 @rm -f *.html *.pdf */*.html */*.pdf

#.PHONY: $(DIRTARGETS)