1
0
mirror of git://projects.qi-hardware.com/cae-tools.git synced 2024-12-23 08:39:33 +02:00

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
This commit is contained in:
Werner Almesberger 2010-09-26 20:11:57 -03:00
parent 5170410012
commit ffb0d99a69
2 changed files with 24 additions and 12 deletions

View File

@ -53,27 +53,39 @@ spotless: clean
# ----- Experimental execution ------------------------------------------------ # ----- 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 PRJ=http://projects.qi-hardware.com/index.php/p/ben-scans/source/tree/master
DIR=$(PRJ)/data/csv DIR=$(PRJ)/data/csv
FACE_A=$(DIR)/ben-batcvr-outside-100um.txt.bz2 FACE_A=$(DIR)/ben-$(NAME)-$(TOP)-100um.txt.bz2
FACE_B=$(DIR)/ben-batcvr-inside-100um.txt.bz2 FACE_B=$(DIR)/ben-$(NAME)-$(BOTTOM)-100um.txt.bz2
D=1.16
.PHONY: new run pov disp .PHONY: new run pov disp
# always regenerate main.pov, e.g., if NAME is changed via the command line
.PHONY: main.pov
new: solidify new: solidify
rm -f batcvr.sfy rm -f $(NAME).sfy
./solidify batcvr.sfy $(FACE_A) $(FACE_B) $(D) >batcvr.inc ./solidify $(NAME).sfy $(FACE_A) $(FACE_B) $(D) >$(NAME).inc
run: solidify run: solidify
./solidify batcvr.sfy >batcvr.inc ./solidify $(NAME).sfy >$(NAME).inc
pov: pov: main.pov
povray +A +P -W1280 -H1024 main.pov povray +A +P -W1280 -H900 main.pov
disp: disp:
display main.png display main.png
main.pov: template.pov
sed 's/NAME/$(NAME)/' template.pov >$@ || { rm -f $@; exit 1; }
# ----- Dependencies ---------------------------------------------------------- # ----- Dependencies ----------------------------------------------------------
# compile and generate dependencies, from fped, based on # compile and generate dependencies, from fped, based on

View File

@ -1,5 +1,5 @@
#include "colors.inc" #include "colors.inc"
#include "batcvr.inc" #include "NAME.inc"
/* /*
* POV-Ray defaults to a "camera" coordinate system that can be confusing. * 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 { object {
Part_batcvr Part_NAME
pigment { rgbf <0.9, 0.9, 0.9, 0.2> } pigment { rgbf <0.9, 0.9, 0.9, 0.2> }
finish { Finish } finish { Finish }
rotate <0, 0, 30> rotate <0, 0, 30>
} }
object { object {
Part_batcvr Part_NAME
pigment { rgbf <1, 0.8, 0.8, 0.2> } pigment { rgbf <1, 0.8, 0.8, 0.2> }
finish { Finish } finish { Finish }
translate <0, 0, 25> translate <0, 0, 25>
@ -66,7 +66,7 @@ object {
} }
object { object {
Part_batcvr Part_NAME
pigment { rgbf <0.8, 1, 1, 0.2> } pigment { rgbf <0.8, 1, 1, 0.2> }
finish { Finish } finish { Finish }
rotate <180, 0, 0> rotate <180, 0, 0>