forked from LibreWeb/kicad-schlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (43 loc) · 1.36 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
LIBFILES=$(wildcard library/*.lib)
DCMFILES=$(patsubst %.lib,%.dcm,${LIBFILES})
PVFILES=$(addprefix preview/,$(patsubst %.lib,%.md,$(notdir ${LIBFILES})))
TESTFILES=$(addprefix test-results/,$(notdir ${PVFILES}))
IMAGECACHE:=$(shell mktemp)
DBFILES=$(shell find bomtool-db -type f)
TMPDIR := $(shell mktemp -d)
PCBLIB_PATH := "../pcblib"
.PHONY: all clean check
all: ${PVFILES}
rm -f ${IMAGECACHE}
@#./scripts/cleanup.py images
check: error-report.md
@if [ -d test-todo ]; then \
diff -uwBdN -x '*~' --color=always -I '^- \[x\]' -I '^#' \
test-todo test-results && echo "No new errors" || true ; \
fi
@[ ! -s $< ] || echo "Errors remain!, check $<" && false
test-todo: ${TESTFILES}
mkdir -p $@
@echo 'cp $$TESTFILES $@/'
@cp $^ $@/
find $@ -empty -type f -delete
error-report.md: ${TESTFILES}
@echo 'cat $$TESTFILES > $@'
@cat $^ > $@
test-results:
mkdir -p $@
test-results/%.md: library/%.lib | test-results
./scripts/tests.py -k --pcblib-path ${PCBLIB_PATH} $< > $@
clean:
rm -rf preview/
rm -rf test-results/
rm -f error-report.md
distclean: clean
rm -rf test-todo/
preview/%.md: library/%.lib
mkdir -p preview/images
if [ -f $(patsubst %.lib,%.dcm,$<) ]; then \
./scripts/schlib-render.py preview/images /images ${IMAGECACHE} $< $(patsubst %.lib,%.dcm,$<) > $@; \
else \
./scripts/schlib-render.py preview/images /images ${IMAGECACHE} $< > $@; \
fi