-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
88 lines (72 loc) · 1.61 KB
/
Makefile
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
.PHONY: default
default: all
PANDOC := pandoc
PAGES := \
api \
addons \
bindings \
books \
changes \
changes-5.2 \
changes-unstable \
digmid \
docs \
examples_demos \
examples_graphics \
examples_bitmap \
examples_audio \
examples_display \
examples_input \
examples_misc \
game_jams \
humor \
index \
irc \
license \
links \
logos \
logos_02 \
logos_03 \
maillist \
mirrors \
news \
old \
oldnews \
readme \
git \
webmasters \
download
SRCDIR := en
OUTDIR := OUT
# Note: before-body and after-body are converted to html
INCLUDES := \
$(SRCDIR)/_include/before-body.html \
$(SRCDIR)/_include/after-body.html \
$(SRCDIR)/_include/in-header \
$(SRCDIR)/_include/links
OUTPAGES := $(addsuffix .html,$(addprefix $(OUTDIR)/,$(PAGES)))
OUTSTATIC := $(subst static/,$(OUTDIR)/,$(wildcard static/*))
OUTDOCINDEX := $(OUTDIR)/a5docs/index.html
.PHONY: all
all: $(OUTPAGES) $(OUTSTATIC) $(OUTDIR)/feed_atom.xml $(OUTDOCINDEX)
$(OUTDIR)/index.html: $(OUTDIR)/news.html
cp $< $@
$(OUTDIR)/a5docs/index.html: static/docs/old_docs.html $(OUTDIR)/a5docs
cp $< $@
$(OUTDIR)/%.html: $(SRCDIR)/% $(INCLUDES) $(OUTDIR)
./make_page $< $(OUTDIR)
.SECONDARY: $(SRCDIR)/_include/%.html
$(SRCDIR)/_include/%.html: $(SRCDIR)/_include/% $(SRCDIR)/_include/links
$(PANDOC) $^ --to html --output $@
$(OUTDIR):
mkdir $(OUTDIR)
$(OUTDIR)/a5docs:
mkdir $(OUTDIR)/a5docs
$(OUTDIR)/%: static/%
cp -r $< $@
$(OUTDIR)/feed_atom.xml: $(sort $(wildcard $(SRCDIR)/news/news.*))
./make_feed $^ > $(OUTDIR)/feed_atom.xml
.DELETE_ON_ERROR: $(OUTDIR)/feed_atom.xml
.PHONY: clean
clean:
$(RM) -r $(OUTDIR)