exe file size

TomD t_demmer at nospam.web.de
Sun Nov 16 01:01:09 PST 2008


John Reimer Wrote:
[...]
> Thanks for the example.  I've avoided makefiles in the past because, despite 
> their power and flexibility, they are too complicated for what amounts to 
> a fairly simple task in most cases.  Granted, once they are created for a 
> project, there shouldn't be much need to fiddle with them more.
> 
> Anyway, I'll keep your sample above in mind if I go this route.  Thanks. :)
> 
> -JJR
What I have learned this weekend is "don't try to be smart when brute force
is just enough".
The following script is the fastest way to rebuild dwt on linux:
-----
#!/bin/bash
DMD=/opt/dmd/bin/dmd
DMDFLAGS="-debuglib=tango-base-dmd -defaultlib=tango-base-dmd"
DMDFLAGS=$DMDFLAGS" -I/opt/dmd/import"
DMDFLAGS=$DMDFLAGS" -version=Tango -version=Posix -L-tango-user-dmd"
DMDFLAGS=$DMDFLAGS" -O -release"

WBD=`pwd`
DMDFLAGS="-I$WBD $DMDFLAGS"

echo "Compile command:"
echo $DMD $DMDFLAGS -c -op
find dwt -iname \*.d | xargs $DMD $DMDFLAGS -c -op
echo "done compiling, build libdwt.a"
find dwt -name \*.o | xargs ar -svr libdwt.a
----
That takes 27s on my Laptop. I used to do the same directorywise,
that takes about 1m15s. Looks like the best strategy for a build
tool is to first grab the names of the files to recompile and then
give it to one instance of dmd to compile all of them at once. Unfortunately,
the -v switch  does not help when invoking dmd like this.

Ciao
Tom



More information about the Digitalmars-d mailing list