Use this forum to ask for help, submit a bug report or make a suggestion.
Joined: 13 Aug 2004
|Posted: Thu Jul 02, 2009 12:51 pm Post subject: D Language Tutorial - Getting D to Work with Zeus
|Install the D Compiler
Before attempting to use these D language build tools make sure the D compiler has been installed correctly.
Using a Build Tool to Manage the Project Build
As the D project grows in complexity, the management of the build will be made easier if a build tool is used.
Zeus really does not care which build tool is used and when it comes to D it turns out there are several options
Using Bud to Manage the Project Build
The first option would be manage the build using the Bud build tool.
To manage the project using Bud change the Workspace Options to use the following command lines:
NOTE: Bud expects the top most file of the application's hierarchy to be passed in via the command line, so for this example that file is main. If your project uses a different top file then just change the name to suit.
- Make Command Line: bud main
- Clean Command Line: bud -clean main
- Make Command Line: bud -full main
IMPORTANT: For this to work make sure the Bud executable is in the system PATH.
Using DSSS to Manage the Project Build
Another option would be to use DSSS to manage the build.
To use DSSS requires the creation of a dsss.conf for each of the two projects in the workspace. Here is a DSSS tutorial on how to create these conf files.
With the dsss.conf files created in the correct folder location, just change the Zeus workspace Make Command Line: to be: dsss build
Using a Make File to Manage the Project Build
It is also possible to manage the build using a simple make file.
Because the main.d references some functions in the mathLIB module, a compile and link process will be needed to create the executable.
The command line in the D Document type could be adjusted to include the missing files, but a better alternative is to create a make file to handle the process of building the project.
1: Create the main.mak file in this folder location:
The main.mak file should look like this:
|# Simple Makefile to Create my main.exe
# Make sure the mathLib location is in the include path
DFLAGS=-O -release -nofloat -w -Ic:\d
$(DMD) -c $(DFLAGS) $*
main : main.exe
# ink the exectutable with the mathLIB.lib file
main.exe : main.obj
dmd -ofmain.exe main.obj ..\mathLIB\mathLIB.lib
del main.exe math.obj
2: Create the mathLIB.mak file in this folder location:
The mathLIB.mak file should look like this:
|# Simple Makefile to Create my mathLIB
DFLAGS=-O -release -nofloat -w
$(DMD) -c $(DFLAGS) $*
mathLIB : mathLIB.lib
mathLIB.lib : math1.obj math2.obj
dmd -ofmathLIB.lib -lib math1.obj math2.obj
del math1.obj math2.obj mathLIB.lib
3: Use the Zeus Workspace, Options menu and in the General section for the main project add the following command lines:
4: Use the Zeus Workspace, Options menu and in the General section for the mathLIB project
- Make Command Line: make -f main.mak
- Clean Command Line: make -f main.mak clean
5: Now the build and clean operations can be run from withing Zeus using the Workspace, Build menu or by right clicking on the project in the Workspace navigator and selecting make or clean options.
- Make Command Line: make -f mathLIB.mak
- Clean Command Line: make -f mathLIB.mak clean
Now when these make menus are run on the mathLIB and main projects a mathLIB.lib and main.exe files are produced:
Directory of C:\d\main
09/03/2009 11:39 133,660 main.exe
1 File(s) 133,660 bytes
0 Dir(s) 789,381,120 bytes free
Using the D Programming Language with Zeus.
Getting the D language debugger to work with Zeus.
Intergrating the D programming language help file.
Intergrating the D programming language Tango help file.
Writing Zeus macros using D scripting module.
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Powered by phpBB © 2001, 2005 phpBB Group