From 583d97cae7bbe5a9c70cd620934b0fcb0a6c8a44 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 28 Jan 2014 21:16:24 +0100 Subject: [PATCH] explain how to run Mitsuba from Makefiles (suggested by William Newman) --- doc/misc.tex | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/misc.tex b/doc/misc.tex index 890915db..c7fda81d 100644 --- a/doc/misc.tex +++ b/doc/misc.tex @@ -46,3 +46,14 @@ who want to do their own color processing in a space with a wide gamut. Finally, sRGB output is still possible. However, the color processing used in this case is fairly na\"ive: out-of-gamut values are simply clipped. This is something that may be improved in the future (e.g. by making use of a color management library like \code{lcms2}) + +\subsection{Using Mitsuba from Makefiles} +Sometimes it is useful to run \code{mitsuba} from a standard Unix Makefile. This is a bit inconvenient because shell commands in Makefiles are executed using the +classic \code{sh} shell, which is incompatible with the \code{setpath.sh} script. +A simple workaround in this case is to explicitly call \code{bash} or \code{zsh}, e.g. +\begin{shell} +MITSUBA_HOME=$\langle$..$\rangle$ +%.exr: %.xml + bash -c ". $\texttt{\$}$(MITSUBA_HOME)/setpath.sh; mitsuba -o $\texttt{\$}$@ $\texttt{\$}$<" +\end{shell} +