From 3a0cfc3f479ad6aab3a392a8015ebd39e9eba39c Mon Sep 17 00:00:00 2001
From: knittl <knittl@b9310e46-f624-0410-8ea1-cfbb3a30dc96>
Date: Sun, 29 Mar 2015 19:02:28 +0000
Subject: Add flat-style keyboard svgs to makefile

git-svn-id: https://svn.neo-layout.org@2466 b9310e46-f624-0410-8ea1-cfbb3a30dc96
---
 grafik/Makefile | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/grafik/Makefile b/grafik/Makefile
index d9e8797..79613f5 100644
--- a/grafik/Makefile
+++ b/grafik/Makefile
@@ -8,7 +8,7 @@ EBENENPNG=$(addsuffix .png,$(basename ${EBENENSVG} ${HAUPT} ${ZIFFERN} ${HAUPTZI
 
 SVGFILES=$(filter-out ./tastatur3d/tastatur_neo_%.svg, $(shell find -name "*.svg")) ref2svg/ref2svg.svg
 PDFFILES=$(filter-out ./promotion-material/Flyer-fs/neo_logo.pdf, $(addsuffix .pdf,$(basename ${SVGFILES})))
-PNGFILES=$(addsuffix .png,$(basename ${SVGFILES})) 
+PNGFILES=$(addsuffix .png,$(basename ${SVGFILES}))
 
 default: svg pdf png
 ref2svg/ref2svg.svg: ref2svg/ref2svg.pl ../A-REFERENZ-A/neo20.txt
@@ -67,6 +67,15 @@ tastatur3d/haupt_ziffern_feld/%.png: tastatur3d/hauptfeld/%.png tastatur3d/ziffe
 	inkscape --without-gui --export-png=$@ -w1000 $<
 	optipng $@
 
+FLATPNGS:=$(patsubst %.svg,%.png,$(wildcard flat/tastatur_e*.svg))
+
+$(FLATPNGS): flat/tastatur.css flat/tastatur_base.svg
+$(FLATPNGS): %.png: %.svg
+	sed -e "/^@import url('tastatur.css');$$/{r flat/tastatur.css" -e 'd;}' "$<" > "$<.imported.svg"
+	inkscape --without-gui --export-png="$@" "$<.imported.svg"
+	optipng "$@"
+	rm "$<.imported.svg"
+
 
 .PHONY: default clean \
 	pdf cleanpdf \
-- 
cgit v1.2.3