/
posix.mak
464 lines (377 loc) · 17.9 KB
/
posix.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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# Makefile to build the entire dlang.org website
#
# To run:
#
# make -f posix.mak all
#
# To also upload to the website:
#
# make -f posix.mak rsync
#
# Externals
DMD_DIR=../dmd
PHOBOS_DIR=../phobos
DRUNTIME_DIR=../druntime
DUB_DIR=../dub-${DUB_VER}
DMD=$(DMD_DIR)/src/dmd
DMD_REL=$(DMD_DIR)-${LATEST}/src/dmd
DUB=${DUB_DIR}/bin/dub
DOC_OUTPUT_DIR:=$(shell pwd)/web
GIT_HOME=https://github.com/D-Programming-Language
DPL_DOCS_PATH=dpl-docs
DPL_DOCS=$(DPL_DOCS_PATH)/dpl-docs
REMOTE_DIR=d-programming@digitalmars.com:data
GENERATED=.generated
# stable dub and dmd versions used to build dpl-docs
DUB_VER=0.9.22
STABLE_DMD_VER=2.066.1
STABLE_DMD_ROOT=/tmp/.stable_dmd-$(STABLE_DMD_VER)
STABLE_DMD_URL=http://downloads.dlang.org/releases/2014/dmd.$(STABLE_DMD_VER).$(OS).zip
STABLE_DMD=$(STABLE_DMD_ROOT)/dmd2/$(OS)/$(if $(filter $(OS),osx),bin,bin$(MODEL))/dmd
# exclude lists
MOD_EXCLUDES_PRERELEASE=$(addprefix --ex=, gc. rt. core.internal. core.stdc.config core.sys. \
std.c. std.algorithm.internal std.internal. std.regex.internal. std.typelist \
std.windows. etc.linux.memoryerror)
MOD_EXCLUDES_RELEASE=$(MOD_EXCLUDES_PRERELEASE) --ex=core.stdc.
# rdmd must fetch the model, imports, and libs from the specified version
DFLAGS=-m$(MODEL) -I$(DRUNTIME_DIR)/import -I$(PHOBOS_DIR) -L-L$(PHOBOS_DIR)/generated/$(OS)/release/$(MODEL)
RDMD=rdmd --compiler=$(DMD) $(DFLAGS)
# Tools
REBASE = MYBRANCH=`git rev-parse --abbrev-ref HEAD` &&\
git checkout master &&\
git pull --ff-only git@github.com:D-Programming-Language/$1.git master &&\
git checkout $$MYBRANCH &&\
git rebase master
CHANGE_SUFFIX = \
for f in `find "$3" -iname '*.$1'`; do\
mv $$f `dirname $$f`/`basename $$f .$1`.$2; done
# Set to 1 in the command line to minify css files
CSS_MINIFY=
# Latest released version
ifeq (,${LATEST})
LATEST:=$(shell cd ${DMD_DIR} && \
git fetch --tags ${GIT_HOME}/dmd && \
git tag | grep '^v[0-9][0-9.]*$$' | sed 's/^v//' | sort -nr | head -n 1)
endif
ifeq (,${LATEST})
$(error Could not fetch latest version)
endif
$(info Current release: ${LATEST})
# OS and MODEL
OS:=
uname_S:=$(shell uname -s)
ifeq (Darwin,$(uname_S))
OS:=osx
endif
ifeq (Linux,$(uname_S))
OS:=linux
endif
ifeq (FreeBSD,$(uname_S))
OS:=freebsd
endif
ifeq (OpenBSD,$(uname_S))
OS:=openbsd
endif
ifeq (Solaris,$(uname_S))
OS:=solaris
endif
ifeq (SunOS,$(uname_S))
OS:=solaris
endif
ifeq (,$(OS))
$(error Unrecognized or unsupported OS for uname: $(uname_S))
endif
ifeq (,$(MODEL))
uname_M:=$(shell uname -m)
ifneq (,$(findstring $(uname_M),x86_64 amd64))
MODEL:=64
endif
ifneq (,$(findstring $(uname_M),i386 i586 i686))
MODEL:=32
endif
ifeq (,$(MODEL))
$(error Cannot figure 32/64 model from uname -m: $(uname_M))
endif
endif
# Documents
DDOC=$(addsuffix .ddoc, macros html dlang.org doc ${GENERATED}/${LATEST}) $(NODATETIME)
STD_DDOC=$(addsuffix .ddoc, macros html dlang.org ${GENERATED}/${LATEST} std std_navbar-release ${GENERATED}/modlist-${LATEST})
STD_DDOC_PRE=$(addsuffix .ddoc, macros html dlang.org ${GENERATED}/${LATEST} std std_navbar-prerelease ${GENERATED}/modlist-prerelease)
IMAGES=favicon.ico $(addprefix images/, \
d002.ico \
$(addsuffix .svg, icon_minus icon_plus dlogo faster-gc-1) \
$(addsuffix .png, apple_logo centos_logo d3 debian_logo dlogo \
fedora_logo freebsd_logo opensuse_logo ubuntu_logo windows_logo \
pattern github-ribbon \
$(addprefix ddox/, alias class enum enummember function \
inherited interface module package private property protected \
struct template variable)) \
$(addsuffix .gif, c1 cpp1 d4 d5 dmlogo dmlogo-smaller globe \
pen) \
$(addsuffix .jpg, tdpl))
JAVASCRIPT=$(addsuffix .js, $(addprefix js/, \
codemirror-compressed cssmenu ddox listanchors run run-main-website))
STYLES=$(addsuffix .css, $(addprefix css/, \
style print codemirror ddox cssmenu))
PRETTIFY=prettify/prettify.css prettify/prettify.js
PREMADE=appendices.html articles.html fetch-issue-cnt.php \
howtos.html language-reference.html robots.txt .htaccess process.php
# Language spec root filenames. They have extension .dd in the source
# and .html in the generated HTML. These are also used for the mobi
# book generation, for which reason the list is sorted by chapter.
SPEC_ROOT=spec intro lex grammar module declaration type property attribute pragma \
expression statement arrays hash-map struct class interface enum \
const3 function operatoroverloading template template-mixin contracts \
version traits errors unittest garbage float iasm ddoc \
interfaceToC cpp_interface portability entity memory-safe-d abi \
simd
# Website root filenames. They have extension .dd in the source
# and .html in the generated HTML. Save for the expansion of
# $(SPEC_ROOT), the list is sorted alphabetically.
PAGES_ROOT=$(SPEC_ROOT) 32-64-portability acknowledgements ascii-table \
bugstats.php builtin changelog code_coverage concepts const-faq COM \
comparison cpptod ctod D1toD2 d-array-article d-floating-point \
deprecate dll dll-linux dmd-freebsd dmd-linux dmd-osx dmd-windows \
download dstyle exception-safe faq features2 getstarted glossary gsoc2011 \
gsoc2012 gsoc2012-template hijack howto-promote htod htomodule index intro \
intro-to-datetime lazy-evaluation memory migrate-to-shared mixin \
overview pretod rationale rdmd regular-expression safed \
template-comparison templates-revisited tuple \
variadic-function-templates warnings wc windbg windows
TARGETS=$(addsuffix .html,$(PAGES_ROOT))
ALL_FILES_BUT_SITEMAP = $(addprefix $(DOC_OUTPUT_DIR)/, $(TARGETS) \
$(PREMADE) $(STYLES) $(IMAGES) $(JAVASCRIPT) $(PRETTIFY))
ALL_FILES = $(ALL_FILES_BUT_SITEMAP) $(DOC_OUTPUT_DIR)/sitemap.html
# Pattern rulez
$(DOC_OUTPUT_DIR)/%.html : %.dd $(DDOC) $(DMD)
$(DMD) -conf= -c -o- -Df$@ $(DDOC) $<
$(DOC_OUTPUT_DIR)/%.verbatim : %.dd verbatim.ddoc $(DMD)
$(DMD) -c -o- -Df$@ verbatim.ddoc $<
$(DOC_OUTPUT_DIR)/%.php : %.php.dd $(DDOC) $(DMD)
$(DMD) -conf= -c -o- -Df$@ $(DDOC) $<
$(DOC_OUTPUT_DIR)/css/% : css/%
@mkdir -p $(dir $@)
ifeq (1,$(CSS_MINIFY))
curl -X POST -fsS --data-urlencode 'input@$<' http://cssminifier.com/raw >$@
else
cp $< $@
endif
$(DOC_OUTPUT_DIR)/%.css : %.css.dd $(DMD)
$(DMD) -c -o- -Df$@ $<
$(DOC_OUTPUT_DIR)/% : %
@mkdir -p $(dir $@)
cp $< $@
$(DOC_OUTPUT_DIR)/dmd-%.html : %.ddoc dcompiler.dd $(DDOC) $(DMD)
$(DMD) -conf= -c -o- -Df$@ $(DDOC) dcompiler.dd $<
$(DOC_OUTPUT_DIR)/dmd-%.verbatim : %.ddoc dcompiler.dd verbatim.ddoc $(DMD)
$(DMD) -c -o- -Df$@ verbatim.ddoc dcompiler.dd $<
################################################################################
# Rulez
################################################################################
all : docs html
docs : phobos-prerelease druntime-prerelease druntime-release phobos-release \
apidocs-release apidocs-prerelease
html : $(ALL_FILES)
verbatim : $(addprefix $(DOC_OUTPUT_DIR)/, $(addsuffix .verbatim,$(PAGES_ROOT))) phobos-prerelease-verbatim
kindle : ${DOC_OUTPUT_DIR}/dlangspec.mobi
pdf : ${DOC_OUTPUT_DIR}/dlangspec.pdf
$(DOC_OUTPUT_DIR)/sitemap.html : $(ALL_FILES_BUT_SITEMAP) $(DMD)
cp -f sitemap-template.dd sitemap.dd
(true $(foreach F, $(TARGETS), \
&& echo \
"$F `sed -n 's/<title>\(.*\) - D Programming Language.*<\/title>/\1/'p $(DOC_OUTPUT_DIR)/$F`")) \
| sort --ignore-case --key=2 | sed 's/^\([^ ]*\) \(.*\)/<a href="\1">\2<\/a><p>/' >> sitemap.dd
$(DMD) -conf= -c -o- -Df$@ $(DDOC) sitemap.dd
rm sitemap.dd
${GENERATED}/${LATEST}.ddoc :
mkdir -p $(dir $@)
echo "LATEST=${LATEST}" >$@
${GENERATED}/modlist-${LATEST}.ddoc : modlist.d $(DRUNTIME_DIR)-$(LATEST)/.cloned $(PHOBOS_DIR)-$(LATEST)/.cloned
mkdir -p $(dir $@)
$(RDMD) modlist.d $(DRUNTIME_DIR)-$(LATEST) $(PHOBOS_DIR)-$(LATEST) $(MOD_EXCLUDES_RELEASE) >$@
${GENERATED}/modlist-prerelease.ddoc : modlist.d $(DRUNTIME_DIR)/.cloned $(PHOBOS_DIR)/.cloned
mkdir -p $(dir $@)
$(RDMD) modlist.d $(DRUNTIME_DIR) $(PHOBOS_DIR) $(MOD_EXCLUDES_PRERELEASE) >$@
# Run "make -j rebase" for rebasing all dox in parallel!
rebase: rebase-dlang rebase-dmd rebase-druntime rebase-phobos
rebase-dlang: ; $(call REBASE,dlang.org)
rebase-dmd: ; cd $(DMD_DIR) && $(call REBASE,dmd)
rebase-druntime: ; cd $(DRUNTIME_DIR) && $(call REBASE,druntime)
rebase-phobos: ; cd $(PHOBOS_DIR) && $(call REBASE,phobos)
clean:
rm -rf $(DOC_OUTPUT_DIR) ${GENERATED} dpl-docs/.dub
rm -rf auto dlangspec-consolidated.d $(addprefix dlangspec,.aux .d .dvi .fdb_latexmk .fls .log .out .pdf .tex .txt .verbatim.txt)
rm -f docs.json docs-prerelease.json dpl-docs/dpl-docs
@echo You should issue manually: rm -rf ${DMD_DIR}-${LATEST} ${DRUNTIME_DIR}-${LATEST} ${PHOBOS_DIR}-${LATEST} ${STABLE_DMD_ROOT} ${DUB_DIR}
rsync : all kindle pdf
rsync -avz --chmod=u=rwX,g=rwX,o=rX $(DOC_OUTPUT_DIR)/ $(REMOTE_DIR)/
rsync-only :
rsync -avz --chmod=u=rwX,g=rwX,o=rX $(DOC_OUTPUT_DIR)/ $(REMOTE_DIR)/
################################################################################
# Ebook
################################################################################
dlangspec.d : $(addsuffix .dd,$(SPEC_ROOT))
$(RDMD) ../tools/catdoc.d -o$@ $^
dlangspec.html : $(DDOC) ebook.ddoc dlangspec.d $(DMD)
$(DMD) -conf= $(DDOC) ebook.ddoc dlangspec.d
dlangspec.zip : dlangspec.html ebook.css
rm -f $@
zip $@ dlangspec.html ebook.css
$(DOC_OUTPUT_DIR)/dlangspec.mobi : \
dlangspec.opf dlangspec.html dlangspec.png dlangspec.ncx ebook.css
rm -f $@ dlangspec.mobi
# kindlegen has warnings, ignore them for now
-kindlegen dlangspec.opf
mv dlangspec.mobi $@
################################################################################
# LaTeX
################################################################################
dlangspec-consolidated.d : $(addsuffix .dd,$(SPEC_ROOT))
$(RDMD) --force ../tools/catdoc.d -o$@ $^
dlangspec.tex : $(DMD) $(DDOC) latex.ddoc dlangspec-consolidated.d
$(DMD) -conf= -Df$@ $(DDOC) latex.ddoc dlangspec-consolidated.d
# Run twice to fix multipage tables and \ref uses
$(DOC_OUTPUT_DIR)/dlangspec.pdf : dlangspec.tex
mkdir -p .tmp
pdflatex -draftmode $^
pdflatex -output-directory=.tmp $^
mv .tmp/dlangspec.pdf $@
rm -rf .tmp
################################################################################
# Plaintext/verbatim generation - not part of the build, demo purposes only
################################################################################
dlangspec.txt : $(DMD) macros.ddoc plaintext.ddoc dlangspec-consolidated.d
$(DMD) -conf= -Df$@ macros.ddoc plaintext.ddoc dlangspec-consolidated.d
dlangspec.verbatim.txt : $(DMD) verbatim.ddoc dlangspec-consolidated.d
$(DMD) -conf= -Df$@ verbatim.ddoc dlangspec-consolidated.d
################################################################################
# Git rules
################################################################################
../%-${LATEST}/.cloned :
[ -d $(@D) ] || git clone -b v${LATEST} --depth=1 ${GIT_HOME}/$* $(@D)/
touch $@
../%-${DUB_VER}/.cloned :
[ -d $(@D) ] || git clone -b v${DUB_VER} --depth=1 ${GIT_HOME}/$* $(@D)/
touch $@
../%/.cloned :
[ -d $(@D) ] || git clone --depth=1 ${GIT_HOME}/$* $(@D)/
touch $@
################################################################################
# dmd compiler, latest released build and current build
################################################################################
$(DMD) : ${DMD_DIR}/.cloned
${MAKE} --directory=${DMD_DIR}/src -f posix.mak -j 4
$(DMD_REL) : ${DMD_DIR}-${LATEST}/.cloned
${MAKE} --directory=${DMD_DIR}-${LATEST}/src -f posix.mak -j 4
################################################################################
# druntime, latest released build and current build
################################################################################
druntime-prerelease : ${DRUNTIME_DIR}/.cloned ${DOC_OUTPUT_DIR}/phobos-prerelease/object.html
${DOC_OUTPUT_DIR}/phobos-prerelease/object.html : $(DMD) $(STD_DDOC_PRE)
${MAKE} --directory=${DRUNTIME_DIR} -f posix.mak -j 4 target doc \
DOCDIR=${DOC_OUTPUT_DIR}/phobos-prerelease \
DOCFMT="$(addprefix `pwd`/, $(STD_DDOC_PRE))"
druntime-release : ${DRUNTIME_DIR}-${LATEST}/.cloned ${DOC_OUTPUT_DIR}/phobos/object.html
${DOC_OUTPUT_DIR}/phobos/object.html : $(DMD_REL) $(STD_DDOC)
${MAKE} --directory=${DRUNTIME_DIR}-${LATEST} -f posix.mak target doc \
DMD=$(DMD_REL) \
DOCDIR=${DOC_OUTPUT_DIR}/phobos \
DOCFMT="$(addprefix `pwd`/, $(STD_DDOC))"
druntime-prerelease-verbatim : ${DRUNTIME_DIR}/.cloned \
${DOC_OUTPUT_DIR}/phobos-prerelease/object.verbatim
${DOC_OUTPUT_DIR}/phobos-prerelease/object.verbatim : $(DMD)
${MAKE} --directory=${DRUNTIME_DIR} -f posix.mak -j 4 target doc \
DOCDIR=${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim \
DOCFMT="`pwd`/verbatim.ddoc"
mkdir -p $(dir $@)
$(call CHANGE_SUFFIX,html,verbatim,${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim)
mv ${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim/* $(dir $@)
rm -r ${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim
################################################################################
# phobos, latest released build and current build
################################################################################
.PHONY: phobos-prerelease
phobos-prerelease : ${PHOBOS_DIR}/.cloned ${DOC_OUTPUT_DIR}/phobos-prerelease/index.html
${DOC_OUTPUT_DIR}/phobos-prerelease/index.html : $(STD_DDOC_PRE) \
${DOC_OUTPUT_DIR}/phobos-prerelease/object.html
${MAKE} --directory=${PHOBOS_DIR} -f posix.mak \
STDDOC="$(addprefix `pwd`/, $(STD_DDOC_PRE))" \
DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos-prerelease html -j 4
phobos-release : ${PHOBOS_DIR}-${LATEST}/.cloned ${DOC_OUTPUT_DIR}/phobos/index.html
${DOC_OUTPUT_DIR}/phobos/index.html : $(DMD_REL) $(STD_DDOC) \
${DOC_OUTPUT_DIR}/phobos/object.html
${MAKE} --directory=${PHOBOS_DIR}-${LATEST} -f posix.mak -j 4 \
html \
DMD=$(DMD_REL) \
DRUNTIME_PATH=${DRUNTIME_DIR}-${LATEST} \
DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos \
STDDOC="$(addprefix `pwd`/, $(STD_DDOC))"
phobos-prerelease-verbatim : ${PHOBOS_DIR}/.cloned ${DOC_OUTPUT_DIR}/phobos-prerelease/index.verbatim
${DOC_OUTPUT_DIR}/phobos-prerelease/index.verbatim : verbatim.ddoc \
${DOC_OUTPUT_DIR}/phobos-prerelease/object.verbatim
${MAKE} --directory=${PHOBOS_DIR} -f posix.mak \
STDDOC="`pwd`/verbatim.ddoc" \
DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim html -j 4
$(call CHANGE_SUFFIX,html,verbatim,${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim)
mv ${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim/* $(dir $@)
rm -r ${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim
################################################################################
# phobos and druntime, latest released build and current build (DDOX version)
################################################################################
apidocs-prerelease : ${DOC_OUTPUT_DIR}/library-prerelease/sitemap.xml
apidocs-release : ${DOC_OUTPUT_DIR}/library/sitemap.xml
apidocs-serve : docs-prerelease.json
${DPL_DOCS} serve-html --std-macros=html.ddoc --std-macros=dlang.org.ddoc --std-macros=std.ddoc --std-macros=macros.ddoc --std-macros=std-ddox.ddoc \
--override-macros=std-ddox-override.ddoc --package-order=std \
--git-target=master --web-file-dir=. docs-prerelease.json
${DOC_OUTPUT_DIR}/library-prerelease/sitemap.xml : docs-prerelease.json
@mkdir -p $(dir $@)
${DPL_DOCS} generate-html --file-name-style=lowerUnderscored --std-macros=html.ddoc --std-macros=dlang.org.ddoc --std-macros=std.ddoc --std-macros=macros.ddoc --std-macros=std-ddox.ddoc \
--override-macros=std-ddox-override.ddoc --package-order=std \
--git-target=master docs-prerelease.json ${DOC_OUTPUT_DIR}/library-prerelease
${DOC_OUTPUT_DIR}/library/sitemap.xml : docs.json
@mkdir -p $(dir $@)
${DPL_DOCS} generate-html --file-name-style=lowerUnderscored --std-macros=html.ddoc --std-macros=dlang.org.ddoc --std-macros=std.ddoc --std-macros=macros.ddoc --std-macros=std-ddox.ddoc \
--override-macros=std-ddox-override.ddoc --package-order=std \
--git-target=v${LATEST} docs.json ${DOC_OUTPUT_DIR}/library
docs.json : ${DMD_REL} ${DRUNTIME_DIR}-${LATEST}/.cloned \
${PHOBOS_DIR}-${LATEST}/.cloned | dpl-docs
find ${DRUNTIME_DIR}-${LATEST}/src -name '*.d' | \
sed -e /unittest.d/d -e /gcstub/d > .release-files.txt
find ${PHOBOS_DIR}-${LATEST} -name '*.d' | \
sed -e /unittest.d/d -e /format/d -e /windows/d >> .release-files.txt
${DMD_REL} -c -o- -version=CoreDdoc -version=StdDdoc -Df.release-dummy.html \
-Xfdocs.json -I${PHOBOS_DIR}-${LATEST} @.release-files.txt
${DPL_DOCS} filter docs.json --min-protection=Protected \
--only-documented $(MOD_EXCLUDES_PRERELEASE)
rm .release-files.txt .release-dummy.html
docs-prerelease.json : ${DMD} ${DRUNTIME_DIR}/.cloned \
${PHOBOS_DIR}/.cloned | dpl-docs
find ${DRUNTIME_DIR}/src -name '*.d' | sed -e '/gcstub/d' \
-e /unittest/d > .prerelease-files.txt
find ${PHOBOS_DIR} -name '*.d' | sed -e /unittest.d/d -e /format/d \
-e /windows/d >> .prerelease-files.txt
${DMD} -c -o- -version=CoreDdoc -version=StdDdoc -Df.prerelease-dummy.html \
-Xfdocs-prerelease.json -I${PHOBOS_DIR} @.prerelease-files.txt
${DPL_DOCS} filter docs-prerelease.json --min-protection=Protected \
--only-documented $(MOD_EXCLUDES_RELEASE)
rm .prerelease-files.txt .prerelease-dummy.html
################################################################################
# binary targets for DDOX
################################################################################
.PHONY: dpl-docs
dpl-docs: ${DUB} ${STABLE_DMD}
${DUB} build --root=${DPL_DOCS_PATH} --compiler=${STABLE_DMD}
${STABLE_DMD}:
mkdir -p ${STABLE_DMD_ROOT}
TMPFILE=$$(mktemp deleteme.XXXXXXXX) && curl -fsSL ${STABLE_DMD_URL} > $${TMPFILE}.zip && \
unzip -qd ${STABLE_DMD_ROOT} $${TMPFILE}.zip && rm $${TMPFILE}.zip
${DUB}: ${DUB_DIR}/.cloned ${STABLE_DMD}
cd ${DUB_DIR} && DC=$(abspath ${STABLE_DMD}) ./build.sh
################################################################################
# Dman tags
################################################################################
chmgen : chmgen.d $(DMD)
$(DMD) -I${PHOBOS_DIR} -g chmgen.d
d.tag : chmgen $(ALL_FILES)
./chmgen --root=$(DOC_OUTPUT_DIR) --only-tags