[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: gnetlist in a Makefile



On Wed, Feb 02, 2005 at 05:13:54PM -0500, Stuart Brorson wrote:
> That won't work.  Peter's problem is a toughie.
> 
> The problem is that gnetlist doesn't return an error code to the shell
> based upon its success in netlisting.  Therefore, your suggestion
> won't work.

If you use (error "some message") in the backend, you'll get a non-zero
error code.

I think the cascade backend does this on some fatal error condition, but
I haven't looked at that much in a while.

> My thought is to do something like this:
> 
> $(objects).cir: $(objects).sch $(objects).spc
>         gnetlist -g drc2 $(objects).sch -o $(objects).drc
> 	if [-z [grep ERROR $(objects).drc]]; then  \
>           gnetlist -g spice-sdb $(objects).sch  -o $(objects).cir \
> 	else \
> 	  echo "Failed DRC test!" \
> 	fi
> 
> I haven't tested this and my bash skills are terrible, but if you play
> around with this you might get somewhere. . . .
> 

I might change slightly to

	if grep ERROR $(objects).drc >/dev/null ; then \
		echo "Failed DRC test!" ; false ; \
	fi

Also, I'd do something like

$(objects).cir: $(objects).drc $(objects).spc
	gnetlist -g spice-sdb $(objects).sch  -o $(objects).cir

$(objects).drc: $(objects).sch
	gnetlist -g drc2 $(objects).sch -o $@
	if grep ERROR $(objects).drc >/dev/null ; then \
		echo "Failed DRC test!" ; false ; \
	fi


-Dan

--