Skip to content

move macros to spec/spec.ddoc #2095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WalterBright
Copy link
Member

Since they only apply to the spec.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@wilzbach
Copy link
Member

Sadly there's a common macro file that is used by all three spec builds (html, pdf, epub), but they all use different ones:

dlang.org/posix.mak

Lines 470 to 471 in 0c475b6

$W/spec/%.html : spec/%.dd $(SPEC_DDOC) $(DMD) $(DDOC_BIN)
$(DDOC_BIN) --compiler=$(DMD) -o$@ $(SPEC_DDOC) $<

dlang.org/posix.mak

Lines 522 to 523 in 0c475b6

$G/dlangspec.html : $(DDOC) ebook.ddoc $G/dlangspec.d $(DMD)
$(DMD) -conf= -Df$@ $(DDOC) ebook.ddoc $G/dlangspec.d

dlang.org/posix.mak

Lines 545 to 546 in 0c475b6

$G/dlangspec.tex : $G/dlangspec-consolidated.d $(DMD) $(DDOC) spec/latex.ddoc $(NODATETIME)
$(DMD) -conf= -Df$@ $(DDOC) spec/latex.ddoc $(NODATETIME) $<

Should I quickly add a spec/macros.dd which is shared by all three or do you have a better idea?

@WalterBright
Copy link
Member Author

I said it was a disaster :-)

The reason for 3 .ddoc files is there's no way to do conditionals with macros. So for different expansions, different .ddoc files are needed. However, the identical macros should be merged into a common file.

Feel free to reorganize it. Just be sure and add comments to the makefile about what is going on!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants