WildCAD - a simple 2D drawing application

Adam D Ruppe destructionator at gmail.com
Sun Jan 29 23:45:42 UTC 2023


On Sunday, 29 January 2023 at 17:14:40 UTC, Johann Lermer wrote:
> right - but isn't one of make's features, that it compiles code 
> only when the source changes? When you just compile the whole 
> thing at once, I would expect that you get longer times than 
> when you change just one source file and compile just that.

When your whole rebuild is fast enough, it doesn't really matter 
anymore.

> Well, that's the theory. It seems, that in the meantime 
> everything depends on everything and so even small changes in 
> the code lead to a recompiling of quite a few files and now 
> every time even a small change takes even longer to recompile 
> than your approach.

Yeah, for an incremental rebuild to work well, you need to have 
pretty strict dependency discipline so chances actually can be 
isolated, and in D as well, you need to make sure your modules 
don't do much work just by being imported (just being referenced 
can trigger some compile time functions, for example, and if you 
compile things separately that depend on this, it gets done 
multiple times instead of just once like in the all-at-once 
build). This can be done, but it takes attention and often just 
isn't worth the hassle compared to the simple build, especially 
when the simple build does a decent job out of the box.

> Maybe it's just better to remove the whole make stuff - but it 
> seemed to be a good idea at the time...

I often make makefiles just cuz im used to typing `make`... but 
the contents are often:

all:
    dmd -i main.d

and i let the compiler do its thing.


More information about the Digitalmars-d-announce mailing list