Reputation: 383
How can a c-file use variables from a c-file?
makefile:
VARIABLE=$(shell grep textfile.txt | -c 66)
c-file pseudo code:
VARIABLE2 = VARIABLE;
Upvotes: 0
Views: 654
Reputation: 753465
Usually by creating a macro passed to the C compiler, perhaps using some variation on the theme of:
CFLAGS += -DVARIABLE2="${VARIABLE}"
You have to worry about whether there are quotes etc in the value of the Make variable (I'm not familiar with the -c
command shown in VARIABLE=$(shell grep textfile.txt | -c 66)
).
Upvotes: 1