# Last edited on 2023-12-31 10:52:43 by stolfi # Makefile for static image labs # To be included in a Makefile # The Makefile must define ${WIDTH} ${HEIGHT} ${ICONWIDTH} ${ICONHEIGHT} SHELL := /bin/bash NRAYS = 2 OTHERINPUTS := ${wildcard *.inc pic-*.{png.jpg,JPG}} # Automatic "make showXXX" after "make XXX": SHOW := YES # Show POV-Ray progress: POVSHOW := YES ROOTNAME = main POVFILE := ${ROOTNAME}.pov # POV-Ray installation directories: POVRAY := /usr/bin/povray POVINC := /usr/share/povray-3.7/include/ TOPDIR := ../../.. POVTTF := tt-fonts POVFILTER := mc937_povray_error_filter.gawk # POVFILTER := cat # Note: defined with "=" rather than ":=" DIRTAIL = ${shell pwd | sed -e 's:^.*/::'} IMVIEW = display -title "${DIRTAIL}/%f" .PHONY: \ all \ clean \ image \ showimage PNGFILE := ${ROOTNAME}.png all: image image: ${PNGFILE} @if [[ "/${SHOW}" == "/YES" ]]; then make showimage ; fi showimage: @if [[ -s ${PNGFILE} ]]; then \ ${IMVIEW} ${PNGFILE} ; \ else \ echo "** file ${PNGFILE} not found" 1>&2 ; exit 1 ; \ fi ifeq "/${POVSHOW}" "/YES" POVSHOWOP := +D else POVSHOWOP := -D endif ${PNGFILE}: ${POVFILE} ${OTHERINPUTS} -/bin/rm -f ${PNGFILE} nice ${POVRAY} \ +FN +Q9 \ +W${WIDTH} +H${HEIGHT} \ ${POVSHOWOP} \ +AM1 +A0.0 +R${NRAYS} \ +L${POVINC} \ +L${POVTTF} \ +I${POVFILE} \ +O${PNGFILE} \ 2>&1 \ | ${POVFILTER} clean: -/bin/rm -f ${PNGFILE} -/bin/rm -f ${ROOTNAME}-*-i.png ${ROOTNAME}-i.png -/bin/rm -f ${ROOTNAME}-*.log ${ROOTNAME}.log