¿Cómo puedo hacer esto? Él los errores hacia fuera con "make: somevariable: command not found"No se puede asignar la variable dentro de la receta
sometarget:
somevariable = somevalue
ejemplo completo:
CXXFLAGS = -I/usr/include/test -shared -fPIC
OBJ = main.o Server.o
blabla : $(OBJ)
ifeq ($(argsexec),true)
# Creates an executable
CXXFLAGS = -I/usr/include/test
$(CXX) -o blabla $(OBJ) $(CXXFLAGS)
else
# Creates a library
DESTDIR = /home/pc
$(CXX) -o blabla $(OBJ) $(CXXFLAGS)
./bn.sh
endif
¿Has encontrado una solución mejor? –
Vea también http://stackoverflow.com/questions/1909188/define-make-variable-at-rule-execution-time – Alexey
Pritesh: Ahora uso el sistema de construcción tup para todos mis proyectos c/C++. http://gittup.org/tup/ – Blub