Improved flow of setting variables in makefile
parent
b3924a7b86
commit
cd33142f6c
14
GNUmakefile
14
GNUmakefile
|
|
@ -20,6 +20,12 @@ CLANG_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "clang")
|
||||||
INTEL_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "\(ICC\)")
|
INTEL_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "\(ICC\)")
|
||||||
SUN_COMPILER = $(shell $(CXX) -V 2>&1 | $(EGREP) -i -c "CC: Sun")
|
SUN_COMPILER = $(shell $(CXX) -V 2>&1 | $(EGREP) -i -c "CC: Sun")
|
||||||
|
|
||||||
|
# Also see LLVM Bug 24200 (https://llvm.org/bugs/show_bug.cgi?id=24200)
|
||||||
|
# CLANG_ASSEMBLER ?= $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -i -c "^clang")
|
||||||
|
# TODO: Uncomment the line above when Clang's integrated assembler can parse inline assembly
|
||||||
|
CLANG_ASSEMBLER ?= 0
|
||||||
|
GNU_ASSEMBLER ?= $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -i -c "^GNU assembler")
|
||||||
|
|
||||||
# Default prefix for make install
|
# Default prefix for make install
|
||||||
ifeq ($(PREFIX),)
|
ifeq ($(PREFIX),)
|
||||||
PREFIX = /usr
|
PREFIX = /usr
|
||||||
|
|
@ -32,22 +38,16 @@ ifneq ($(CLANG_COMPILER),0)
|
||||||
CXXFLAGS += -Wall
|
CXXFLAGS += -Wall
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Also see LLVM Bug 24200 (https://llvm.org/bugs/show_bug.cgi?id=24200)
|
|
||||||
# CLANG_ASSEMBLER ?= $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -i -c "^clang")
|
|
||||||
# TODO: Uncomment the line above when Clang's integrated assembler can parse inline assembly
|
|
||||||
CLANG_ASSEMBLER ?= 0
|
|
||||||
|
|
||||||
ifeq ($(IS_X86),1)
|
ifeq ($(IS_X86),1)
|
||||||
|
|
||||||
GCC42_OR_LATER = $(shell $(CXX) -v 2>&1 | $(EGREP) -i -c "^gcc version (4.[2-9]|[5-9])")
|
GCC42_OR_LATER = $(shell $(CXX) -v 2>&1 | $(EGREP) -i -c "^gcc version (4.[2-9]|[5-9])")
|
||||||
ICC111_OR_LATER = $(shell $(CXX) --version 2>&1 | $(EGREP) -c "\(ICC\) ([2-9][0-9]|1[2-9]|11\.[1-9])")
|
ICC111_OR_LATER = $(shell $(CXX) --version 2>&1 | $(EGREP) -c "\(ICC\) ([2-9][0-9]|1[2-9]|11\.[1-9])")
|
||||||
|
|
||||||
ifeq ($(CLANG_ASSEMBLER),0)
|
ifneq ($(GNU_ASSEMBLER),0)
|
||||||
# Using system provided assembler. It may be GNU AS (GAS).
|
# Using system provided assembler. It may be GNU AS (GAS).
|
||||||
GAS210_OR_LATER ?= $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.[1-9][0-9]|[3-9])")
|
GAS210_OR_LATER ?= $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.[1-9][0-9]|[3-9])")
|
||||||
GAS217_OR_LATER ?= $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.1[7-9]|2\.[2-9]|[3-9])")
|
GAS217_OR_LATER ?= $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.1[7-9]|2\.[2-9]|[3-9])")
|
||||||
GAS219_OR_LATER ?= $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.19|2\.[2-9]|[3-9])")
|
GAS219_OR_LATER ?= $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.19|2\.[2-9]|[3-9])")
|
||||||
else
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Enable PIC for x86_64 targets
|
# Enable PIC for x86_64 targets
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue