Files
pybricks-api/doc/api/diagram_source/Makefile
T
David Lechner 402991fce8 config: add support for inkscape 1.x
There are breaking command line option changes between 0.9.x and 1.x.
2020-04-02 20:44:36 -05:00

26 lines
566 B
Makefile
Executable File

SRC_DIR = .
OUT_DIR = ../images
POSTFIX := _label
SVG := $(wildcard $(SRC_DIR)/*.svg)
DIAGRAMS := $(patsubst $(SRC_DIR)/%.svg,$(OUT_DIR)/%$(POSTFIX).png,$(SVG))
DIR := ${CURDIR}
all: $(DIAGRAMS)
clean:
rm -f $(DIAGRAMS)
$(OUT_DIR)/%$(POSTFIX).png: $(SRC_DIR)/%.svg
if inkscape --version | grep -q "Inkscape 0"; then \
inkscape --file=$(DIR)/$< --export-area-drawing --export-png=$(DIR)/$@; \
else \
inkscape \
--export-area-drawing \
--export-background=white \
--export-background-opacity=1.0 \
--export-file=$(DIR)/$@ \
$(DIR)/$<; \
fi