forked from LibreWeb/kicad-schlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (27 loc) · 979 Bytes
/
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
LIBFILES=$(wildcard library/*.lib)
DCMFILES=$(patsubst %.lib,%.dcm,${LIBFILES})
PVFILES=$(addprefix preview/,$(patsubst %.lib,%.md,$(notdir ${LIBFILES})))
IMAGECACHE:=$(shell mktemp)
DBFILES=$(shell find bomtool-db -type f)
TMPDIR := $(shell mktemp -d)
BOMTOOL ?= $$(which bomtool)
.PHONY: all dcmfiles bom_check
%.dcm: %.lib ${DBFILES}
@echo $<
@./scripts/libfile_tool.py import_descrs $^ <$@ >${TMPDIR}/$$(basename $@)
@mv ${TMPDIR}/$$(basename $@) $@
all: ${PVFILES} ${DCMFILES}
rm -f ${IMAGECACHE}
@#./scripts/cleanup.py images
dcmfiles: ${DCMFILES}
bom_check: ${LIBFILES}
for f in ${LIBFILES}; do \
./scripts/libfile_tool.py bom_check $$f $$(which bomtool); \
done
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