summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-11-11 03:01:29 +0100
committerGravatar Tom Willemsen2012-11-11 03:01:29 +0100
commit33c13e26cd1bb006c05947576b34fde5cf41c165 (patch)
tree1ebe3c0450102d489e15978082886a35402b6723
parentfe21f0f03f21a2abc0e60931b60833f8b1100752 (diff)
downloadmode-icons-33c13e26cd1bb006c05947576b34fde5cf41c165.tar.gz
mode-icons-33c13e26cd1bb006c05947576b34fde5cf41c165.zip
Add Makefile with dist rule
Makes for easy creation of the tar file.
-rw-r--r--Makefile26
-rw-r--r--scripts/genpkg.el9
2 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3bde9fa
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,26 @@
+EMACS = emacs
+
+version := $(shell $(EMACS) -Q -batch -visit mode-icons.el -eval \
+ "(progn (require 'package) (princ (elt (package-buffer-info) 3)))")
+pkgname := mode-icons-$(version)
+sources := mode-icons.el $(wildcard icons/*.*)
+dests := $(addprefix $(pkgname)/,$(sources))
+
+all:
+dist: $(pkgname).tar
+
+$(pkgname).tar: $(pkgname)/mode-icons-pkg.el $(dests)
+ tar cjf $(pkgname).tar $(pkgname)
+
+$(pkgname)/mode-icons-pkg.el: mode-icons.el
+ if [ ! -d "$(pkgname)" ]; then mkdir $(pkgname); fi
+ $(EMACS) -batch -Q -script "$(CURDIR)/scripts/genpkg.el" > \
+ $(pkgname)/mode-icons-pkg.el
+
+$(dests): $(pkgname)/%:
+ if [ ! -d "$(dir $@)" ]; then mkdir -p $(dir $@); fi
+ cp $* $@
+
+clean:
+ rm -f $(pkgname).tar
+ rm -rf $(pkgname)/
diff --git a/scripts/genpkg.el b/scripts/genpkg.el
new file mode 100644
index 0000000..69b214d
--- /dev/null
+++ b/scripts/genpkg.el
@@ -0,0 +1,9 @@
+(require 'package)
+
+(find-file "mode-icons.el")
+(let ((info (package-buffer-info)))
+ (with-current-buffer (get-buffer-create "pkg")
+ (insert "(define-package \"" (elt info 0) "\"\n"
+ " \"" (elt info 3) "\"\n"
+ " \"" (elt info 2) "\")")
+ (princ (buffer-string))))