I have the following line in the Makefile of a software I'm working with:
VERSION = $(subst $(space),.,$(wordlist 1,2,$(subst ., ,$(patsubst v%,%,$(shell cat VERSION)))))
Where VERSION
is a file containing the exact version of the software (f.e 3.12.3
)
I'm not such an expert in Makefiles but this line should return the major version (without the v
indicating TAG), in this case, 3.12. And it does, or, at least, it does it when you run it with GNU make <= 4.2
I've recently updated to make 4.3 (because I use a rolling release, Arch Linux) and then executing the same line in my makefile, I got 3 12.
instead of 3.12
I've been reading Make changelog in order to check if there is any change in something related to the line in charge of retrieving the major version but I can't find where the problem is.
I've confirmed that the problem appears only with GNU make 4.3 (it works with make 4.2) and I'm wondering if there is a bug or I am missing something.
Maybe someone could help me.
Best regards