aboutsummaryrefslogtreecommitdiff
path: root/dynamic.mk
blob: 91b37535142b91e820d14b24929e0070c7cf330d (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
.POSIX:
FQDN = euandre.org



include generated.mk



.SUFFIXES:
.SUFFIXES: .md .env .html .ly .flac .midi .ogg .pdf .flac

.md.env:
	sh src/development/frontmatter-env.sh < $< > $@

.md.html:
	sh src/development/genhtml.sh $< > $@

.ly.midi:
	lilypond -o $* $<

.midi.ogg:
	timidity -Ov $<

.flac.ogg:
	ffmpeg -y -i $< -ar 48000 -vn -c:a libvorbis -b:a 320k $@


pastebins.env  = $(pastebins.md:.md=.env)
pastebins.html = $(pastebins.md:.md=.html)
pastebins      = $(pastebins.env) $(pastebins.html)

html = $(pastebins.html)

lilypond.pdf  = $(lilypond.ly:.ly=.pdf)
lilypond.midi = $(lilypond.ly:.ly=.midi)
lilypond.ogg  = $(lilypond.ly:.ly=.ogg)
lilypond = $(lilypond.pdf) $(lilypond.midi) $(lilypond.ogg)

podcasts.ogg = $(podcasts.flac:.flac=.ogg)
podcasts = $(podcasts.ogg)

favicons = \
	static/lord-favicon.png \
	static/lord-favicon.ico \
	favicon.ico             \

ALL = \
	$(html)                  \
	$(lilypond)              \
	$(torrent-files)         \
	$(podcasts)              \
	$(favicons)              \
	TODOs.html               \
	public/feed.blog.en.atom \

$(html): src/development/genhtml.sh

all: $(ALL) public

$(torrent-files):
	mktorrent -f -v -d -n $@ -o $@ -c '' "$(@D)/`basename $@ .torrent`"

clean:
	rm -rf $(ALL) public/ .jekyll-cache/ src/content/ generated.mk

TODOs.html: TODOs.md
	sh aux/workflow/TODOs.sh -n website -m public-inbox > $@

static/lord-favicon.png: static/lord-favicon.svg
	inkscape -o $@ -w 2048 -h 2048 -b white static/lord-favicon.svg

static/lord-favicon.ico: static/lord-favicon.svg
	convert static/lord-favicon.svg $@

favicon.ico: static/lord-favicon.ico
	ln -fs static/lord-favicon.ico $@

public/feed.blog.en.atom:
	mkdir -p $(@D)
	ln -s feed.articles.en.atom $@


check:
dev-check: check

fqdn:
	printf '$(FQDN)'



# `public` depends on $(ALL) because `jekyll build` needs some of the files
# generated in $(ALL), IOW for JEKYLL_COMPAT.  As soon as jekyll is removed,
# `public` can become an alias for `all`, and the "$(ALL) public" combo can be
# replaced by "all", such as the dependencies for "run".
public: $(ALL)
	JEKYLL_ENV=production jekyll build

run: all
	serve -d public/

deploy: all
	rsync \
		-avzP \
		--delete \
		--exclude 's/*' \
		public/ $(FQDN):/srv/www/