aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorPeter Odding <peter@peterodding.com>2010-06-06 10:13:56 +0200
committerPeter Odding <peter@peterodding.com>2010-06-06 10:13:56 +0200
commit0c57fc8380c809d2efd4bdb727874536569d489e (patch)
tree2478d1b81b5450d2ea71c136f7084dc2efc0a0ad /Makefile
downloadvim-easytags-0c57fc8380c809d2efd4bdb727874536569d489e.tar.gz
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile41
1 files changed, 41 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3dada56
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,41 @@
+DEPENDS=$(HOME)/.vim/autoload/xolox/escape.vim \
+ $(HOME)/.vim/autoload/xolox/timer.vim
+VIMDOC=doc/easytags.txt
+HTMLDOC=doc/readme.html
+ZIPDIR := $(shell mktemp -d)
+ZIPFILE := $(shell mktemp -u)
+
+# NOTE: Make does NOT expand the following back ticks!
+VERSION=`grep '^" Version:' easytags.vim | awk '{print $$3}'`
+
+# The main rule builds a ZIP that can be published to http://www.vim.org.
+archive: Makefile easytags.vim autoload.vim $(VIMDOC) $(HTMLDOC)
+ @echo "Creating \`easytags-$(VERSION).zip' .."
+ @mkdir -p $(ZIPDIR)/plugin $(ZIPDIR)/autoload/xolox $(ZIPDIR)/doc
+ @cp easytags.vim $(ZIPDIR)/plugin
+ @cp autoload.vim $(ZIPDIR)/autoload/easytags.vim
+ @cp $(DEPENDS) $(ZIPDIR)/autoload/xolox
+ @cp $(VIMDOC) $(ZIPDIR)/doc/easytags.txt
+ @cp $(HTMLDOC) $(ZIPDIR)/doc/easytags.html
+ @cd $(ZIPDIR) && zip -r $(ZIPFILE) . >/dev/null
+ @rm -R $(ZIPDIR)
+ @mv $(ZIPFILE) easytags-$(VERSION).zip
+
+# This rule converts the Markdown README to Vim documentation.
+$(VIMDOC): Makefile README.md
+ @echo "Creating \`$(VIMDOC)' .."
+ @mkd2vimdoc.py `basename $(VIMDOC)` < README.md > $(VIMDOC)
+
+# This rule converts the Markdown README to HTML, which reads easier.
+$(HTMLDOC): Makefile README.md doc/README.header doc/README.footer
+ @echo "Creating \`$(HTMLDOC)' .."
+ @cat doc/README.header > $(HTMLDOC)
+ @cat README.md | markdown | SmartyPants >> $(HTMLDOC)
+ @cat doc/README.footer >> $(HTMLDOC)
+
+# This is only useful for myself, it uploads the latest README to my website.
+web: $(HTMLDOC)
+ @echo "Uploading homepage .."
+ @scp -q $(HTMLDOC) vps:/home/peterodding.com/public/files/code/vim/easytags/index.html
+
+all: archive web