From 3dc74fcac83363616b0b3fd4906a7140c8135d03 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 5 Sep 2011 08:11:59 -0300 Subject: [PATCH] labsw/mech/Makefile: fixed error handling of pipes; target "pos" for positioning --- labsw/mech/Makefile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/labsw/mech/Makefile b/labsw/mech/Makefile index 59cdcdf..d1084c0 100644 --- a/labsw/mech/Makefile +++ b/labsw/mech/Makefile @@ -1,17 +1,19 @@ +SHELL=/bin/bash + SPOOL=/home/moko/svn.openmoko.org/developers/werner/cncmap/spool/spool CNGT=/home/qi/cae-tools/cngt/cngt -.PHONY: all mill cng plot clean +.PHONY: all mill pos cng plot clean all: mill.rml front.gp: front.fpd - fped -g -1 front-cut $< - | ./filter !logo >$@ || \ - { rm -f $@; exit 1; } + fped -g -1 front-cut $< - | ./filter !logo >$@; \ + [ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $@; exit 1; } logo.gp: front.fpd - fped -g -1 front-cut $< - | ./filter logo >$@ || \ - { rm -f $@; exit 1; } + fped -g -1 front-cut $< - | ./filter logo >$@; \ + [ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $@; exit 1; } mill.rml mill.gp: front.gp logo.gp ./doit BOARD_Z=1.6mm ENGRAVE_Z=0.5mm CLEARANCE=3mm || \ @@ -20,6 +22,9 @@ mill.rml mill.gp: front.gp logo.gp mill: mill.rml PORT=/dev/ttyUSB0 $(SPOOL) mill.rml +pos: mill.gp + $(CNGT) -57.4 + cng: mill.gp $(CNGT) -57.4 20 mill.gp