Last update March 28, 2007

Compile



Difference (last change) (no other diffs, normal page display)

Changed: 1c1,25
Describe the new page here.
[[table][formatseparator=@][separator=^]
ToDo:@#green^ Update source code for DMD 1.0.
]

A D utility and examples project by CarlosSantander.

Basically, I don't want to compile every single .d file on a project just because I modified one of them. And I didn't want to create a makefile, or a .sh file, worse yet type a very long line every time I want to compile them.

So I said: "what if DMD knew wether (sp?) a .d file needs to be compiled or not?". So I did it. This file (that I've called "compile" since I couldn't think of anything better) receives a number of arguments (files or flags) and checks if the .d file is older or not than the .obj file (if exists).

Warning: it doesn't handle .lib files.

So you can do: "compile -O -release file1 file2 file3". And it will call dmd with the respective flags to compile every file. Then you can change file1 and type the exact same line, and it won't compile file2 nor file3, and still link them.

Link to download compile:

* http://www.prowiki.org/upload/duser/compile.zip


::That source does not work anymore for the current compiler version - the C style casts are no more accepted (easy fix), and something is wrong with the (xxx).windows(.xxx?) import, e.g. <n>GetFileTime?</n> is unknown. The program will work (I think) if GetFileTime? is declared as extern(Windows) function (the error message will tell you how it must be defined (args, return value)), but it is somehow sad that code gets so easily broken (e.g. none of the [Games] seems to compile at present).

:::Since D 1.0 hasn't been released yet, the language can still change. And the changes that Walter has made are big improvements (for example, DMD 0.163 was a huge improvement upon DMD 0.162 with the new importing functionality). Yes, the compiler changes can and does break code, but they are usually easy fixes (especially for someone who has been following the announcements newsgroup). As D 1.0 aproaches, eventually there will be a feature freeze and code won't break so easily. -- JustinCalvarese



FolderProjects FolderExamples

ToDo:Update source code for DMD 1.0.

A D utility and examples project by CarlosSantander.

Basically, I don't want to compile every single .d file on a project just because I modified one of them. And I didn't want to create a makefile, or a .sh file, worse yet type a very long line every time I want to compile them.

So I said: "what if DMD knew wether (sp?) a .d file needs to be compiled or not?". So I did it. This file (that I've called "compile" since I couldn't think of anything better) receives a number of arguments (files or flags) and checks if the .d file is older or not than the .obj file (if exists).

Warning: it doesn't handle .lib files.

So you can do: "compile -O -release file1 file2 file3". And it will call dmd with the respective flags to compile every file. Then you can change file1 and type the exact same line, and it won't compile file2 nor file3, and still link them.

Link to download compile:

That source does not work anymore for the current compiler version - the C style casts are no more accepted (easy fix), and something is wrong with the (xxx).windows(.xxx?) import, e.g. GetFileTime is unknown. The program will work (I think) if GetFileTime? is declared as extern(Windows) function (the error message will tell you how it must be defined (args, return value)), but it is somehow sad that code gets so easily broken (e.g. none of the [Games] seems to compile at present).

Since D 1.0 hasn't been released yet, the language can still change. And the changes that Walter has made are big improvements (for example, DMD 0.163 was a huge improvement upon DMD 0.162 with the new importing functionality). Yes, the compiler changes can and does break code, but they are usually easy fixes (especially for someone who has been following the announcements newsgroup). As D 1.0 aproaches, eventually there will be a feature freeze and code won't break so easily. -- JustinCalvarese


FolderProjects FolderExamples
FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: March 28, 2007 15:53 (diff))