https://digitalmars.com/ctg/sc.html
- Download and install Digital Mars C++ compiler from https://www.digitalmars.com/download/freecompiler.html
- Download and install DMD 2.074.1 from http://downloads.dlang.org/releases/2017/
- In the DMD installation, edit the file
src\druntime\importcore\stdc\stdio.dand replaceshared stdout = &_iob[1];withenum stdout = &_iob[1];. - Run
git submodule update --initto make sure you have up-to-date submodules. - Change directory to
dm\src\dmc - Make sure the
dm\bin\make.exeprogram is on yourPATH. - Execute the commands:
make CC=dmc cleanmake CC=dmc scppnYou might need to edit themakefileto set the path to your DMD installation.
Note that DMC runs on Win32, and hasn't been ported to other platforms. It can generate code for Win32, 16 bit DOS, 16 and 32 bit Windows, 286 DOS extenders, and 386 DOS extenders.
In order to update the backend to a more recent version, do the following:
- Go to the DMD submodule:
cd dm/src/dmd; - Fetch the latest commits:
git fetch - Checkout the desired commit, e.g.:
git checkout origin/master: Checkout the latest version of the DMD backend;git checkout v2.095.0: Checkout the state of the backend as of DMD v2.095.0;git checkout 385312b93: Checkout the state of the backend as of commit385312b93;
- Leave the
dmdrepository, e.g.cd ../../to come back to the root of this repository; - Commit the change to the submodule:
git add dm/src/dmd && git commit -m "Update DMD backend to master"
Alternatively, when pulling from this repository, remember to always run git submodule update --init
if the submodule have been updated. This is visible from git status:
$ git diff
diff --git a/dm/src/dmd b/dm/src/dmd
index 123456789..abcdef123 160000
--- a/dm/src/dmd
+++ b/dm/src/dmd
@@ -1 +1 @@
-Subproject commit 67ca0a14c4d4d3161541eda27a4126f889d53546
+Subproject commit 385312b93239311c038ffd8c221ac62738006382To learn more about git submodule, see this section of the Pro Git book.