forked from illumos/dev-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
105 lines (83 loc) · 2.08 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright 2019 Joyent, Inc.
#
PYTHON = python
MDPATH = ./support
MD = $(MDPATH)/markdown2.py
TOC = ./support/gentoc.sh
HEADER = assets/header.html
TRAILER = assets/trailer.html
BOOTSTRAP_MIN = .min
BOOTSTRAP_TYPES = css img js
BOOTSTRAP_FILES = \
css/bootstrap$(BOOTSTRAP_MIN).css \
img/glyphicons-halflings-white.png \
img/glyphicons-halflings.png \
js/bootstrap$(BOOTSTRAP_MIN).js
MDARGS = \
--extras fenced-code-blocks \
--extras wiki-tables \
--extras link-patterns \
--extras header-ids \
--link-patterns-file support/link-patterns.txt
IMAGE_FILES = \
illumos_phoenix_small.png
FILES = \
intro \
workflow \
guidelines \
layout \
anatomy \
debugging \
integrating \
help \
glossary \
license
#
# So that the bare "/books/dev" URL works, we nominate one of the top-level
# pages to be the target of an "index.html" symlink:
#
INDEX_FILE = intro
OUTDIR = output
BOOTSTRAP_OUTDIRS = \
$(BOOTSTRAP_TYPES:%=$(OUTDIR)/bootstrap/%)
OUTFILES = \
$(FILES:%=$(OUTDIR)/%.html) \
$(IMAGE_FILES:%=$(OUTDIR)/img/%) \
$(BOOTSTRAP_FILES:%=$(OUTDIR)/bootstrap/%) \
$(OUTDIR)/index.html
all: $(OUTDIR) $(BOOTSTRAP_OUTDIRS) $(OUTFILES)
$(OUTDIR):
mkdir -p "$@"
$(OUTDIR)/img:
mkdir -p "$@"
$(BOOTSTRAP_OUTDIRS):
mkdir -p "$@"
$(OUTDIR)/index.html:
rm -f "$@"
ln -s $(INDEX_FILE).html "$@"
$(OUTDIR)/%.html: % $(HEADER) $(TRAILER) $(OUTDIR)
sed '/<!-- vim:[^:]*: -->/d' $(HEADER) > $@
$(TOC) $< $(FILES) >> $@
$(PYTHON) $(MD) $(MDARGS) $< >> $@
sed '/<!-- vim:[^:]*: -->/d' $(TRAILER) >> $@
$(OUTDIR)/img/%: assets/% $(OUTDIR)/img
cp $< $@
touch $@
$(OUTDIR)/bootstrap/%: assets/bootstrap/% $(BOOTSTRAP_OUTDIRS)
cp $< $@
touch $@
clean: clobber
clobber:
rm -rf output
FRC: