2012-10-23 19:45:41 +04:00
|
|
|
#!/bin/make
|
|
|
|
#
|
|
|
|
# Create the WebIDL for core DOM and HTML spec directly from
|
2015-08-09 14:27:13 +03:00
|
|
|
# downloaded specifications. The resulting IDL is pretty close but
|
|
|
|
# should be manually cleaned up and tagged with the retrival date and
|
|
|
|
# source URL
|
2012-10-23 19:45:41 +04:00
|
|
|
#
|
2015-08-09 14:27:13 +03:00
|
|
|
# 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 debian packages: curl w3m tidy html-xml-utils
|
2012-10-23 19:45:41 +04:00
|
|
|
#
|
|
|
|
# Copyright 2012 Vincent Sanders
|
|
|
|
# MIT licenced
|
|
|
|
|
|
|
|
.PHONY:all clean
|
|
|
|
|
2015-07-23 23:26:46 +03:00
|
|
|
all: dom.idl html.idl uievents.idl
|
2012-10-23 19:45:41 +04:00
|
|
|
|
2015-07-23 23:42:46 +03:00
|
|
|
.INTERMEDIATE:dom-spec.html dom-spec.xml dom-idl.html
|
|
|
|
.INTERMEDIATE:html-spec.html html-spec.xml html-idl.html
|
|
|
|
.INTERMEDIATE:uievents-spec.html uievents-spec.xml uievents-idl.html
|
2012-10-23 19:45:41 +04:00
|
|
|
|
|
|
|
dom-spec.html:
|
2015-07-17 11:29:37 +03:00
|
|
|
curl -s https://dom.spec.whatwg.org/ -o $@
|
2012-10-23 19:45:41 +04:00
|
|
|
|
|
|
|
html-spec.html:
|
2015-07-17 11:29:37 +03:00
|
|
|
curl -s https://html.spec.whatwg.org/ -o $@
|
2012-10-23 19:45:41 +04:00
|
|
|
|
2015-07-23 23:26:46 +03:00
|
|
|
uievents-spec.html:
|
2015-07-23 23:42:46 +03:00
|
|
|
curl -s http://www.w3.org/TR/uievents/ -o $@
|
2015-07-23 23:26:46 +03:00
|
|
|
|
2012-10-23 19:45:41 +04:00
|
|
|
%-spec.xml: %-spec.html
|
2015-07-23 23:26:46 +03:00
|
|
|
-tidy -q -f $@.errors --new-blocklevel-tags header,hgroup,figure,time,main,nav,svg,rect,text,image,mark,figcaption,section -o $@ -asxml $<
|
|
|
|
|
2012-10-23 19:45:41 +04:00
|
|
|
%-idl.html: %-spec.xml
|
2015-07-17 11:29:37 +03:00
|
|
|
hxselect 'pre[class="idl"]' < $< > $@
|
2012-10-23 19:45:41 +04:00
|
|
|
|
|
|
|
%.idl: %-idl.html
|
2015-07-17 11:29:37 +03:00
|
|
|
@echo "// Retrived from " >$@
|
|
|
|
@echo "// $$(date)" >>$@
|
|
|
|
@echo "" >>$@
|
|
|
|
@echo "" >>$@
|
|
|
|
cat $< | w3m -dump -T text/html >>$@
|
2012-10-23 19:45:41 +04:00
|
|
|
|
|
|
|
|
|
|
|
clean:
|
2015-07-23 23:42:46 +03:00
|
|
|
${RM} dom.idl html.idl uievents.idl dom-spec.html dom-spec.xml dom-idl.html html-spec.html html-spec.xml html-idl.html uievents-spec.html uievents-spec.xml uievents-idl.html uievents-spec.xml.errors
|