On 1/15/18, Dan Wilcox danomatika@gmail.com wrote:
In thinking again about Pd's build system(s) while working on the Windows build, I think there is a good solution which would allow combining both the Makefiles and autoconf.
As far as I see it, the pros/cons of the various systems we have now are:
- makefiles: easy to understand & fast, less adaptable / configurable
- autotools: easy to use and configurable, harder to understand, lots of
files
I think we definitely want to pros of both: easy to understand, easy to use, configurable.
Since the autotools (autoconf. automake, etc) are built around make already, it's not like these systems are mutually exclusive. The Makefile.am automaker files are used to generate Makefile.in files which are used to generate the Makefiles.
I propose that we transition from using automake directly and write our own Makefile.ins. This way more of the actually logic is shifted to the Makefile.in files themselves while we still get the configuration variables from the configure script. The con for this is we lose a lot of the boilerplate stuff that automaker handles but would gain Makefiles which basically look like Miller's original makefiles.
Additionally, the cross platform stuff like file lists and install rules, etc could be defined in a shared Makefile and we keep the platform specific makefiles. Last, we would be able to handle custom rules & approaches by not having to fight automake for things like generating binaries in the bin folder and making a "sourceful" release build in place with ./configure.
There are a number of projects which use this approach, including Tcl/Tk.
Sounds like a good idea, to consider at least. You've proposed it before, sorry for not responding earlier. What I appreciate most about handwritten makefiles (when compared to full autotools route):
1. control over stdout and stderr text 2. control over targets and rules
Makefile readability is not the main issue in my view. A makefile.am is easier to read and write than a handwritten multiplatform makefile for the same project.
I don't know much about autotools, but I've always thought that you can't define your own (additional) targets in a makefile.am. For troubleshooting during development but also thereafter, I find it indispensable to have targets that print variables, dependencies, intermediate output (preprocessor and assembly) and such. Vanilla's handwritten makefiles don't have such targets but they could easily be added and that would be an asset for everyone trying to help developing and bug fixing. If it is possible to combine the undeniable advantages of configure with handwritten makefile.ins, that could be the best of both worlds.
Katja
Dan Wilcox @danomatika http://twitter.com/danomatika danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/