2 ms·
> arithmetic in make Well that’s horrifying. What is the use case? Or is it just hackers gonna hack?
by 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)