# makefile for diagram chase map # felix salfelder 2007 FILELIST=diag.png config.xml diag_thumb.jpg diag_sky.jpg particle.png PREFIX=~/.wormux #particlesize PSIZE=64 #animation stepping PNUM=10 PARTICLES=particle.0.png particle.1.png #to debug Makefile MF=Makefile all: $(FILELIST) tbz2: diagram.tbz2 @echo -e \\n... now unpack $< to your wormux directory \(usually /usr/share/games/wormux\). diagram.tbz2: $(FILELIST) make install PREFIX=. tar -cvjf $@ map rm -rf map diag_sky.jpg: convert -size 2000x2000 gradient:white-blue $@ config.xml: config.xml.tpl cat $< | sed -e s/%%PSIZE%%/$(PSIZE)/g \ | sed -e s/%%PNUM%%/$(PNUM)/g > $@ diag_thumb.jpg: diag.tmp.epsi convert -rotate -90 -density 100x100 -extent 300x225 $< $@ diag.tmp.tex: diag.tex grep -v srcltx $< > $@ diag.tmp.dvi: diag.tmp.tex latex $< diag.tmp.ps: diag.tmp.dvi dvips -t landscape -o $@ $< #dvips -t a3 $< diag.tmp.epsi: diag.tmp.ps ps2epsi $< $@ diag.png: diag.tmp.epsi convert -rotate -90 -density 250x250 -channel RGBA -background transparent $< $@ # convert -rotate -90 -density 300x300 -channel RGBA -background transparent $< $@ particle.0.epsi: particle.0.ps ps2epsi $< $@ particle.%.bb.ps: particle.%.ps $(MF) # this adds a (too big) bounding box to the particle (not necessary, makes rasterizing faster) bb=$$( gs -q -sOutputFile=- -dNOPAUSE -dBATCH -sDEVICE=bbox $< 2>&1 |grep "%%Bou" );cat $< | sed -e "s/%%Bounding.*/$$bb/" > $@ particle.%.bb.png: particle.%.bb.ps convert -density 500x500 -channel RGBA -background transparent $< $@ convert -trim $@ $@ particle.%.png: particle.%.bb.png $(MF) for i in `seq $(PNUM)`; do SEQ+=" ( -rotate `expr $$i \* 9` -density 500x500 -channel RGBA -resize $(PSIZE)x$(PSIZE)! -background transparent $< )"; done; \ convert $$SEQ +append $@ particle.%.ps: particle.%.dvi dvips -o $@ $< particle.%.dvi: particle.%.tex latex $< particle.png: $(PARTICLES) convert $(PARTICLES) -append $@ install: $(FILELIST) # [ -e $(PREFIX)/map/diagram ] || mkdir -f $(PREFIX)/map/diagram install -d $(PREFIX) install -d $(PREFIX)/map install -d $(PREFIX)/map/diagram install -m 444 $(FILELIST) $(PREFIX)/map/diagram clean: rm -rf *tmp* realclean: clean rm -rf diagram diag.png diag.epsi diag.dvi *.log *.ps *.epsi $(FILELIST) *~ *.dvi *.aux *.png *.jpg *.tbz2 map