[ACCEPTED]-Can't assign variable inside recipe-gnu-make
Accepted answer
I found a solution using the eval
function:
$(eval variablename=whatever)
This works :)
(although 3 I may now try to find an easier build system 2 ;))
Thanks everyone for reading and also 1 of course @eriktous for writing!
If you write it like you did, the assignment 7 will be executed as a shell command, which 6 gives the error you got.
I would try organising 5 it something like this:
CXXFLAGS = -I/usr/include/test ifneq ($(argsexec),true) CXXFLAGS += -shared -fPIC DESTDIR = /home/pc endif OBJ = main.o Server.o blabla : $(OBJ) $(CXX) -o blabla $(OBJ) $(CXXFLAGS) ifneq ($(argsexec),true) ./bn.sh endif
This should do what 4 you want, although I'm not quite happy with 3 using the ifneq
construct twice. I'd have to 2 think harder to come up with something that 1 avoids that.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.