# -*- mode: makefile -*- # # Makefile of ROOT for MacOS X, using Intel icc >= 9.1 compiler PLATFORM = macosx DEBUGFLAGS = -g OPTFLAGS = -O ifeq (debug,$(findstring debug,$(ROOTBUILD))) OPT = $(DEBUGFLAGS) NOOPT = -O0 else OPT = $(OPTFLAGS) NOOPT = -O0 endif # OS version MACOSX_MINOR := $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2) MACOSX_CPU := $(shell uname -p) FINK_DIR := $(shell which fink 2>&1 | sed -ne "s/\/bin\/fink//p") # Compiler: CXX = icc CC = icc CXXFLAGS = -fPIC -wd1476 $(EXTRA_CXXFLAGS) $(USERCONF_CXXFLAGS) CFLAGS = -fPIC $(EXTRA_CFLAGS) -restrict $(USERCONF_CFLAGS) CINTCXXFLAGS = -fPIC $(EXTRA_CXXFLAGS) \ -DG__REGEXP -DG__UNIX -DG__SHAREDLIB \ -DG__ROOT -DG__REDIRECTIO -DG__OSFDLL \ -DG__STD_EXCEPTION $(USERCONF_CXXFLAGS) CINTCFLAGS = -fPIC $(EXTRA_CFLAGS) \ -DG__REGEXP -DG__UNIX -DG__SHAREDLIB \ -DG__ROOT -DG__REDIRECTIO -DG__OSFDLL \ -DG__STD_EXCEPTION $(USERCONF_CFLAGS) # Compiler version: ICC_MAJOR := $(shell $(CXX) -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \ cut -d'.' -f1) ICC_MINOR := $(shell $(CXX) -v 2>&1 | awk '{ if (NR==1) print $$2 }' | \ cut -d'.' -f2) ifeq ($(ICC_MAJOR),version) ICC_MAJOR := $(shell $(CXX) -v 2>&1 | awk '{ if (NR==1) print $$3 }' | \ cut -d'.' -f1) ICC_MINOR := $(shell $(CXX) -v 2>&1 | awk '{ if (NR==1) print $$3 }' | \ cut -d'.' -f2) endif ifeq ($(ICC_MAJOR),9) CXXFLAGS += -wd1572 -wd873 -wd672 CFLAGS += -wd1572 CINTCXXFLAGS += -wd1572 -wd873 CINTCFLAGS += -wd1572 ICC_GE_9 = $(ICC_MAJOR) endif ifeq ($(ICC_MAJOR),10) CXXFLAGS += -wd1572 -wd873 -wd672 CFLAGS += -wd1572 CINTCXXFLAGS += -wd1572 -wd873 CINTCFLAGS += -wd1572 ICC_GE_9 = $(ICC_MAJOR) ifneq ($(ICC_MINOR),0) ICC_GE_101 = $(ICC_MAJOR)$(ICC_MINOR) endif endif ifeq ($(findstring $(ICC_MAJOR),10 9),) CXXFLAGS += -wd1572 -wd873 -wd672 -wd279 CFLAGS += -wd1572 -wd279 CINTCXXFLAGS += -wd1572 -wd873 -wd279 CINTCFLAGS += -wd1572 -wd279 ICC_GE_9 = $(ICC_MAJOR) ICC_GE_101 = $(ICC_MAJOR)$(ICC_MINOR) endif # Linker: LD = icpc LDFLAGS = $(OPT) -mmacosx-version-min=$(MACOSXVERS) LDFLAGS += $(EXTRA_LDFLAGS) FORCELINK = no ifeq ($(subst $(MACOSX_MINOR),,1234),1234) ifeq ($(USECONFIG),FALSE) SOFLAGS = -dynamiclib -single_module -Wl,-dead_strip_dylibs \ -install_name @rpath/ else SOFLAGS = -dynamiclib -single_module -Wl,-dead_strip_dylibs \ -install_name $(LIBDIR)/ endif else ifeq ($(subst $(MACOSX_MINOR),,123),123) SOFLAGS = -dynamiclib -single_module \ -undefined dynamic_lookup -install_name $(LIBDIR)/ endif endif ifeq ($(subst $(MACOSX_MINOR),,1234),1234) SOEXT = so else SOEXT = dylib endif # System libraries: SYSLIBS = -lm $(OSTHREADLIBDIR) \ $(OSTHREADLIB) -ldl $(ALLOCLIBDIR) $(ALLOCLIB) XLIBS = $(XPMLIBDIR) $(XPMLIB) $(X11LIBDIR) -lXext -lX11 CILIBS = -lm -ldl # Fortran: F77ORG = ifort F77FLAGS = -fPIC ifneq ($(F77),) ifeq ($(findstring $(ICC_MAJOR),11 10 9),) ifneq ($(subst ia32,,$(shell which ifort)),$(shell which ifort)) F77LIBS := -L$(shell which ifort | sed -e 's|bin/ia32/ifort|compiler/lib|') \ -lifcore else F77LIBS := -L$(shell which ifort | sed -e 's|bin/intel64/ifort|compiler/lib|') \ -lifcore endif else ifeq ($(ICC_MAJOR),11) ifneq ($(subst ia32,,$(shell which ifort)),$(shell which ifort)) F77LIBS := -L$(shell which ifort | sed -e 's|bin/ia32/ifort|lib/ia32|') \ -lifcore else F77LIBS := -L$(shell which ifort | sed -e 's|bin/intel64/ifort|lib/intel64|') \ -lifcore endif else F77LIBS := -L$(shell which ifort | sed -e 's|bin/ifort|lib|') \ -lifcore endif endif endif # Override default in Makefile.config INSTALL := /bin/cp -pPR INSTALLDATA := /bin/cp -pPR # Extras ifeq ($(MACOSX_MINOR),7) MACOSX_SSL_DEPRECATED = yes endif ifeq ($(MACOSX_MINOR),8) MACOSX_SSL_DEPRECATED = yes MACOSX_ODBC_DEPRECATED = yes endif ifeq ($(MACOSX_MINOR),9) MACOSX_SSL_DEPRECATED = yes MACOSX_ODBC_DEPRECATED = yes MACOSX_GLU_DEPRECATED = yes MACOSX_KRB5_DEPRECATED = yes MACOSX_TMPNAM_DEPRECATED = yes endif ifeq ($(MACOSX_MINOR),10) MACOSX_SSL_DEPRECATED = yes MACOSX_ODBC_DEPRECATED = yes MACOSX_GLU_DEPRECATED = yes MACOSX_KRB5_DEPRECATED = yes MACOSX_TMPNAM_DEPRECATED = yes MACOSX_LDAP_DEPRECATED = yes endif ifeq ($(CONFIGURE),yes) showcxx: @echo "$(CXX)" showcc: @echo "$(CC)" showld: @echo "$(LD)" showf77: @echo "$(F77ORG)" endif