cleanup manual Makefile
authorCraig Dowell <craigdo@ee.washington.edu>
Sat, 06 Dec 2008 13:56:51 -0800
changeset 3991 36052c1dd7ab
parent 3990 bace6dec0337
child 3992 cb912b415b7d
child 4033 6abf5a0f12d7
cleanup manual Makefile
doc/manual/Makefile
--- a/doc/manual/Makefile	Sat Dec 06 12:25:10 2008 -0800
+++ b/doc/manual/Makefile	Sat Dec 06 13:56:51 2008 -0800
@@ -6,38 +6,59 @@
 CSS = --css-include=manual.css
 SPLIT = --split section
 
-DIA_SOURCES = \
-	internet-node-send.dia \
-	internet-node-recv.dia \
-	packet.dia \
-	node.dia \
-	buffer.dia \
-	sockets-overview.dia \
-	testbed.dia \
-	emulated-channel.dia
+FIGURES = figures
+VPATH = $(FIGURES)
+
+IMAGES_EPS = \
+	$(FIGURES)/internet-node-send.eps \
+	$(FIGURES)/internet-node-recv.eps \
+	$(FIGURES)/packet.eps \
+	$(FIGURES)/node.eps \
+	$(FIGURES)/buffer.eps \
+	$(FIGURES)/sockets-overview.eps \
+	$(FIGURES)/testbed.eps \
+	$(FIGURES)/emulated-channel.eps
+
+IMAGES_PNG = ${IMAGES_EPS:.eps=.png}
+IMAGES_PDF = ${IMAGES_EPS:.eps=.pdf}
+
+IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
 
-DIA_EPS = ${DIA_SOURCES:.dia=.eps}
-DIA_PNG = ${DIA_SOURCES:.dia=.png}
-DIA_PDF = ${DIA_SOURCES:.dia=.pdf}
-
-all:  images html split-html pdf
+CHAPTERS = \
+	manual.texi \
+	attributes.texi \
+	callbacks.texi \
+	emulation.texi \
+	node.texi \
+	objects.texi \
+	other.texi \
+	output.texi \
+	packets.texi \
+	random.texi \
+	realtime.texi \
+	routing.texi \
+	sockets.texi \
+	statistics.texi \
+	troubleshoot.texi
 
-images:
-	cd figures/; $(DIA) -t png $(DIA_SOURCES) 
-	cd figures/; $(DIA) -t eps $(DIA_SOURCES) 
-	cd figures/; $(foreach FILE,$(DIA_EPS),$(EPSTOPDF) $(FILE);)
+%.eps : %.dia; $(DIA) -t eps $< -e $@
+%.png : %.dia; $(DIA) -t png $< -e $@
+%.pdf : %.eps; $(EPSTOPDF) $< -o=$@
 
-html: images
+all:  $(IMAGES) manual.pdf manual.html manual/manual.html
+
+manual.pdf: $(IMAGES) $(CHAPTERS)
+	$(TEXI2PDF) manual.texi
+
+manual.html: $(IMAGES) $(CHAPTERS)
 	$(TEXI2HTML) ${CSS} manual.texi
 
-split-html: images
+manual/manual.html: $(IMAGES) $(CHAPTERS)
 	$(TEXI2HTML) ${CSS} ${SPLIT} manual.texi
 
-pdf: images
-	$(TEXI2PDF) manual.texi
+figures-clean:
+	rm -rf $(IMAGES)
 
-figures-clean:
-	cd figures/; rm -rf $(DIA_EPS); rm -rf $(DIA_PNG); rm -rf $(DIA_PDF)
-
-clean: figures-clean
-	rm -rf manual.aux manual.cp manual.cps manual.fn manual.ky manual.pg manual.tp manual.vr manual.toc manual.log manual.pdf manual.html manual/ 
+clean: 	figures-clean
+	rm -rf manual.aux manual.cp manual.cps manual.fn manual.ky manual.pg 
+	rm -rf manual.tp manual.vr manual.toc manual.log manual.pdf manual.html manual/