33 lines
1.2 KiB
Makefile
33 lines
1.2 KiB
Makefile
.PHONY: all
|
|
all: css/sprites.css opml/feeds.opml opml/nhc.opml opml/cta.opml
|
|
|
|
USER_AGENT:="RSRSSS/1.0 (+https://envs.net/~lucidiot/rsrsss/feed.xml)"
|
|
export XIDEL_OPTIONS:=--silent --user-agent=$(USER_AGENT) --wait=1
|
|
|
|
opml/feeds.opml: feed.xml xquery/feeds_opml.xqy
|
|
xidel feed.xml --extract-kind=xquery3 --extract-file=xquery/feeds_opml.xqy --output-format=xml > $@
|
|
chmod a+r $@
|
|
|
|
# The page is encoded as latin1 but xidel does not convert it by itself when making an HTTP request, so we use curl
|
|
opml/nhc.opml: xquery/nhc_opml.xqy
|
|
curl --silent --fail -H User-Agent:$(USER_AGENT) https://www.nhc.noaa.gov/aboutrss.shtml |\
|
|
xidel - --stdin-encoding=iso-8859-1 --extract-kind=xquery3 --extract-file=xquery/nhc_opml.xqy --output-format=xml > $@
|
|
chmod a+r $@
|
|
|
|
opml/cta.opml: xquery/cta_opml.xqy
|
|
xidel --extract-kind=xquery3 --extract-file=xquery/cta_opml.xqy --output-format=xml > $@
|
|
chmod a+r $@
|
|
|
|
sprites := $(wildcard img/sprites/*.png)
|
|
|
|
img/sprites.png: $(sprites)
|
|
convert $(sprites) +append $@
|
|
chmod a+r $@
|
|
|
|
css/sprites.css: img/sprites.png xquery/build_sprites_css.xqy
|
|
xidel --extract-kind=xquery3 --extract-file=xquery/build_sprites_css.xqy > $@
|
|
chmod a+r $@
|
|
|
|
validate: feed.xml
|
|
xidel --extract-kind=xquery3 --extract-file=xquery/validator.xqy
|