From b193033728ad421c9e0a37ec6438d98dc1adefee Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 27 Oct 2014 22:57:37 -0700 Subject: Cleaned up Makefile a bit. --- Makefile | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a5bc1af..e1475d5 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,11 @@ PROG?=./cmark JSMODULES=$(wildcard js/lib/*.js) PREFIX?=/usr/local SPEC=spec.txt +SITE=_site SPECVERSION=$(shell grep version: $(SPEC) | sed -e 's/version: *//') +VERSIONS=$(shell cd $(SITE); ls -d -1 0.* | sort -r -g) -.PHONY: all spec leakcheck clean fuzztest dingus upload jshint test testjs benchjs +.PHONY: all spec leakcheck clean fuzztest dingus upload jshint test testjs benchjs update-site upload-site all: $(SRCDIR)/case_fold_switch.inc $(PROG) libcmark.so @@ -89,29 +91,31 @@ fuzztest: for i in `seq 1 10`; do \ time cat /dev/urandom | head -c 100000 | iconv -f latin1 -t utf-8 | $(PROG) >/dev/null; done -_site/spec.html: spec.txt +$(SITE)/spec.html: spec.txt (echo "% CommonMark Spec\n";\ - for vers in $(shell cd _site; ls -d -1 0.* | sort -r -g) ; do \ + for vers in $(VERSIONS); do \ if [ "$$vers" != "$(SPECVERSION)" ]; then \ - perl -p -i -e 's/
.*?<\/div>/
This is an older version of the spec. For the most recent version, see http:\/\/spec.commonmark.org<\/a>.<\/div>/' _site/$$vers/index.html ; \ + perl -p -i -e 's/