2016-08-02 17:00:08 +03:00
|
|
|
#
|
|
|
|
# Makefile - build eeshow
|
|
|
|
#
|
|
|
|
# Written 2016 by Werner Almesberger
|
|
|
|
# Copyright 2016 by Werner Almesberger
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
|
|
|
|
NAME = eeshow
|
|
|
|
OBJS = main.o sch-parse.o sch-render.o lib-parse.o lib-render.o \
|
2016-08-07 01:14:31 +03:00
|
|
|
gui.o gui-over.o gui-aoi.o fmt-pango.o \
|
2016-08-07 20:05:57 +03:00
|
|
|
file.o git-util.o git-file.o git-hist.o delta.o \
|
2016-08-02 17:00:08 +03:00
|
|
|
style.o fig.o record.o cro.o diff.o gfx.o dwg.o text.o misc.o
|
|
|
|
|
|
|
|
CFLAGS = -g -Wall -Wextra -Wno-unused-parameter -Wshadow \
|
|
|
|
-Wmissing-prototypes -Wmissing-declarations \
|
|
|
|
`pkg-config --cflags cairo` \
|
2016-08-03 13:38:57 +03:00
|
|
|
`pkg-config --cflags libgit2` \
|
|
|
|
`pkg-config --cflags gtk+-3.0`
|
2016-08-02 17:00:08 +03:00
|
|
|
LDLIBS = -lm \
|
2016-08-03 13:38:57 +03:00
|
|
|
`pkg-config --libs cairo` \
|
|
|
|
`pkg-config --libs libgit2` \
|
|
|
|
`pkg-config --libs gtk+-3.0`
|
2016-08-02 17:00:08 +03:00
|
|
|
|
|
|
|
include ../common/Makefile.c-common
|
|
|
|
|
2016-08-02 22:26:33 +03:00
|
|
|
.PHONY: test neo900 sch test testref png pngref pdf diff view newref
|
2016-08-02 17:00:08 +03:00
|
|
|
|
|
|
|
all:: $(NAME)
|
|
|
|
|
|
|
|
$(NAME): $(OBJS)
|
|
|
|
$(CC) -o $(NAME) $(OBJS) $(LDLIBS)
|
|
|
|
|
|
|
|
#----- Test sheet -------------------------------------------------------------
|
|
|
|
|
|
|
|
sch:
|
|
|
|
eeschema test.sch
|
|
|
|
|
|
|
|
test: $(NAME)
|
2016-08-06 03:16:56 +03:00
|
|
|
./$(NAME) test.lib test.sch -- fig >out.fig
|
2016-08-02 17:00:08 +03:00
|
|
|
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)
|
2016-08-06 03:16:56 +03:00
|
|
|
./$(NAME) test.lib test.sch -- fig | \
|
|
|
|
fig2dev -L png -m 2 >ref.png
|
2016-08-02 17:00:08 +03:00
|
|
|
|
|
|
|
png: $(NAME)
|
|
|
|
./$(NAME) test.lib test.sch -- png -o _out.png -s 2
|
|
|
|
[ ! -r pngref.png ] || \
|
|
|
|
compare -metric AE pngref.png _out.png _diff.png || \
|
|
|
|
qiv -t -R -D _diff.png pngref.png _out.png
|
|
|
|
|
|
|
|
pngref: $(NAME)
|
|
|
|
./$(NAME) test.lib test.sch -- png -o pngref.png -s 2
|
|
|
|
|
|
|
|
clean::
|
|
|
|
rm -f out.fig _out.png _diff.png
|
|
|
|
|
|
|
|
#----- Render Neo900 schematics -----------------------------------------------
|
|
|
|
|
|
|
|
NEO900_HW = ../../../n9/ee/hw
|
|
|
|
KICAD_LIBS = ../../kicad-libs/components
|
|
|
|
|
|
|
|
SHEET ?= 12
|
|
|
|
|
|
|
|
neo900: $(NAME)
|
|
|
|
./$(NAME) $(NEO900_HW)/neo900.lib \
|
|
|
|
$(KICAD_LIBS)/powered.lib \
|
|
|
|
$(NEO900_HW)/neo900_SS_$(SHEET).sch \
|
|
|
|
>out.fig
|
|
|
|
|
|
|
|
neo900.pdf: $(NAME) sch2pdf neo900-template.fig
|
|
|
|
./sch2pdf -o $@ -t neo900-template.fig \
|
|
|
|
$(NEO900_HW)/neo900.lib $(KICAD_LIBS)/powered.lib \
|
|
|
|
$(NEO900_HW)/neo900.sch
|
|
|
|
|
2016-08-02 22:26:33 +03:00
|
|
|
pdf: $(NAME)
|
2016-08-02 22:38:21 +03:00
|
|
|
./eeshow -r neo900.lib kicad-libs/components/powered.lib \
|
2016-08-02 22:26:33 +03:00
|
|
|
$(NEO900_HW)/neo900.sch -- pdf -o neo900.pdf
|
|
|
|
|
2016-08-02 17:00:08 +03:00
|
|
|
#----- Regression test based on Neo900 schematics -----------------------------
|
|
|
|
|
|
|
|
diff: $(NAME)
|
|
|
|
test/genpng test out
|
|
|
|
test/comp test || $(MAKE) view
|
|
|
|
|
|
|
|
view:
|
|
|
|
qiv -t -R -D `echo test/_diff*.png | \
|
|
|
|
sed 's/\([^ ]*\)_diff\([^ ]*\)/\1_diff\2 \1ref\2 \1out\2/g'`
|
|
|
|
|
|
|
|
newref:
|
|
|
|
test/genpng test ref
|