←back to thread

Be Aware of the Makefile Effect

(blog.yossarian.net)
431 points thunderbong | 1 comments | | HN request time: 0.47s | source
Show context
earnestinger ◴[] No.42665642[source]
> However, the occurrence of the Makefile effect in a simple application suggests that the tool is too complicated for that application.

I interpret it in a bit of different way.

Makefile is relatively simple and unopinionated like a brick. Also makefile defines/reflects project’s structure.

From simple blocks one can build any shape one want. Total freedom.

Problem is, make doesn’t impose best practice and doesn’t steer you clear of common pitfalls of project structuring and building and publishing.

One example for illustration: Out of source builds is rather good idea, but not imposed by make.

So makefile is not enough, one needs all the life-lessons of using make, so inherited makefiles are better than written from scratch.

replies(1): >>42667017 #
o11c ◴[] No.42667017[source]
To expand the illustration:

* using out-of-source builds is a good idea

* using fully automatic dependencies is a good idea

* never committing generated files is a good idea (avoid hysteresis)

It is fundamentally very difficult to get all three of these at once; automatic dependencies often require generating files ahead of time, but generating files often involves needing to know the dependencies or at least their paths ahead of time.

These days the trend seems to be to commit "generated-in-place" files, which avoids some of the historical problems with the last (at the cost of introducing others). I don't claim this is optimal.

replies(1): >>42668450 #
1. earnestinger ◴[] No.42668450[source]
One more shower thought. Those inherited makefiles are a solution in a search for a standard.