A better way to determine if LD is gcc or g++

Instead of using SOURCES, use MIQ_SOURCES to include variants
Instead of using if, use computed value to take dynamic updates
This commit is contained in:
Christophe de Dinechin 2019-03-24 23:08:28 +01:00
parent 5146122af7
commit e5e8eb4866
1 changed files with 3 additions and 5 deletions

View File

@ -39,11 +39,9 @@
CC= $(CROSS_COMPILE:%=%-)gcc
CXX= $(CROSS_COMPILE:%=%-)g++
ifeq ($(filter %.cpp,$(SOURCES)),)
LD= $(CC)
else
LD= $(CXX)
endif
LD= $(LD_$(words $(filter-out 0,$(words $(filter %.cpp,$(MIQ_SOURCES))))))
LD_0= $(CC)
LD_1= $(CXX)
CPP= $(CC) -E
PYTHON= python
AR= $(CROSS_COMPILE:%=%-)ar -rcs