Pre-requisites

You will need the following tools to build ddmd on Windows:

Build instructions

As of October 3, 2010, the DDMD buildscript has been improved to automate most of the steps and work seamlessly on both Windows and Linux. The old Windows instructions are still provided down below if you wish do build it manually or build old revisions.

To build DDMD:

  • Download and install each of the requisites (DMC is not needed on Linux).
  • Checkout ddmd sources:

# hg clone http://hg.dsource.org/projects/ddmd/

  • If you have GNU wget installed (On Linux, you probably do. On Windows, probably not), then run this from the main DDMD directory (for Linux, use ./build.sh instead of build):

# build --setup --download

# build --setup

Next time you want to build DDMD, just run: build

For a list of options supported by the buildscript: build --help

Manual build instructions

  • Download and install each of the requisites.
  • Checkout ddmd sources:

# hg clone http://hg.dsource.org/projects/ddmd/

  • Copy dmdpatch.patch from the main ddmd directory to the main dmd 2.040 directory.
  • Patch dmd 2.040's sources by running the following command from the main dmd 2.040 directory:

# patch -p1 --binary < dmdpatch.patch

  • Go to dmd 2.040's 'src\dmd' directory.
  • Make a copy of mars.c named mars2.c
  • Open mars2.c and rename the main function at line 261 to something other than main, e.g., "mars" or "HIDE_main"
  • Open win32.mak and append the line D= with whatever directory contains your main dmc folder. Do NOT use a trailing slash. Ex, if dmc.exe is in C:\dm\bin, then change D= to D=C:
  • If dmc isn't already in the PATH environment variable, put it there:

# set path=c:\dm\bin;%PATH%

  • Build dmd.lib by running:

# make deblib -fwin32.mak

  • Copy the resulting dmd.lib to the main ddmd directory.
  • If a current dmd (such as 2.050) isn't already in the PATH environment variable, put it there. Ex, if dmd.exe is in c:\dmd2.050\windows\bin then do:

# set path=c:\dmd2.050\windows\bin;%PATH%

  • From the main ddmd directory, build ddmd:

# build

  • It will build the debug version, and then attempt to build the release version. The release version may fail to build and is not yet supported, but the debug version will run fine.

Good luck and let us know if you have any trouble compiling or running ddmd!