...
 
Commits (2)
#!/bin/make -f
SVGS=$(wildcard *.svg)
OUTPUTS=$(filter-out Stratum0_furutre, $(basename $(SVGS))) \
Stratum0_furutre-logo_only \
Stratum0_furutre-text_bottom \
Stratum0_furutre-text_right
PDFS=$(addsuffix .pdf,$(OUTPUTS))
PNGS=$(addsuffix .png,$(OUTPUTS))
all: pdf png
pdf: $(PDFS)
png: $(PNGS)
clean:
rm -f $(PDFS) $(PNGS)
inkscape-export-png = inkscape $(1) $(3) --export-dpi 96 --export-png $(2)
inkscape-export-pdf = inkscape $(1) $(3) --export-pdf $(2)
%.png: %.svg
$(call inkscape-export-png, $<, $@)
%.pdf: %.svg
$(call inkscape-export-pdf, $<, $@)
Stratum0_furutre-%: Stratum0_furutre.svg
@# part of the match before '.' is object ID, part after is file type
@# sadly inkscape --export-pdf export does not fit the page size
@# correctly, so we have to fit the page size with verbs, which needs an X
@# server running :-/
@# also inkscape's ability to apply verbs to layers is broken, so we
@# currently have to <svg:use> the common parts in each group :-/
@# see https://bugs.launchpad.net/inkscape/+bug/1652615
cp $< .Stratum0_furutre.tmp.svg
inkscape .Stratum0_furutre.tmp.svg \
--select=$(basename $*)_group \
--verb=FitCanvasToSelection \
--verb=FileSave \
--verb=FileQuit
@# extract file type from pattern match
$(call inkscape-export-$(word 2, $(subst ., ,$*)), .Stratum0_furutre.tmp.svg, $@)
rm .Stratum0_furutre.tmp.svg
This diff is collapsed.