4 ms·
> rather than improving the core language and tool GNU Make has been steadily gaining new functions though. I've been reading the manual again recently and the
by matheusmoreira 3y ago
> rather than improving the core language and tool
GNU Make has been steadily gaining new functions though. I've been reading the manual again recently and there were a few functions I did not recognize: let and intcmp. The new integer comparison function is particularly notable since people have gone to some rather incredible lengths to implement arithmetic in make:
https://gmsl.jgc.org https://gmsl.jgc.org
It's also possible to write native plugins for GNU Make to load at runtime. New functions can be implemented this way. It works just like C extensions for other scripting languages. There's also Guile extension support but unfortunately it doesn't seem to allow new function definitions.
- dmd 3y ago> arithmetic in make Well that’s horrifying. What is the use case? Or is it just hackers gonna hack?
- nrclark 3y agoIncrementing a counter would be one example. Like maybe you want to produce file-00.txt through file-99.txt.
- Brian_K_White 3y agoidk about anyone else but I have auto incrementing build numbers in several makefiles That would seem to be the most obvious and trivial example and I just assume that there must be countless others without having to actually see them and agree that they are valid. Wait, how could I forget the other most obvious example, comparing version numbers of requirements/dependencies? The Vala preprocessor can't compare numbers and so I have to implement "if libfoo < x then add -D OLDFOO" outside in the makefile and can only have boolean #if OLDFOO in the code. (libs don't always provide good enough equivalents, maybe only provides a numerical value that you are assumed to be able to compare, or maybe provides nothing at all, or does provide a set of booleans intended to be used for this but they aren't granular enough, etc)