From ffb0d99a690515b49f7d1b5b6ce79deb740e01a0 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 26 Sep 2010 20:11:57 -0300 Subject: [PATCH] Make new/run/pov/disp are now configurable when invoking make. Example: make NAME=lcdframe D=0.8 TOP=front BOTTOM=back new - solidify/Makefile (new, run, pov, disp): test run targets can now be configured by setting make variables on the command line - solidify/main.pov: renamed to template.pov and changed all occurrences of "batcvr" to "NAME" - solidify/Makefile: generate main.pov from template.pov --- solidify/Makefile | 28 ++++++++++++++++++++-------- solidify/{main.pov => template.pov} | 8 ++++---- 2 files changed, 24 insertions(+), 12 deletions(-) rename solidify/{main.pov => template.pov} (95%) diff --git a/solidify/Makefile b/solidify/Makefile index a2b790c..f9057cf 100644 --- a/solidify/Makefile +++ b/solidify/Makefile @@ -53,27 +53,39 @@ spotless: clean # ----- Experimental execution ------------------------------------------------ +NAME=baseframe +TOP=top +BOTTOM=bottom +D=0.86 + PRJ=http://projects.qi-hardware.com/index.php/p/ben-scans/source/tree/master DIR=$(PRJ)/data/csv -FACE_A=$(DIR)/ben-batcvr-outside-100um.txt.bz2 -FACE_B=$(DIR)/ben-batcvr-inside-100um.txt.bz2 -D=1.16 +FACE_A=$(DIR)/ben-$(NAME)-$(TOP)-100um.txt.bz2 +FACE_B=$(DIR)/ben-$(NAME)-$(BOTTOM)-100um.txt.bz2 + .PHONY: new run pov disp +# always regenerate main.pov, e.g., if NAME is changed via the command line +.PHONY: main.pov + + new: solidify - rm -f batcvr.sfy - ./solidify batcvr.sfy $(FACE_A) $(FACE_B) $(D) >batcvr.inc + rm -f $(NAME).sfy + ./solidify $(NAME).sfy $(FACE_A) $(FACE_B) $(D) >$(NAME).inc run: solidify - ./solidify batcvr.sfy >batcvr.inc + ./solidify $(NAME).sfy >$(NAME).inc -pov: - povray +A +P -W1280 -H1024 main.pov +pov: main.pov + povray +A +P -W1280 -H900 main.pov disp: display main.png +main.pov: template.pov + sed 's/NAME/$(NAME)/' template.pov >$@ || { rm -f $@; exit 1; } + # ----- Dependencies ---------------------------------------------------------- # compile and generate dependencies, from fped, based on diff --git a/solidify/main.pov b/solidify/template.pov similarity index 95% rename from solidify/main.pov rename to solidify/template.pov index 1f2bce3..5563e3f 100644 --- a/solidify/main.pov +++ b/solidify/template.pov @@ -1,5 +1,5 @@ #include "colors.inc" -#include "batcvr.inc" +#include "NAME.inc" /* * POV-Ray defaults to a "camera" coordinate system that can be confusing. @@ -51,14 +51,14 @@ sphere { < 0, 0, 10>, 1 pigment { color Yellow } } } object { - Part_batcvr + Part_NAME pigment { rgbf <0.9, 0.9, 0.9, 0.2> } finish { Finish } rotate <0, 0, 30> } object { - Part_batcvr + Part_NAME pigment { rgbf <1, 0.8, 0.8, 0.2> } finish { Finish } translate <0, 0, 25> @@ -66,7 +66,7 @@ object { } object { - Part_batcvr + Part_NAME pigment { rgbf <0.8, 1, 1, 0.2> } finish { Finish } rotate <180, 0, 0>