Created
June 27, 2011 12:51
-
-
Save hallison/1048797 to your computer and use it in GitHub Desktop.
Vim-Markdown Makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configuration | |
PLUGIN_NAME = markdown | |
PLUGIN_VERSION = 2.0.0 | |
MAKEDIR = build | |
HOMEDIR = tmp | |
SRCDIR = src | |
PKGDIR = pkg | |
SYNTAX = $(MAKEDIR)/syntax/$(PLUGIN_NAME).vim | |
FTDETECT = $(MAKEDIR)/ftdetect/$(PLUGIN_NAME).vim | |
FTPLUGIN = $(MAKEDIR)/ftplugin/$(PLUGIN_NAME).vim | |
HELP = $(MAKEDIR)/doc/$(PLUGIN_NAME).txt | |
SNIPPETS = $(MAKEDIR)/snippets/$(PLUGIN_NAME).snippets | |
PACKAGE = $(PKGDIR)/$(PLUGIN_NAME)-$(PLUGIN_VERSION) | |
PLUGIN = $(SYNTAX) $(FTDETECT) $(FTPLUGIN) $(SNIPPETS) $(HELP) | |
CONFIGS = \ | |
$(SRCDIR)/ftdetect.vim \ | |
$(SRCDIR)/ftplugin.vim | |
status=printf "[%-5s] %-67s " | |
done=printf "ok\n" | |
.SUFFIXES: | |
.SUFFIXES: .vim | |
$(SYNTAX): %$(PLUGIN_NAME).vim: $(SRCDIR)/syntax.vim | |
$(status) DIR $(*) | |
mkdir -p $(*) | |
$(done) | |
$(status) COPY "$(<) $(@)" | |
cp $(<) $(@) | |
$(done) | |
$(status) VIM $(@) | |
vim -n --noplugin $(@) +":source build.vim | exit!" | |
$(done) | |
$(FTPLUGIN): %$(PLUGIN_NAME).vim: $(SRCDIR)/ftplugin.vim | |
$(status) DIR $(*) | |
mkdir -p $(*) | |
$(done) | |
$(status) COPY "$(<) > $(@)" | |
cp $(<) $(@) | |
$(done) | |
$(FTDETECT): %$(PLUGIN_NAME).vim: $(SRCDIR)/ftdetect.vim | |
$(status) DIR $(*) | |
mkdir -p $(*) | |
$(done) | |
$(status) COPY "$(<) > $(@)" | |
cp $(<) $(@) | |
$(done) | |
$(SNIPPETS): %$(PLUGIN_NAME).snippets: $(SRCDIR)/syntax.snippets | |
$(status) DIR $(*) | |
mkdir -p $(*) | |
$(done) | |
$(status) COPY "$(<) > $(@)" | |
cp $(<) $(@) | |
$(done) | |
$(HELP): %$(PLUGIN_NAME).txt: | |
$(status) DIR $(*) | |
mkdir -p $(*) | |
$(done) | |
$(status) WRITE "$(@)" | |
rm -f $(@) | |
cat $(SYNTAX) $(SNIPPETS) > $(@) | |
sed -i -run 's/^(["#]@|["#]@.)//gp' $(@) | |
echo "vim:tw=78:ts=8:ft=help:norl:" >> $(@) | |
$(done) | |
$(status) CLEAN "$(SYNTAX)" | |
sed -i -r '/^(["#]@|["#]@.)/d;/^$$/d;/^"$$/d' $(SYNTAX) | |
$(done) | |
$(status) CLEAN "$(SNIPPETS)" | |
sed -i -r '/^(["#]@|["#]@.)/d;/^$$/d;/^"$$/d' $(SNIPPETS) | |
$(done) | |
build: $(PLUGIN) | |
install: build | |
for src in $(MAKEDIR)/*/*; do \ | |
filedir=$${src%/*.*}/; \ | |
filedir=$${filedir/$(MAKEDIR)/$(HOMEDIR)}; \ | |
$(status) DIR $${filedir}; \ | |
mkdir -p $${filedir}; \ | |
$(done); \ | |
file=$${src/$(MAKEDIR)/$(HOMEDIR)}; \ | |
$(status) COPY "$${src} > $${file}"; \ | |
cp -r $${src} $${file}; \ | |
$(done); \ | |
done | |
.SILENT: | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment