Skip to content

Commit d9852b6

Browse files
authored
Merge pull request #2177 from wilzbach/ddoc-bin
Use the $(DDOC_BIN) preprocessor with --compiler" merged-on-behalf-of: Vladimir Panteleev <github@thecybershadow.net>
2 parents 4480f07 + 1125ab7 commit d9852b6

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

ddoc_preprocessor.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ int main(string[] rootArgs)
3333
import std.getopt;
3434
auto helpInformation = getopt(
3535
rootArgs, std.getopt.config.passThrough,
36+
std.getopt.config.required,
3637
"compiler", "Compiler to use", &config.dmdBinPath,
3738
);
3839
if (helpInformation.helpWanted)

posix.mak

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ DDOC_VARS_PRERELEASE_VERBATIM=$(DDOC_VARS_PRERELEASE) \
284284
################################################################################
285285

286286
DDOC_BIN:=$G/ddoc
287+
DDOC_BIN_DMD:=$(DDOC_BIN) --compiler=$(DMD)
287288

288289
################################################################################
289290
# Resources
@@ -464,16 +465,16 @@ dautotest: all verbatim pdf diffable-intermediaries
464465
# sub-directories before their parents.
465466

466467
$W/changelog/%.html : changelog/%_pre.dd $(CHANGELOG_PRE_DDOC) $(DDOC_BIN) | $(DMD)
467-
$(DDOC_BIN) -conf= -c -o- -Df$@ $(CHANGELOG_PRE_DDOC) $<
468+
$(DDOC_BIN_DMD) -conf= -c -o- -Df$@ $(CHANGELOG_PRE_DDOC) $<
468469

469470
$W/changelog/pending.html : changelog/pending.dd $(CHANGELOG_PENDING_DDOC) $(DDOC_BIN) | $(DMD)
470-
$(DDOC_BIN) -conf= -c -o- -Df$@ $(CHANGELOG_PENDING_DDOC) $<
471+
$(DDOC_BIN_DMD) -conf= -c -o- -Df$@ $(CHANGELOG_PENDING_DDOC) $<
471472

472473
$W/changelog/%.html : changelog/%.dd $(CHANGELOG_DDOC) $(DDOC_BIN) | $(DMD)
473-
$(DDOC_BIN) -conf= -c -o- -Df$@ $(CHANGELOG_DDOC) $<
474+
$(DDOC_BIN_DMD) -conf= -c -o- -Df$@ $(CHANGELOG_DDOC) $<
474475

475476
$W/spec/%.html : spec/%.dd $(SPEC_DDOC) $(DMD) $(DDOC_BIN)
476-
$(DDOC_BIN) --compiler=$(DMD) -Df$@ $(SPEC_DDOC) $<
477+
$(DDOC_BIN_DMD) -Df$@ $(SPEC_DDOC) $<
477478

478479
$W/404.html : 404.dd $(DDOC) $(DMD)
479480
$(DMD) -conf= -c -o- -Df$@ $(DDOC) errorpage.ddoc $<
@@ -482,19 +483,19 @@ $(DOC_OUTPUT_DIR)/contributors.html: contributors.dd $G/contributors_list.ddoc $
482483
$(DMD) -conf= -c -o- -Df$@ $(DDOC) $(word 2, $^) $<
483484

484485
$W/articles/%.html : articles/%.dd $(DDOC) $(DMD) $(DDOC_BIN) articles/articles.ddoc
485-
$(DDOC_BIN) --compiler=$(DMD) -conf= -c -o- -Df$@ $(DDOC) $< articles/articles.ddoc
486+
$(DDOC_BIN_DMD) -conf= -c -o- -Df$@ $(DDOC) $< articles/articles.ddoc
486487

487488
$W/foundation/%.html : foundation/%.dd $(DDOC) $(DMD) $(DDOC_BIN) foundation/foundation.ddoc
488-
$(DDOC_BIN) --compiler=$(DMD) -conf= -c -o- -Df$@ $(DDOC) $< foundation/foundation.ddoc
489+
$(DDOC_BIN_DMD) -conf= -c -o- -Df$@ $(DDOC) $< foundation/foundation.ddoc
489490

490491
$W/%.html : %.dd $(DDOC) $(DMD) $(DDOC_BIN)
491-
$(DDOC_BIN) --compiler=$(DMD) -conf= -c -o- -Df$@ $(DDOC) $<
492+
$(DDOC_BIN_DMD) -conf= -c -o- -Df$@ $(DDOC) $<
492493

493-
$W/%.verbatim : %_pre.dd verbatim.ddoc $(DMD)
494-
$(DMD) -c -o- -Df$@ verbatim.ddoc $<
494+
$W/%.verbatim : %_pre.dd verbatim.ddoc $(DDOC_BIN)
495+
$(DDOC_BIN_DMD) -c -o- -Df$@ verbatim.ddoc $<
495496

