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 CC= $(CROSS_COMPILE:%=%-)gcc
CXX= $(CROSS_COMPILE:%=%-)g++ CXX= $(CROSS_COMPILE:%=%-)g++
ifeq ($(filter %.cpp,$(SOURCES)),) LD= $(LD_$(words $(filter-out 0,$(words $(filter %.cpp,$(MIQ_SOURCES))))))
LD= $(CC) LD_0= $(CC)
else LD_1= $(CXX)
LD= $(CXX)
endif
CPP= $(CC) -E CPP= $(CC) -E
PYTHON= python PYTHON= python
AR= $(CROSS_COMPILE:%=%-)ar -rcs AR= $(CROSS_COMPILE:%=%-)ar -rcs