Hacker News new | ask | show | jobs
by adrian_b 1520 days ago
The makefiles indicated by you are relatively simple makefiles, they do not belong to the class "horrible".

The main problem even with these simpler makefiles is that they are too complicated, because they are written for a single project.

This is something that is difficult to change in the case of most open-source projects, which are intended to be independent from other software projects.

The greatest simplifications in makefiles are done by extracting the common parts of the makefiles from all projects in generic makefiles that should be included in the specific makefiles of each project.

Doing this, it is possible to reduce the effort of writing makefiles for 100 or 1000 software projects to little more than the effort of writing a single makefile.

Besides the reuse of the same make rules, of the same make targets and of many make definitions in all projects, other important simplifications are to never write manually the file dependencies when they can be detected automatically, which is normally true for all compilation tasks, and to never write manually the lists of source files, because they should also be detected automatically.