Add Makefile with dist rule

Makes for easy creation of the tar file.
This commit is contained in:
Tom Willemsen 2012-11-11 03:01:29 +01:00
parent fe21f0f03f
commit 33c13e26cd
2 changed files with 35 additions and 0 deletions

26
Makefile Normal file
View file

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

9
scripts/genpkg.el Normal file
View file

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