# Makefile to process POV-Ray lab hand-in files - STATIC IMAGES # Last edited on 2021-01-12 21:06:50 by jstolfi SHELL := /bin/bash FULLWIDTH := 720 FULLHEIGHT := 720 QUICKWIDTH := 360 QUICKHEIGHT := 360 NAME = main ICONNAME := ${NAME}-i OTHERINPUTS := ${wildcard *.inc} # POV-Ray installation directories: POVRAY := /usr/bin/povray POVINC := /usr/share/povray-3.7/include/ TOPDIR := ../../.. POVTTF := ${TOPDIR}/hand-in/tt-fonts POVFIL := povray_output_filter.gawk # These are defined with "=" rather than ":=" in order to defer expansion DIRTAIL = ${shell pwd | sed -e 's:^.*/::'} IMVIEW = display -title "${DIRTAIL}/%f" .PHONY: \ all all-student-files clean \ full showfull \ quick showquick \ image showimage # all: full all: full showimage all-student-files: full full: ${MAKE} NAME=${NAME} WIDTH=${FULLWIDTH} HEIGHT=${FULLHEIGHT} NRAYS=2 image quick: ${MAKE} NAME=${NAME} WIDTH=${QUICKWIDTH} HEIGHT=${QUICKHEIGHT} NRAYS=1 image clean: -/bin/rm -f ${NAME}.png ${NAME}.png ${ICONNAME}.png -/bin/rm -f ${NAME}.log ${NAME}.log ${ICONNAME}.log ###################################################################### # Recursive section: caller must define ${NAME} ${WIDTH} ${HEIGHT} ${NRAYS}. ifneq "/${NAME}" "/" ifneq "/${WIDTH}" "/" ifneq "/${HEIGHT}" "/" ifneq "/${NRAYS}" "/" image: ${NAME}.png POVFILE := main.pov ${NAME}.png: ${POVFILE} ${OTHERINPUTS} -/bin/rm -f ${NAME}.png nice ${POVRAY} \ +FN +Q9 \ +W${WIDTH} +H${HEIGHT} \ +AM1 +A0.0 +R${NRAYS} \ +D \ +L${POVINC} \ +L${POVTTF} \ +I${POVFILE} \ +O${NAME}.png \ 2>&1 \ | ${POVFIL} showimage: ${NAME}.png -if [[ -s ${NAME}.png ]]; then ${IMVIEW} ${NAME}.png ; fi endif endif endif endif # End of recursive section ###################################################################### # For the lab index page: absent.png: Makefile ppmmake 'rgbi:0.75/0.75/0.75' ${FULLWIDTH} ${FULLHEIGHT} \ | pnmdepth 255 \ | ppmquant 254 \ | convert PPM:- absent.png -${IMVIEW} absent.png missing.png: Makefile ppmmake 'rgbi:0.80/0.15/0.15' ${FULLWIDTH} ${FULLHEIGHT} \ | pnmdepth 255 \ | ppmquant 254 \ | convert PPM:- missing.png -${IMVIEW} missing.png