summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-11-29 15:25:38 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-11-29 15:25:38 -0500
commit2ea1da41e818da39339360ca6ea67cc47839b22f (patch)
tree04d7779c73cd7523e8f624fa60363e359617174c
parentb62a23efaff3332caf5b2fa51f63d256ee154a94 (diff)
Use a Makefile to generate '.png's
-rw-r--r--.gitignore10
-rw-r--r--Makefile39
-rw-r--r--dir.pngbin652 -> 0 bytes
-rw-r--r--file.pngbin622 -> 0 bytes
-rw-r--r--iso.pngbin1066 -> 0 bytes
-rw-r--r--parent.pngbin672 -> 0 bytes
-rw-r--r--pkg.pngbin831 -> 0 bytes
-rw-r--r--repo.pngbin768 -> 0 bytes
-rw-r--r--tar.pngbin679 -> 0 bytes
-rw-r--r--torrent.pngbin890 -> 0 bytes
-rw-r--r--txt.pngbin683 -> 0 bytes
11 files changed, 49 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index b25c15b..40cf349 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,11 @@
+*.svg.png
*~
+dir.png
+file.png
+iso.png
+parent.png
+pkg.png
+repo.png
+tar.png
+torrent.png
+txt.png
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ce74c24
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,39 @@
+# SVG2PNG: Each is buggy in their own way
+# ImageMagick: doesn't support transparency
+#SVG2PNG = convert $1 -format png $(if $3,-resize $3x)$(if $4,$4) $(if $5,-bacground $5) $2
+# librsvg: doesn't support <style> element
+#SVG2PNG = rsvg-convert $1 -o $2 $(if $3,-w $3) $(if $4,-h $4) $(if $5,--background-color=$5)
+# Inkscape: messes up gradients
+SVG2PNG = inkscape $1 --export-png $2 $(if $3,-w $3) $(if $4,-h $4) $(if $5,-b '$5')
+
+# pngcrush is available from [pcr]
+#PNGCRUSH = cp $1 $2
+PNGCRUSH = pngcrush $1 $2
+
+default: PHONY all
+
+dir.png = /usr/share/icons/oxygen/16x16/mimetypes/inode-directory.png
+file.png = /usr/share/icons/oxygen/16x16/mimetypes/unknown.png
+iso.png = /usr/share/icons/oxygen/16x16/devices/media-optical.png
+parent.png = /usr/share/icons/oxygen/16x16/actions/go-up.png
+pkg.png = pkg.svg.png
+repo.png = /usr/share/icons/oxygen/16x16/places/folder-tar.png
+tar.png = tar.svg.png
+torrent.png = /usr/share/icons/oxygen/16x16/actions/download.png
+txt.png = /usr/share/icons/oxygen/16x16/mimetypes/text-plain.png
+
+pngs := $(shell sed -n 's/\.png\s*=.*/.png/p' $(MAKEFILE_LIST))
+$(foreach png,$(pngs),$(eval $(png): $($(png)); $$(call PNGCRUSH,$$<,$$@)))
+
+all: PHONY $(pngs) .gitignore
+
+clean: PHONY
+ rm -f -- $(pngs) *.svg.png
+.gitignore: $(MAKEFILE_LIST)
+ printf '%s\n' '*~' '*.svg.png' $(pngs) | LC_COLLATE=C sort > .gitignore
+
+%.svg.png: %.svg
+ $(call SVG2PNG,$<,$@,16)
+
+.PHONY: PHONY
+.DELETE_ON_ERROR:
diff --git a/dir.png b/dir.png
deleted file mode 100644
index 3da2ca9..0000000
--- a/dir.png
+++ /dev/null
Binary files differ
diff --git a/file.png b/file.png
deleted file mode 100644
index 222832a..0000000
--- a/file.png
+++ /dev/null
Binary files differ
diff --git a/iso.png b/iso.png
deleted file mode 100644
index 612fc81..0000000
--- a/iso.png
+++ /dev/null
Binary files differ
diff --git a/parent.png b/parent.png
deleted file mode 100644
index b3d9cef..0000000
--- a/parent.png
+++ /dev/null
Binary files differ
diff --git a/pkg.png b/pkg.png
deleted file mode 100644
index ef02804..0000000
--- a/pkg.png
+++ /dev/null
Binary files differ
diff --git a/repo.png b/repo.png
deleted file mode 100644
index 5d0412f..0000000
--- a/repo.png
+++ /dev/null
Binary files differ
diff --git a/tar.png b/tar.png
deleted file mode 100644
index e1634bd..0000000
--- a/tar.png
+++ /dev/null
Binary files differ
diff --git a/torrent.png b/torrent.png
deleted file mode 100644
index 7165d1b..0000000
--- a/torrent.png
+++ /dev/null
Binary files differ
diff --git a/txt.png b/txt.png
deleted file mode 100644
index 01b07e8..0000000
--- a/txt.png
+++ /dev/null
Binary files differ