diff options
author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2023-01-26 00:30:53 +0900 |
---|---|---|
committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2023-01-26 00:54:55 +0900 |
commit | f7720b2207b33fd60ef945662c261c1468e377f7 (patch) | |
tree | b9a05fccca9e8a8a1e5a0fd2d519d0d83f0aa20f /Makefile | |
parent | 3f8a9cadb778c7a9aa6e4a396cbb3c5ec34ff409 (diff) | |
download | px-f7720b2207b33fd60ef945662c261c1468e377f7.tar.gz |
Add feed and build recipe
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..dcbd345 --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ +# Makefile for px.cnx.gdn +# Copyright (C) 2023 Nguyễn Gia Phong +# +# This program is licensed under CC BY-SA 4.0. + +SHELL = /bin/sh +PREFIX ?= /tmp/px.cnx.gdn + +PICTURES := $(filter-out %.small.jpg $(PREFIX)/%.jpg, $(wildcard */*.jpg)) +THUMBNAILS := $(patsubst %.jpg,%.small.jpg,$(PICTURES)) +DATA := $(wildcard */index.xml) +PAGES := $(patsubst %.xml,%.xhtml,$(DATA)) +OUTPUTS := $(THUMBNAILS) $(PAGES) atom.xml +ALL := $(OUTPUTS) $(PICTURES) index.xhtml favicon.png style.css + +all: $(OUTPUTS) + +%.small.jpg: %.jpg + epeg -w 1024 -p -q 80 $< $@ + +%.xhtml: %.xml page.xslt + xsltproc page.xslt $< > $@ + +atom.xml: atom.xslt $(DATA) $(wildcard *.svg) + xsltproc atom.xslt > atom.xml + +clean: + rm -f atom.xml */{index.xhtml,*.small.jpg} + +$(PREFIX)/%: % + install -Dm644 $< $@ + +install: all $(addprefix $(PREFIX)/,$(ALL)) + +uninstall: + rm -fr $(PREFIX) + +.PHONY: all clean install uninstall |