2010-10-17 06:57:22 +03:00
|
|
|
BOOM=PATH=/home/moko/svn.openmoko.org/trunk/eda/boom:../boom:$$PATH boom
|
|
|
|
|
|
|
|
UC_NAME = $(shell echo $(NAME) | tr [a-z] [A-Z])
|
|
|
|
|
2010-10-18 02:07:54 +03:00
|
|
|
EQU = $(shell ../../boom-config equ)
|
2010-10-17 06:57:22 +03:00
|
|
|
|
2010-10-18 23:23:19 +03:00
|
|
|
.PHONY: all test spotless sane
|
2010-10-17 06:57:22 +03:00
|
|
|
|
|
|
|
all: $(NAME).chr
|
|
|
|
|
|
|
|
$(NAME).chr: $(EQU) $(NAME).gen
|
2010-10-24 19:10:00 +03:00
|
|
|
$(BOOM) gen2chr $(UC_NAME) $^ >$@ || { rm -f $@; exit 1; }
|
2010-10-17 06:57:22 +03:00
|
|
|
|
|
|
|
test:
|
|
|
|
$(BOOM) gen2chr -n $(UC_NAME) $(EQU) $(NAME).gen
|
2010-10-17 19:15:33 +03:00
|
|
|
|
|
|
|
LIMIT = sed '1{x;s/.*/--- $(1) ---/p;x;};6{s/.*/.../;q;}'
|
|
|
|
|
|
|
|
MALFORMED = @grep '\<T=$(2)\>' $(NAME).chr | \
|
2010-10-18 23:23:19 +03:00
|
|
|
grep -v '\<$(3)=\(0R\|[1-9][0-9.]*[fnpumkMG]\?$(4)\)\>' | \
|
2010-10-17 19:15:33 +03:00
|
|
|
$(call LIMIT,$(1))
|
|
|
|
|
|
|
|
ABSENT = @grep '\<T=$(2)\>' $(NAME).chr | grep -v '\<$(3)=' | \
|
|
|
|
$(call LIMIT,$(1))
|
|
|
|
|
2010-10-18 23:23:19 +03:00
|
|
|
spotless:
|
|
|
|
rm -f $(NAME).chr
|
|
|
|
|
2010-10-17 19:15:33 +03:00
|
|
|
sane:
|
|
|
|
@# general
|
|
|
|
|
|
|
|
$(call ABSENT,FP missing,.*,FP)
|
|
|
|
|
|
|
|
@# R
|
|
|
|
|
|
|
|
$(call MALFORMED,Malformed R=,R,R,R)
|
|
|
|
$(call ABSENT,T=R without ",R,P)
|
|
|
|
@# special case: 0R has no meaningful tolerance
|
|
|
|
@grep '\<T=R\>' $(NAME).chr | grep -v '\<R=0R\>' | \
|
|
|
|
grep -v '\<TOL=' | $(call LIMIT,T=R without TOL)
|
|
|
|
@# V is optional
|
|
|
|
@# TC ?
|
|
|
|
|
|
|
|
@# C
|
|
|
|
|
|
|
|
$(call MALFORMED,Malformed C=,C,C,F)
|
|
|
|
$(call ABSENT,T=C without M,C,M)
|
|
|
|
$(call ABSENT,T=C without V,C,V)
|
|
|
|
$(call ABSENT,T=C without TOL,C,TOL)
|