File: Makefile

package info (click to toggle)
alsa-driver 1.0.23%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,448 kB
  • ctags: 77,491
  • sloc: ansic: 473,525; sh: 3,307; makefile: 2,661; python: 1,527; perl: 1,316; awk: 66
file content (83 lines) | stat: -rw-r--r-- 1,754 bytes parent folder | download
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
TOPDIR=../..

DOCBOOKS := alsa-driver-api.xml writing-an-alsa-driver.xml

include $(TOPDIR)/Makefile.conf

TOPDIR = $(MAINSRCDIR)
CURDIR = $(subst $(MAINSRCDIR)/,,$(shell /bin/pwd))

# The targets that may be used.
.PHONY:	depend xmldocs psdocs pdfdocs htmldocs clean mrproper

BOOKS := $(DOCBOOKS)
xmldocs: $(BOOKS)

PS := $(patsubst %.xml, %.ps, $(BOOKS))
psdocs: $(PS) $(DOCPROC)

PDF := $(patsubst %.xml, %.pdf, $(BOOKS))
pdfdocs: $(PDF) $(DOCPROC)

HTML := $(patsubst %.xml, %, $(BOOKS))
htmldocs: $(HTML) $(DOCPROC)

###
# non-standard rules below to simplify...

KERNELDOC=$(TOPDIR)/utils/kernel-doc
DOCPROC=$(TOPDIR)/utils/docproc

$(DOCPROC):
	$(MAKE) -C $(TOPDIR)/utils docproc

%.tmpl:
	ln -s $(TOPDIR)/alsa-kernel/Documentation/DocBook/$@

%.xml: %.tmpl
	(cd $(TOPDIR);\
	 $(DOCPROC) doc $(CURDIR)/$< > $(CURDIR)/$@)

###

DVI	:=	$(patsubst %.xml, %.dvi, $(BOOKS))
AUX	:=	$(patsubst %.xml, %.aux, $(BOOKS))
TEX	:=	$(patsubst %.xml, %.tex, $(BOOKS))
LOG	:=	$(patsubst %.xml, %.log, $(BOOKS))
OUT	:=	$(patsubst %.xml, %.out, $(BOOKS))

clean:
	rm -f core *~
	rm -f $(BOOKS) $(patsubst %.xml, %.tmpl, $(BOOKS))
	rm -f $(DVI) $(AUX) $(TEX) $(LOG) $(OUT)
	rm -f $(patsubst %.fo, %.tmpl, $(BOOKS))
	rm -f $(PNG-parportbook) $(EPS-parportbook)
	rm -f $(C-procfs-example)

mrproper: clean
	rm -f $(PS) $(PDF)
	rm -f -r $(HTML)
	rm -f .depend
#	rm -f $(TOPDIR)/scripts/mkdep-docbook
	rm -rf DBTOHTML_OUTPUT*

XMLTOFLAGS = -m $(TOPDIR)/alsa-kernel/Documentation/DocBook/stylesheet.xsl

%.html: %.xml
	xmlto xhtml $(XMLTOFLAGS) $<

# %.pdf: %.xml
# 	xmlto $(XMLTOFLAGS) pdf $<

%.fo: %.xml
	xmlto $(XMLTOFLAGS) fo $<
%.pdf: %.fo
	fop $< $@

%.ps: %.xml
	xmlto ps $(XMLTOFLAGS) $<

%: %.xml
	rm -rf $@
	mkdir $@
	(cd $@; xmlto xhtml $(XMLTOFLAGS) ../$<)