forked from dlang/dlang.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinux.mak
186 lines (149 loc) · 6.73 KB
/
linux.mak
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# makefile to build html files for DMD
# Externals
DMD=dmd
PHOBOS=../phobos
DRUNTIME=../druntime
DOC_OUTPUT_DIR=../web
# Documents
DDOC=macros.ddoc windows.ddoc doc.ddoc
IMAGES=favicon.ico $(addprefix images/, c1.gif d3.gif dlogo.png \
dmlogo.gif gradient-green.jpg search-bg.gif Thumbs.db cpp1.gif d4.gif \
dmlogo-smaller.gif gradient-red.jpg search-button.gif d002.ico d5.gif \
globe.gif pen.gif search-left.gif tdpl.jpg)
STYLES=css/style.css css/print.css
PREMADE=download.html dcompiler.html language-reference.html \
appendices.html howtos.html articles.html
TARGETS=cpptod.html ctod.html pretod.html cppstrings.html \
cppcomplex.html cppdbc.html gsoc2011.html index.html overview.html \
spec.html intro.html \
lex.html module.html dnews.html declaration.html type.html \
property.html attribute.html pragma.html expression.html \
statement.html arrays.html struct.html class.html enum.html \
function.html operatoroverloading.html template.html mixin.html \
dbc.html version.html errors.html garbage.html memory.html \
float.html iasm.html interface.html portability.html html.html \
entity.html abi.html windows.html dll.html htomodule.html faq.html \
dstyle.html wc.html future.html changelog.html glossary.html \
acknowledgements.html builtin.html interfaceToC.html \
comparison.html rationale.html ddoc.html code_coverage.html \
exception-safe.html rdmd.html templates-revisited.html \
warnings.html ascii-table.html windbg.html htod.html \
regular-expression.html lazy-evaluation.html lisp-java-d.html \
variadic-function-templates.html howto-promote.html tuple.html \
template-comparison.html template-mixin.html \
final-const-invariant.html const.html traits.html COM.html \
cpp_interface.html hijack.html const3.html features2.html \
safed.html cpp0x.html const-faq.html dmd-windows.html \
dmd-linux.html dmd-osx.html dmd-freebsd.html concepts.html \
memory-safe-d.html d-floating-point.html migrate-to-shared.html \
D1toD2.html unittest.html hash-map.html pdf-intro-cover.html \
pdf-spec-cover.html pdf-tools-cover.html intro-to-datetime.html std_consolidated_header.html
PDFINTRO=index.html overview.html wc.html warnings.html builtin.html \
ctod.html cpptod.html pretod.html template-comparison.html \
cppstrings.html cppcomplex.html cppdbc.html lisp-java-d.html \
cpp0x.html
PDFFEATURES=comparison.html features2.html
PDFFAQ=faq.html const-faq.html rationale.html future.html
PDFSPEC=spec.html intro.html \
lex.html module.html declaration.html type.html property.html \
attribute.html pragma.html expression.html statement.html \
arrays.html hash-map.html struct.html class.html interface.html \
enum.html const3.html function.html operatoroverloading.html \
template.html template-mixin.html dbc.html version.html \
traits.html errors.html unittest.html garbage.html float.html \
iasm.html ddoc.html interfaceToC.html cpp_interface.html \
portability.html html.html entity.html memory-safe-d.html abi.html
PDFHOWTOS=windows.html dll.html COM.html htomodule.html
PDFARTICLES=d-floating-point.html migrate-to-shared.html hijack.html \
const3.html memory.html exception-safe.html \
templates-revisited.html regular-expression.html \
lazy-evaluation.html variadic-function-templates.html tuple.html \
mixin.html safed.html intro-to-datetime.html
PDFTOOLS=dmd-linux.html dmd-freebsd.html dmd-osx.html dmd-windows.html \
http://digitalmars.com/ctg/optlink.html \
http://digitalmars.com/ctg/trace.html code_coverage.html rdmd.html \
windbg.html htod.html
PDFAPPENDICES=dstyle.html glossary.html ascii-table.html \
acknowledgements.html
PDFOPTIONS=--header-left [section] --header-right [page] \
--header-spacing 3 --header-font-name Georgia --print-media-type \
--outline
PDFTARGETS=d-intro.pdf d-spec.pdf d-tools.pdf
ALL_FILES_BUT_SITEMAP = $(addprefix $(DOC_OUTPUT_DIR)/, $(TARGETS) \
$(PREMADE) $(STYLES) $(IMAGES))
ALL_FILES = $(ALL_FILES_BUT_SITEMAP) $(DOC_OUTPUT_DIR)/sitemap.html
# Pattern rulez
$(DOC_OUTPUT_DIR)/%.html : %.dd $(DDOC)
$(DMD) -c -o- -Df$@ $(DDOC) $<
$(DOC_OUTPUT_DIR)/% : %
@mkdir -p $(dir $@)
cp $< $@
# Rulez
all : $(ALL_FILES) phobos druntime phobos-last-release druntime-last-release
all+pdf : $(ALL_FILES) $(PDFTARGETS)
$(DOC_OUTPUT_DIR)/sitemap.html : $(ALL_FILES_BUT_SITEMAP)
cp -f sitemap-template.dd sitemap.dd
true $(foreach F, $(sort $(TARGETS) $(IMAGES)), \
&& echo "<a href=$F>`sed -n 's/<title>\(.*\)<\/title>/\1/'p $(DOC_OUTPUT_DIR)/$F`" \
"</a><p>" >> sitemap.dd)
$(DMD) -c -o- -Df$@ $(DDOC) sitemap.dd
rm -rf sitemap.dd
zip:
rm doc.zip
zip32 doc win32.mak style.css $(DDOC)
zip32 doc $(SRC) download.html
zip32 doc $(IMG)
clean:
rm -rf $(DOC_OUTPUT_DIR)
pdf : $(PDFTARGETS)
d-intro.pdf:
wkhtmltopdf $(PDFOPTIONS) cover pdf-intro-cover.html toc \
$(addprefix $(DOC_OUTPUT_DIR)/, $(PDFINTRO)) $(addprefix \
$(DOC_OUTPUT_DIR)/, $(PDFFEATURES)) $(addprefix \
$(DOC_OUTPUT_DIR)/, $(PDFFAQ)) $(addprefix $(DOC_OUTPUT_DIR)/, \
$(PDFAPPENDICES)) $(DOC_OUTPUT_DIR)/d-intro.pdf
d-spec.pdf:
wkhtmltopdf $(PDFOPTIONS) cover pdf-spec-cover.html toc \
$(addprefix $(DOC_OUTPUT_DIR)/, $(PDFSPEC)) $(addprefix \
$(DOC_OUTPUT_DIR)/, $(PDFAPPENDICES)) \
$(DOC_OUTPUT_DIR)/d-spec.pdf
d-tools.pdf:
wkhtmltopdf $(PDFOPTIONS) cover pdf-tools-cover.html toc \
$(addprefix $(DOC_OUTPUT_DIR)/, $(PDFTOOLS)) $(addprefix \
$(DOC_OUTPUT_DIR)/, $(PDFHOWTOS)) $(addprefix \
$(DOC_OUTPUT_DIR)/, $(PDFARTICLES)) $(addprefix \
$(DOC_OUTPUT_DIR)/, $(PDFAPPENDICES)) \
$(DOC_OUTPUT_DIR)/d-tools.pdf
phobos:
cd ${PHOBOS} && make -f posix.mak \
DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos-prerelease html -j 4
phobos-last-release:
export TAG=$$(cd ${PHOBOS} && git tag | grep '^v' | sed 's/^v//' | sort -nr | head -n 1) && \
echo "Buidling Phobos version $$TAG in ${PHOBOS}-$$TAG" && \
if [ ! -d ${PHOBOS}-$$TAG ]; then \
mkdir ${PHOBOS}-$$TAG && \
cd ${PHOBOS}-$$TAG && \
git clone [email protected]:D-Programming-Language/phobos . ; \
else \
cd ${PHOBOS}-$$TAG ; \
fi && \
git checkout v$$TAG && \
make -f posix.mak \
DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos html -j 4
druntime:
cd ${DRUNTIME} && make -f posix.mak \
DOCDIR=${DOC_OUTPUT_DIR}/phobos-prerelease \
DOCFMT=../d-programming-language.org/std.ddoc \
doc -j 4
druntime-last-release:
cd ${DRUNTIME} && \
TAG=$$(git tag | sed 's/druntime.*-//' | sort -nr | head -n 1) && \
git checkout master && \
(git branch -D last-release || true) && \
git checkout -b last-release druntime-$$TAG && \
make -f posix.mak \
DOCDIR=${DOC_OUTPUT_DIR}/phobos \
DOCFMT=../d-programming-language.org/std.ddoc doc -j 4 && \
git checkout master
rsync : all
rsync -avz $(DOC_OUTPUT_DIR)/ [email protected]:data/