blob: 4f375025d21756ceb8eb2eb7f1fa0ada3b265cab (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# 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) index.xml
PAGES := $(patsubst %.xml,%.xhtml,$(DATA))
OUTPUTS := $(THUMBNAILS) $(PAGES) atom.xml
ALL := $(OUTPUTS) $(PICTURES) favicon.svg style.css
all: $(OUTPUTS)
%.small.jpg: %.jpg
epeg -w 1024 -p -q 80 $< $@
index.xml: 09/index.xml
ln -fs $< $@
%.xhtml: %.xml page.xslt
xsltproc page.xslt $< > $@
atom.xml: atom.xslt $(DATA) cc.svg by.svg sa.svg
xsltproc atom.xslt > atom.xml
clean:
rm -f atom.xml index.{xml,xhtml} */{index.xhtml,*.small.jpg}
$(PREFIX)/%: %
install -Dm644 $< $@
install: all $(addprefix $(PREFIX)/,$(ALL))
uninstall:
rm -fr $(PREFIX)/*
live: $(THUMBNAILS) index.xml atom.xml
.PHONY: all clean install uninstall live
|