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))))