File:  [Public] / html5 / spec-LC / Makefile
Revision 1.1: download - view: text, annotated - select for diffs
Wed May 18 10:37:24 2011 UTC (14 years, 3 months ago) by mike
Branches: MAIN
CVS tags: HEAD
updates

PYTHON=python
PYTHONFLAGS=

SPLITTER=tools/spec-splitter.py
SPLITTERFLAGS=

TEE=tee
TEEFLAGS=

GREP=egrep
GREPFLAGS=

PERL=perl
PERLFLAGS=

TIDY=tidy
TIDYFLAGS=-asxhtml -n

XSLTPROC=xsltproc
XSLTPROCFLAGS=--novalid

CVS=cvs
CVSFLAGS=

CURL=curl
CURLFLAGS=-s
PARSE=./parse.py
PARSEFLAGS=--xml

ANNODB=http://www.whatwg.org/specs/web-apps/current-work/status.cgi?action=get-all-annotations

REVISION=$(shell $(GREP) $(GREPFLAGS) 'This is .+Revision: ' Overview.html | $(PERL) $(PERLFLAGS) -pe 's/.*This is .+Revision: (1\.[0-9]+) \$$\./$$1/')

all: MANIFEST toc-status.html

debug:
	echo $(REVISION)

MANIFEST: Overview.html
	$(PYTHON) $(PYTHONFLAGS) $(SPLITTER) $(SPLITTERFLAGS) $< . \
	  | $(TEE) $(TEEFLAGS) \
	  | $(GREP) $(GREPFLAGS) '<h2>|<h3>|<h4>|<h5>|<h6>' \
	  | cut -c8- \
	  | cut -d " " -f1 \
	  | $(PERL) $(PERLFLAGS) -pe "s/(^[^ ]+)\s*\n/\1.html\n/" > $@
	  $(PERL) $(PERLFLAGS) -pi -e 's/^.*This is .+Revision: ([^ ]+) \$$.*$$/This is revision $(REVISION)\./' spec.html
	  for file in $$(cat MANIFEST); \
	    do $(PERL) $(PERLFLAGS) -pi -e 's|A vocabulary and associated APIs for HTML and XHTML</h2>|A vocabulary and associated APIs for HTML and XHTML</h2><p>This is revision $(REVISION)\.</p>\n|' $$file; done

annotations.xml:
	$(CURL) --output $@ $(ANNODB)

toc-status.xml: Overview.html get-toc.xsl
	-$(TIDY) $(TIDYFLAGS) $< 2> tidy.log \
	  | $(XSLTPROC) $(XSLTPROCFLAGS) get-toc.xsl - > $@

toc-status.html: annotations.xml toc-status.xml tocmix.xsl
	$(XSLTPROC) $(XSLTPROCFLAGS) \
	  --novalid --output $@ \
		--stringparam Annotations annotations.xml \
		tocmix.xsl toc-status.xml

CHANGEDESC: Overview.html
	$(CVS) $(CVSFLAGS) log -r$(REVISION) $< \
	  | $(GREP) $(GREPFLAGS) -v \
	  "^$$|^RCS file: |^Working file: |^head:|^branch:|^locks:|^access list:|^symbolic names:|^keyword substitution:|^total revisions:|^description:|^revision |^-----|^date: |^=====" \
	  > $@
	@echo >> $@
	@echo "[updated by splitter]" >> $@

clean:
	$(RM) MANIFEST
	$(RM) annotations.xml
	$(RM) tidy.log
	$(RM) CHANGEDESC


Webmaster