496-
$W/%.verbatim : %.dd verbatim.ddoc $(DMD)
497-
$(DMD) -c -o- -Df$@ verbatim.ddoc $<
497+
$W/%.verbatim : %.dd verbatim.ddoc $(DDOC_BIN)
498+
$(DDOC_BIN_DMD) -c -o- -Df$@ verbatim.ddoc $<
498499

499500
$W/%.php : %.php.dd $(DDOC) $(DMD)
500501
$(DMD) -conf= -c -o- -Df$@ $(DDOC) $<
@@ -515,7 +516,7 @@ $W/% : %
515516
cp $< $@
516517

517518
$W/dmd-%.html : %.ddoc dcompiler.dd $(DDOC) $(DDOC_BIN)
518-
$(DDOC_BIN) -Df$@ $(DDOC) dcompiler.dd $<
519+
$(DDOC_BIN_DMD) -Df$@ $(DDOC) dcompiler.dd $<
519520

520521
$W/dmd-%.verbatim : %.ddoc dcompiler.dd verbatim.ddoc $(DMD)
521522
$(DMD) -c -o- -Df$@ verbatim.ddoc dcompiler.dd $<
@@ -530,8 +531,8 @@ $W:
530531
$G/dlangspec.d : $(SPEC_DD) ${STABLE_DMD}
531532
$(STABLE_RDMD) $(TOOLS_DIR)/catdoc.d -o$@ $(SPEC_DD)
532533

533-
$G/dlangspec.html : $(DDOC) ebook.ddoc $G/dlangspec.d $(DMD)
534-
$(DMD) -conf= -Df$@ $(DDOC) ebook.ddoc $G/dlangspec.d
534+
$G/dlangspec.html : $(DDOC) ebook.ddoc $G/dlangspec.d $(DMD) $(DDOC_BIN)
535+
$(DDOC_BIN_DMD) -conf= -Df$@ $(DDOC) ebook.ddoc $G/dlangspec.d
535536

536537
$G/dlangspec.zip : $G/dlangspec.html ebook.css
537538
rm -f $@
@@ -553,8 +554,8 @@ $W/dlangspec.mobi : \
553554
$G/dlangspec-consolidated.d : $(SPEC_DD) ${STABLE_DMD}
554555
$(STABLE_RDMD) --force $(TOOLS_DIR)/catdoc.d -o$@ $(SPEC_DD)
555556

556-
$G/dlangspec.tex : $G/dlangspec-consolidated.d $(DMD) $(DDOC) spec/latex.ddoc $(NODATETIME)
557-
$(DMD) -conf= -Df$@ $(DDOC) spec/latex.ddoc $(NODATETIME) $<
557+
$G/dlangspec.tex : $G/dlangspec-consolidated.d $(DDOC_BIN) $(DDOC) spec/latex.ddoc $(NODATETIME)
558+
$(DDOC_BIN_DMD) -conf= -Df$@ $(DDOC) spec/latex.ddoc $(NODATETIME) $<
558559

559560
# Run twice to fix multipage tables and \ref uses
560561
$W/dlangspec.pdf : $G/dlangspec.tex | $W
@@ -572,11 +573,11 @@ $W/dlangspec.html: $G/dlangspec.html | $W
572573
# Plaintext/verbatim generation - not part of the build, demo purposes only
573574
################################################################################
574575

575-
$G/dlangspec.txt : $G/dlangspec-consolidated.d $(DMD) macros.ddoc plaintext.ddoc
576-
$(DMD) -conf= -Df$@ macros.ddoc plaintext.ddoc $<
576+
$G/dlangspec.txt : $G/dlangspec-consolidated.d $(DDOC_BIN) macros.ddoc plaintext.ddoc
577+
$(DDOC_BIN_DMD) -conf= -Df$@ macros.ddoc plaintext.ddoc $<
577578

578-
$G/dlangspec.verbatim.txt : $G/dlangspec-consolidated.d $(DMD) verbatim.ddoc
579-
$(DMD) -conf= -Df$@ verbatim.ddoc $<
579+
$G/dlangspec.verbatim.txt : $G/dlangspec-consolidated.d $(DDOC_BIN) verbatim.ddoc
580+
$(DDOC_BIN_DMD) -conf= -Df$@ verbatim.ddoc $<
580581

581582
################################################################################
582583
# Fetch the latest article from the official D blog
@@ -987,7 +988,7 @@ $G/contributors_list.ddoc: | $(STABLE_RDMD) $(TOOLS_DIR) $(INSTALLER_DIR)
987988
# It is currently only used for the specification pages
988989
################################################################################
989990

990-
$(DDOC_BIN): ddoc_preprocessor.d | $(STABLE_DMD)
991+
$(DDOC_BIN): ddoc_preprocessor.d | $(STABLE_DMD) $(DMD)
991992
$(STABLE_RDMD) -version=DdocOptions --build-only -g -of$@ -I$(DMD_DIR)/src $<
992993

993994
################################################################################

0 commit comments

Comments
 (0)