mirror of
https://github.com/ryuslash/mode-icons.git
synced 2024-11-21 09:30:29 +01:00
Add Makefile with dist rule
Makes for easy creation of the tar file.
This commit is contained in:
parent
fe21f0f03f
commit
33c13e26cd
2 changed files with 35 additions and 0 deletions
26
Makefile
Normal file
26
Makefile
Normal 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
9
scripts/genpkg.el
Normal 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))))
|
Loading…
Reference in a new issue