On 4/11/15 12:25 AM, Vladimir Panteleev wrote:
On Friday, 10 April 2015 at 23:04:44 UTC, Andrei Alexandrescu wrote:
Martin Nowak added recently a nice feature to the Phobos makefile: by
specifying e.g.

make std/stdio.test

only the unittests for std/stdio.d would build and run. This greatly
improves development turnaround for Phobos.

FWIW, in most cases you can also do this simply by running:

dmd -unittest -main -run stdio.d

It won't work if other modules have changed (compared to the dmd in your
PATH).

The actual command line generated by is:

../dmd/src/dmd -conf= -I../druntime/import -w -dip25 -m64 -g -debug -main -unittest generated/osx/debug/64/libphobos2.a -defaultlib= -debuglib= -L-lcurl -run std/stdio.d

So having this in the makefile:

* makes sure the library is built automatically

* links the right external libs

* makes sure command line options such as -dip25 are not omitted

* makes sure there's no interference from dmd.conf files

* links the correct library

* ...

So if your point was it can be done just worse, sure.


Andrei

Reply via email to