rsrsss/Makefile

44 lines
1.4 KiB
Makefile
Raw Normal View History

2023-10-18 06:54:15 +00:00
.PHONY: all validate
all: css/sprites.css $(patsubst xquery/opml/%.xqy,opml/%.opml,$(wildcard xquery/opml/*.xqy) $(wildcard xquery/opml/*/*.xqy))
2023-07-22 15:37:49 +00:00
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)"
2023-10-31 20:17:35 +00:00
export XIDEL_OPTIONS:=--silent --user-agent=$(USER_AGENT) --wait=1 --trace-stack
opml/%.opml: xquery/opml/%.xqy xquery/functions.xqy
2023-10-16 17:45:50 +00:00
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 $@
2023-10-31 20:36:19 +00:00
chmod a=r,u=rw $@
2023-09-05 12:48:17 +00:00
2023-10-18 06:54:15 +00:00
opml/feeds.opml: xquery/opml/feeds.xqy feed.xml
2023-10-16 18:52:11 +00:00
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 $@
2023-10-31 20:36:19 +00:00
chmod a=r,u=rw $@
2023-10-16 18:52:11 +00:00
2023-10-18 06:54:15 +00:00
img/sprites.png: $(wildcard img/sprites/*.png)
convert $^ +append $@
2023-10-31 20:36:19 +00:00
chmod a=r,u=rw $@
2023-07-22 15:37:49 +00:00
2023-10-18 06:54:15 +00:00
css/sprites.css: xquery/build_sprites_css.xqy img/sprites.png
xidel --extract-kind=xquery3 --extract-file="$<" > $@.new
mv $@.new $@
2023-10-31 20:36:19 +00:00
chmod a=r,u=rw $@
2023-10-15 23:36:11 +00:00
2023-10-18 06:54:15 +00:00
validate: xquery/validator.xqy feed.xml
ifneq ($(XMLLINT_PATH),)
$(XMLLINT_PATH) --schema xsd/rss.xsd --noout feed.xml
endif
2023-10-18 06:54:15 +00:00
xidel --extract-kind=xquery3 --extract-file="$<"