Skip to content

Commit 6e5fdcd

Browse files
authored
Merge pull request #1827 from wilzbach/fix-17649
Fix Issue 17649 - CONTRIBUTING.md instructions failed (no ../druntime…
2 parents 0eaa9c4 + ebf8e2c commit 6e5fdcd

File tree

2 files changed

+46
-43
lines changed

2 files changed

+46
-43
lines changed

CONTRIBUTING.md

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,34 @@ Make sure you have these prerequisites working:
1111
* The C++ compiler for your platform (invokable as `gcc`)
1212
* Optional: `latex` for building the pdf documentation
1313
* Optional: `kindlegen` for building the Kindle documentation
14-
* If you're running OSX, make sure you have some version of `libevent` installed
14+
* If you're running OSX, make sure you have some version of `libevent` installed (needed for Ddox)
1515

1616
## Getting the code
1717

18-
Create a working directory for the D language, e.g. `~/code/d`. The remainder
19-
of this document calls that directory henceforth `$R` from "Root". To get the
20-
code:
18+
If you already have a [working directory for the D language](https://wiki.dlang.org/Building_under_Posix#Fetch_repositories_from_GitHub),
19+
e.g. `~/dlang`, change to it.
20+
21+
To get the code, run:
2122

2223
```
23-
cd $R
2424
git clone https://github.com/dlang/dlang.org
25-
git clone https://github.com/dlang/dmd
25+
cd dlang.org
2626
```
2727

28-
The `dmd` compiler is needed for processing the documentation.
28+
The remainder of this document assumes that is your current working directory.
2929

3030
## Building the main site
3131

32-
Now in `$R` there are two directories called `dmd` and `dlang.org`. To
33-
build the main site, run this:
32+
To build the main site, run:
3433

3534
```
36-
cd $R/dlang.org
3735
make -f posix.mak html
3836
```
3937

4038
This builds the `dmd` compiler itself first and then uses it to build the
4139
website pages. You may see warnings while the compiler is built. After `make`
42-
ended with error code 0, directory `$R/dlang.org/web` contains the produced HTML
43-
files. Take a moment to open `$R/dlang.org/web/index.html` in a browser.
40+
ended with error code 0, directory `web` contains the produced HTML
41+
files. Take a moment to open `web/index.html` in a browser.
4442

4543
## Building the standard library documentation
4644

@@ -54,48 +52,47 @@ currently being worked on. The "release" version is built with the "release"
5452
compiler, and the current version is built with the current compiler (which we
5553
already have from the previous step).
5654

57-
### Building the release libraries
55+
### Building the `prerelease` libraries
5856

59-
Fortunately there's no need to fumble with version numbers and git tags etc.;
60-
all is automated. Run this command:
57+
The more interesting stuff to build is the prerelease libraries because in all
58+
likelihood that's what needs looking at and testing.
6159

6260
```
63-
cd $R/dlang.org
64-
make -f posix.mak druntime-release
65-
make -f posix.mak phobos-release
66-
make -f posix.mak apidocs-release
61+
make -f posix.mak docs-prerelease
6762
```
6863

69-
These commands tell you the release being built in their first line of output.
70-
Then they proceed and clone the appropriate release for `dmd`, `druntime`, and
71-
`phobos`. After all commands have been executed, the following directories will
72-
be present in `$R`: `dlang.org`, `dmd`, `dmd-2.083.2`, `druntime-2.083.2`, and
73-
`phobos-2.083.2`. Note that the actual release number may not be `2.083.2`, but
74-
should be the same for all three directories.
64+
If you only want to build a specific part (e.g. Phobos), run:
7565

76-
The output is in `$R/dlang.org/web/phobos` and `$R/dlang.org/web/library`.
66+
```
67+
make -f posix.mak phobos-prerelease
68+
```
7769

78-
### Building the prerelease libraries
70+
(`docs-prerelease` is a shorthand for `dmd-prerelease`, `druntime-prerelease`, `phobos-releas` and `apidocs-prerelease`)
7971

80-
The more interesting stuff to build is the prerelease libraries because in all
81-
likelihood that's what needs looking at and testing. To do that two more
82-
repositories containing the core and standard libraries are needed: `druntime`
83-
and `phobos`:
72+
The output is in `web/phobos-prerelease` and `library-prerelease`.
73+
74+
### Building the `release` libraries
75+
76+
Fortunately there's no need to fumble with version numbers and git tags etc.;
77+
all is automated. Run this command:
8478

8579
```
86-
cd $R
87-
git clone https://github.com/dlang/druntime
88-
git clone https://github.com/dlang/phobos
80+
make -f posix.mak docs-release
8981
```
9082

91-
With the new repos in tow this builds the prerelease libraries:
83+
If you only want to build a specific part (e.g. Phobos), run:
9284

9385
```
94-
cd $R/dlang.org
95-
make -f posix.mak druntime-prerelease
96-
make -f posix.mak phobos-prerelease
97-
make -f posix.mak apidocs-prerelease
86+
make -f posix.mak phobos-release
9887
```
9988

100-
The output is in `$R/dlang.org/web/phobos-prerelease` and
101-
`$R/dlang.org/web/library-prerelease`.
89+
(`docs-release` is a shorthand for `dmd-release`, `druntime-release`, `phobos-releas` and `apidocs-release`)
90+
91+
These commands tell you the release being built in their first line of output.
92+
Then they proceed and clone the appropriate release for `dmd`, `druntime`, and
93+
`phobos`. After all commands have been executed, the following directories will
94+
be present in `$R`: `dlang.org`, `dmd`, `dmd-2.083.2`, `druntime-2.083.2`, and
95+
`phobos-2.083.2`. Note that the actual release number may not be `2.083.2`, but
96+
should be the same for all three directories.
97+
98+
The output is in `web/phobos` and `web/library`.

posix.mak

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ DMD_STABLE=$(DMD_STABLE_DIR)/generated/$(OS)/release/$(MODEL)/dmd
4444
DRUNTIME_STABLE_DIR=${DRUNTIME_DIR}-${LATEST}
4545
PHOBOS_STABLE_DIR=${PHOBOS_DIR}-${LATEST}
4646

47+
# Auto-cloning missing directories
48+
$(shell [ ! -d $(DMD_DIR) ] && git clone --depth=1 ${GIT_HOME}/dmd $(DMD_DIR))
49+
$(shell [ ! -d $(DRUNTIME_DIR) ] && git clone --depth=1 ${GIT_HOME}/druntime $(DRUNTIME_DIR))
50+
4751
################################################################################
4852
# Automatically generated directories
4953
GENERATED=.generated
@@ -230,8 +234,10 @@ ALL_FILES = $(ALL_FILES_BUT_SITEMAP) $(DOC_OUTPUT_DIR)/sitemap.html
230234

231235
all : docs html
232236

233-
docs : dmd-release dmd-prerelease phobos-prerelease druntime-prerelease \
234-
druntime-release phobos-release apidocs-release apidocs-prerelease
237+
docs-release: dmd-release druntime-release phobos-release apidocs-release
238+
docs-prerelease: dmd-prerelease druntime-prerelease phobos-prerelease apidocs-prerelease
239+
240+
docs : docs-release docs-prerelease
235241

236242
html : $(ALL_FILES)
237243

0 commit comments

Comments
 (0)