summaryrefslogtreecommitdiff
path: root/javascript/WebIDL/Makefile
blob: f5cd6fc2aa4483da1c918781726cdfa562530fe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/make
#
# Create the WebIDL for core DOM and HTML spec directly from
# downloaded specifications. The resulting IDL is pretty close but
# should be manually cleaned up and tagged with the retrival date and
# source URL
#
# The dom spec has an index on the end that contains all the IDL a
# second time! be aware htis needs removing or your IDL will have two
# copies of all interfaces which is bad.
#
# needs debin packages: curl w3m tidy html-xml-utils
#
# Copyright 2012 Vincent Sanders 
# MIT licenced

.PHONY:all clean

all: dom.idl html.idl

.INTERMEDIATE:dom-spec.html dom-spec.xml dom-idl.html html-spec.html html-spec.xml html-idl.html


dom-spec.html:
	curl -s https://dom.spec.whatwg.org/ -o $@

html-spec.html:
	curl -s https://html.spec.whatwg.org/ -o $@

%-spec.xml: %-spec.html
	-tidy -q -f $@.errors --new-blocklevel-tags header,hgroup,figure,time,main,nav,svg,rect,text,image,mark,figcaption -o $@ -asxml $<

%-idl.html: %-spec.xml
	hxselect 'pre[class="idl"]' < $< > $@

%.idl: %-idl.html
	@echo "// Retrived from " >$@
	@echo "// $$(date)" >>$@
	@echo "" >>$@
	@echo "" >>$@
	cat $< | w3m -dump -T text/html >>$@



clean:
	${RM} dom.idl html.idl dom-spec.html dom-spec.xml dom-idl.html html-spec.html html-spec.xml html-idl.html