[mekefile] define const

whired123

Member
Joined
Nov 15, 2021
Messages
82
Reaction score
5
Credits
613
Can you do it?
Code:
$ cat makefile
const ABC = 123

$ make
makefile:1: *** missing separator.  Stop.
It seems not to me ...
 


Code:
const ABC = 123

all:
    echo $(ABC)

Every command has to have a [tab] before it. Not spaces. It is a requirement.

You need to read this.
 
Code:
$ cat -T makefile
const ABC = 123

all:
^Iecho $(ABC)



$ make
makefile:1: *** missing separator.  Stop.
 
AFAIK, there is no "const" keyword in the Makefile syntax for GNU make. That's almost certainly where you're going wrong.
 
So the makefile constants do not exist?
No, not unless it's something that has been recently added to GNU make.
I'm still using Debian 11 (oldstable) so I might be a bit behind the times. But AFAIK there has never been a const keyword in the Makefile syntax.
 
Top