diff --git a/sch2fig/Makefile b/sch2fig/Makefile index 62a1ce1..67749e2 100644 --- a/sch2fig/Makefile +++ b/sch2fig/Makefile @@ -18,21 +18,35 @@ LIBS = -lm include ../common/Makefile.c-common -.PHONY: test neo900 test diff view newref +.PHONY: test neo900 sch test diff view newref all:: $(NAME) $(NAME): $(OBJS) $(CC) -o $(NAME) $(OBJS) $(LIBS) -NEO900_HW = ../../../n9/ee/hw -KICAD_LIBS = ../../kicad-libs/components +#----- Test sheet ------------------------------------------------------------- sch: eeschema test.sch test: $(NAME) ./$(NAME) test.lib test.sch >out.fig + fig2dev -L png -m 2 out.fig _out.png + [ ! -r ref.png ] || \ + ! compare -metric AE ref.png _out.png _diff.png || \ + qiv -t -R -D _diff.png ref.png _out.png + +testref: + ./$(NAME) test.lib test.sch | fig2dev -L png -m 2 >ref.png + +clean:: + rm -f out.fig _out.png _diff.png + +#----- Render Neo900 schematics ----------------------------------------------- + +NEO900_HW = ../../../n9/ee/hw +KICAD_LIBS = ../../kicad-libs/components SHEET ?= 12 @@ -47,6 +61,8 @@ neo900.pdf: $(NAME) sch2pdf neo900-template.fig $(NEO900_HW)/neo900.lib $(KICAD_LIBS)/powered.lib \ $(NEO900_HW)/neo900.sch +#----- Regression test based on Neo900 schematics ----------------------------- + diff: $(NAME) test/genpng test out test/comp test || $(MAKE) view