Skip to content

Commit 1125ab7

Browse files
committed
Use the $(DDOC_BIN) preprocessor only with --compiler"
1 parent f9fb5f8 commit 1125ab7

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
@@ -283,6 +283,7 @@ DDOC_VARS_PRERELEASE_VERBATIM=$(DDOC_VARS_PRERELEASE) \
283283
################################################################################
284284

285285
DDOC_BIN:=$G/ddoc
286+
DDOC_BIN_DMD:=$(DDOC_BIN) --compiler=$(DMD)
286287

287288
################################################################################
288289
# Resources
@@ -463,16 +464,16 @@ dautotest: all verbatim pdf diffable-intermediaries
463464
# sub-directories before their parents.
464465

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

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

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

474475
$W/spec/%.html : spec/%.dd $(SPEC_DDOC) $(DMD) $(DDOC_BIN)
475-
$(DDOC_BIN) --compiler=$(DMD) -Df$@ $(SPEC_DDOC) $<
476+
$(DDOC_BIN_DMD) -Df$@ $(SPEC_DDOC) $<
476477

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

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

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

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

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

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

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

516517
$W/dmd-%.html : %.ddoc dcompiler.dd $(DDOC) $(DDOC_BIN)
517-
$(DDOC_BIN) -Df$@ $(DDOC) dcompiler.dd $<
518+
$(DDOC_BIN_DMD) -Df$@ $(DDOC) dcompiler.dd $<
518519

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

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

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

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

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

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

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

580581
################################################################################
581582
# Fetch the latest article from the official D blog
@@ -983,7 +984,7 @@ $G/contributors_list.ddoc: | $(STABLE_RDMD) $(TOOLS_DIR) $(INSTALLER_DIR)
983984
# It is currently only used for the specification pages
984985
################################################################################
985986

986-
$(DDOC_BIN): ddoc_preprocessor.d | $(STABLE_DMD)
987+
$(DDOC_BIN): ddoc_preprocessor.d | $(STABLE_DMD) $(DMD)
987988
$(STABLE_RDMD) -version=DdocOptions --build-only -g -of$@ -I$(DMD_DIR)/src $<
988989

989990
################################################################################

0 commit comments

Comments
 (0)