←back to thread

Be Aware of the Makefile Effect

(blog.yossarian.net)
431 points thunderbong | 3 comments | | HN request time: 0.565s | source
Show context
jcarrano ◴[] No.42665720[source]
I wouldn't say this is necessarily a bad thing. I wrote my first version of a Makefile with automatic dependencies and out-of-tree builds 10+ years ago and I have been copying and improving it since. I do try to remove unneeded stuff when possible.

The advantage is that one can go in and modify any aspect of build process easily, provided one takes care to remove cruft so that the Makefile does not become huge. This is very important for embedded projects. For me, the advantages have surpassed the drawbacks (which I admit are quite a few).

You could, in theory, abstract much of this common functionality away in a library (whether for Make or any other software), however properly encapsulating the functionality is additional work, and Make does not have great built-in support for modularization.

In this sense I would not say Make is overly complex but rather the opposite, too simple. Imagine how it would be if in C global variables were visible across translation units. So, in a way, the "Makefile effect" is in part due to the nature of the problem being solved and part due to limitations in Make.

replies(1): >>42667406 #
1. rini17 ◴[] No.42667406[source]
Can you imagine the makefile was made by someone else and you are now suddenly confronted with the result of 10 years of tuning.
replies(2): >>42668050 #>>42672112 #
2. jcarrano ◴[] No.42668050[source]
I am that someone else because I seldom edit the makefiles and I forget things. That's why I try to trim unused targets and recipes and I try to keep it documented.

In the end it is no different from any code that's suffered from 10 years of tuning and it can get ugly. Maybe Make is even somewhat worse in this respect, but then again it does not need to be changed often.

3. imtringued ◴[] No.42672112[source]
I would let the expert do his job and I do mine.