profile_clean = icc-profile-clean
endif
+ifeq ($(COMP),clang)
+ comp=clang
+ CXX=clang++
+ profile_prepare = gcc-profile-prepare
+ profile_make = gcc-profile-make
+ profile_use = gcc-profile-use
+ profile_clean = gcc-profile-clean
+endif
+
### 3.2 General compiler settings
CXXFLAGS = -g -Wall -Wcast-qual -fno-exceptions -fno-rtti $(EXTRACXXFLAGS)
CXXFLAGS += -wd383,981,1418,1419,10187,10188,11505,11503 -Wcheck -Wabi -Wdeprecated -strict-ansi
endif
+ifeq ($(comp),clang)
+ CXXFLAGS += -ansi -pedantic -Wno-long-long -Wextra -Wshadow
+endif
+
ifeq ($(os),osx)
CXXFLAGS += -arch $(arch)
endif
CXXFLAGS += -O3
endif
endif
+
+ ifeq ($(comp),clang)
+ CXXFLAGS += -O3
+
+ ifeq ($(os),osx)
+ ifeq ($(arch),i386)
+ CXXFLAGS += -mdynamic-no-pic
+ endif
+ ifeq ($(arch),x86_64)
+ CXXFLAGS += -mdynamic-no-pic
+ endif
+ endif
+ endif
endif
### 3.6. Bits
@echo "gcc > Gnu compiler (default)"
@echo "icc > Intel compiler"
@echo "mingw > Gnu compiler with MinGW under Windows"
+ @echo "clang > LLVM Clang compiler"
@echo ""
@echo "Non-standard targets:"
@echo ""
@test "$(prefetch)" = "yes" || test "$(prefetch)" = "no"
@test "$(bsfq)" = "yes" || test "$(bsfq)" = "no"
@test "$(popcnt)" = "yes" || test "$(popcnt)" = "no"
- @test "$(comp)" = "gcc" || test "$(comp)" = "icc" || test "$(comp)" = "mingw"
+ @test "$(comp)" = "gcc" || test "$(comp)" = "icc" || test "$(comp)" = "mingw" || test "$(comp)" = "clang"
$(EXE): $(OBJS)
$(CXX) -o $@ $(OBJS) $(LDFLAGS)