# Makefile para processar as entregas de exercício de POV-Ray # Last edited on 2003-12-15 01:16:59 by stolfi .SUFFIXES: # Large portrait # # WIDTH := 480 # HEIGHT := 640 # # ICONWIDTH := 75 # ICONHEIGHT := 100 # Small landscape # # WIDTH := 320 # HEIGHT := 240 # # ICONWIDTH := 80 # ICONHEIGHT := 60 # Medium landscape WIDTH := 480 HEIGHT := 360 ICONWIDTH := 80 ICONHEIGHT := 60 NRAYS = 2 OTHERINPUTS := dados.inc # No need to change below here NAME = main POVPUB := /home/staff/stolfi/pkg/povray-3.50c-1/PUB POVRAY := ${POVPUB}/i686-Linux-2.2/bin/povray POVINC := ${POVPUB}/share/povray-3.5/include POVTTF := /home/staff/stolfi/PUB/povray/tt-fonts TOOLDIR := /home/staff/stolfi/public_html/courses/mc930-2003-2-A/progs/tools # These are defined with "=" rather than ":=" in order to defer expansion DIRTAIL = ${shell pwd | sed -e 's:^.*/::'} IMVIEW = display -title "${DIRTAIL}/%f" .PHONY: all cleanup image showimage all-images index all: checkext image showimage cleanup: -/bin/rm -f ${NAME}.png -/bin/rm -f ${NAME}-*-i.png ${NAME}-i.png -/bin/rm -f ${NAME}-*.log ${NAME}.log image: ${NAME}.png showimage: ${NAME}.png -${IMVIEW} ${NAME}.png ${NAME}.png: checkext ${NAME}.pov ${OTHERINPUTS} -/bin/rm -f ${NAME}.png nice ${POVRAY} \ +FN +Q9 \ +W${WIDTH} +H${HEIGHT} \ +AM1 +A0.0 +R${NRAYS} \ +D +SP32 +EP4 \ +L${POVINC} \ +L${POVTTF} \ +I${NAME}.pov \ +O${NAME}.png all-images: rausrs.txt ${TOOLDIR}/make-all-images \ `cat rausrs.txt | egrep -v '^ *([#]|$$)' | gawk '//{print $$1;}' ` INDEXOPTS := -iconHeight ${ICONHEIGHT} index: title.txt rausrs.txt aus.txt \ absent.png absent-i.png \ missing.png missing-i.png dir=`pwd`; \ if [ "$${dir##*/}" = "aula" ]; then \ ${TOOLDIR}/make-labday-image-page ${INDEXOPTS} "`cat title.txt`" ; \ else \ ${TOOLDIR}/make-labday-image-page ${INDEXOPTS} -absentOK "`cat title.txt`" ; \ fi index-orig: title.txt rausrs.txt aus.txt \ absent.png absent-i.png \ missing.png missing-i.png ${TOOLDIR}/make-labday-image-page ${INDEXOPTS} -absentOK -original "`cat title.txt`" absent.png: Makefile ppmmake 'rgbi:0.75/0.75/0.75' ${WIDTH} ${HEIGHT} \ | pnmdepth 255 \ | ppmquant 254 \ | convert PPM:- absent.png -${IMVIEW} absent.png missing.png: Makefile ppmmake 'rgbi:0.80/0.15/0.15' ${WIDTH} ${HEIGHT} \ | pnmdepth 255 \ | ppmquant 254 \ | convert PPM:- missing.png -${IMVIEW} missing.png %-i.png: %.png convert $*.png \ -geometry "x${ICONHEIGHT}" \ +profile '*' \ -colors 254 -dither \ $*-i.png ###################################################################### # Rules to compile and run the filter programs DATAFILE := dados.dat INCFILE := dados.inc FILTER := filtro ${INCFILE}: ${FILTER} ${DATAFILE} ${FILTER} FILTERSRC := ${shell ls ${FILTER}.* | grep -v '~' | head -1} EXT := ${shell echo ${FILTERSRC} | sed 's:^.*[.]::'} checkext: @echo EXT = "${EXT}" ifeq ".${EXT}" ".c" ${FILTER}: ${FILTER}.c gcc -o ${FILTER} ${FILTER}.c -lm endif ifeq ".${EXT}" ".pas" ${FILTER}: ${FILTER}.pas gpc -o ${FILTER} ${FILTER}.pas -lm endif ifeq ".${EXT}" ".sh" ${FILTER}: ${FILTER}.sh ln -s ${FILTER}.sh ${FILTER} endif ifeq ".${EXT}" ".pl" ${FILTER}: ${FILTER}.pl ln -s ${FILTER}.pl ${FILTER} endif ifeq ".${EXT}" ".gawk" ${FILTER}: ${FILTER}.gawk ln -s ${FILTER}.gawk ${FILTER} endif ifeq ".${EXT}" ".py" ${FILTER}: ${FILTER}.py ln -s ${FILTER}.py ${FILTER} endif ifeq ".${EXT}" ".tcl" ${FILTER}: ${FILTER}.tcl ln -s ${FILTER}.tcl ${FILTER} endif