44 lines
1.4 KiB
Makefile
44 lines
1.4 KiB
Makefile
.PHONY: all validate
|
|
all: css/sprites.css $(patsubst xquery/opml/%.xqy,opml/%.opml,$(wildcard xquery/opml/*.xqy) $(wildcard xquery/opml/*/*.xqy))
|
|
|
|
XMLLINT_PATH:=$(shell command -v xmllint || true)
|
|
ifeq ($(XMLLINT_PATH),)
|
|
$(info xmllint is not available, all XSD validations will be skipped)
|
|
endif
|
|
|
|
USER_AGENT:="RSRSSS/1.0 (+https://envs.net/~lucidiot/rsrsss/feed.xml)"
|
|
export XIDEL_OPTIONS:=--silent --user-agent=$(USER_AGENT) --wait=1 --trace-stack
|
|
|
|
opml/%.opml: xquery/opml/%.xqy xquery/functions.xqy
|
|
mkdir -p -ma=x,u=rwx $(dir $@)
|
|
xidel --extract-kind=xquery3 --extract-file="$<" --output-format=xml > $@.new
|
|
ifneq ($(XMLLINT_PATH),)
|
|
$(XMLLINT_PATH) --schema xsd/opml.xsd --noout $@.new
|
|
endif
|
|
mv $@.new $@
|
|
chmod a=r,u=rw $@
|
|
|
|
opml/feeds.opml: xquery/opml/feeds.xqy feed.xml
|
|
mkdir -p -ma=x,u=rwx $(dir $@)
|
|
xidel feed.xml --extract-kind=xquery3 --extract-file="$<" --output-format=xml > $@.new
|
|
ifneq ($(XMLLINT_PATH),)
|
|
$(XMLLINT_PATH) --schema xsd/opml.xsd --noout $@.new
|
|
endif
|
|
mv $@.new $@
|
|
chmod a=r,u=rw $@
|
|
|
|
img/sprites.png: $(wildcard img/sprites/*.png)
|
|
convert $^ +append $@
|
|
chmod a=r,u=rw $@
|
|
|
|
css/sprites.css: xquery/build_sprites_css.xqy img/sprites.png
|
|
xidel --extract-kind=xquery3 --extract-file="$<" > $@.new
|
|
mv $@.new $@
|
|
chmod a=r,u=rw $@
|
|
|
|
validate: xquery/validator.xqy feed.xml
|
|
ifneq ($(XMLLINT_PATH),)
|
|
$(XMLLINT_PATH) --schema xsd/rss.xsd --noout feed.xml
|
|
endif
|
|
xidel --extract-kind=xquery3 --extract-file="$<"
|