I know you can use if statements like the following in makefiles:
foo: $(objects)
ifeq ($(CC),gcc)
$(CC) -o foo $(objects) $(libs_for_gcc)
else
$(CC) -o foo $(objects) $(normal_libs)
endif
Is there a way to do a conditional replacement like possibly a ternary type operator.
(condition?$(CC):$(CC2)) -o foo $(objects) $(libs_for_gcc)
And if there isn't what would be the most idiomatic way to achieve the example
I added the c++ tag because the question had only 7 views and I figured someone who used c++ might be likely to know the answer,I know this isn't strictly a c++ question(though I am planning to compile c++ with it)
EDIT: looks like there is an if function using this syntax
$(if condition,then-part[,else-part])
I'm still a little confused on how it works though