# etc/Makeconf.  Generated from Makeconf.in by configure. -*- Makefile -*-
#
# ${R_HOME}/etc/Makeconf
#
# R was configured using the following call
# (not including env. vars and site configuration)
# configure  '--disable-java' '--disable-openmp' '--enable-BLAS-shlib' '--enable-R-shlib' '--with-tcl-config=/usr/local/lib/tcl/tcl8.5/tclConfig.sh' '--with-tk-config=/usr/local/lib/tcl/tk8.5/tkConfig.sh' '--prefix=/usr/local' '--sysconfdir=/etc' '--mandir=/usr/local/man' '--infodir=/usr/local/info' '--localstatedir=/var' '--disable-silent-rules' '--disable-gtk-doc' 'MAKE=gmake' 'LIBnn=lib' 'YACC=yacc' 'CC=cc' 'CFLAGS=-O2 -pipe' 'LDFLAGS=-L/usr/local/lib -Wl,-R/usr/local/lib/R/lib' 'CPPFLAGS=-I/usr/local/include' 'FC=gfortran' 'CXX=c++' 'CXXFLAGS=-O2 -pipe'

## This fails if it contains spaces, or if it is quoted
include $(R_SHARE_DIR)/make/vars.mk

AR = ar
BLAS_LIBS = -L"$(R_HOME)/lib$(R_ARCH)" -lRblas

## C compilers
CC = cc -std=gnu23
CFLAGS = -O2 -pipe $(LTO)
CC17 = cc -std=gnu17
C17FLAGS = -O2 -pipe $(LTO)
CC23 = cc -std=gnu23
C23FLAGS = -O2 -pipe $(LTO)
CC90 = cc -std=gnu90
C90FLAGS = -O2 -pipe $(LTO)
CC99 = cc -std=gnu99
C99FLAGS = -O2 -pipe $(LTO)
CPICFLAGS = -fPIC
CPPFLAGS = -I/usr/local/include
C_VISIBILITY = -fvisibility=hidden

## C++ compilers
CXX = c++ -std=gnu++17
CXXFLAGS = -O2 -pipe $(LTO)
CXXPICFLAGS = -fPIC
CXX11 = c++
CXX11FLAGS = -O2 -pipe $(LTO)
CXX11PICFLAGS = -fPIC
CXX11STD = -std=gnu++11
CXX14 = c++
CXX14FLAGS = -O2 -pipe $(LTO)
CXX14PICFLAGS = -fPIC
CXX14STD = -std=gnu++14
CXX17 = c++
CXX17FLAGS = -O2 -pipe $(LTO)
CXX17PICFLAGS = -fPIC
CXX17STD = -std=gnu++17
CXX20 = c++
CXX20FLAGS = -O2 -pipe $(LTO)
CXX20PICFLAGS = -fPIC
CXX20STD = -std=gnu++20
CXX23 = c++
CXX23FLAGS = -O2 -pipe $(LTO)
CXX23PICFLAGS = -fPIC
CXX23STD = -std=gnu++23
CXX26 = c++
CXX26FLAGS = -O2 -pipe $(LTO)
CXX26PICFLAGS = -fPIC
CXX26STD = -std=gnu++26
CXX_VISIBILITY = -fvisibility=hidden

DYLIB_EXT = .so
DYLIB_LD = $(CC)
DYLIB_LDFLAGS = -shared -fPIC  -pthread# $(CFLAGS) $(CPICFLAGS) 
## should be used by packages for dylibs, but at the time of writing was not
DYLIB_LINK = $(DYLIB_LD) $(DYLIB_LDFLAGS) $(LDFLAGS)
ECHO = echo
ECHO_C = 
ECHO_N = -n
ECHO_T = 

## Fortran
FC = gfortran
FCFLAGS = -O2 $(LTO_FC)
## additional libs needed when linking with $(FC), e.g. on some Oracle compilers
FCLIBS_XTRA = 
FFLAGS = -O2 $(LTO_FC)
FLIBS =  -R/usr/local/lib/R/lib -lgfortran -lm
FPICFLAGS = -fPIC
FPIEFLAGS = -fPIE
F_VISIBILITY = -fvisibility=hidden

FOUNDATION_CPPFLAGS = 
FOUNDATION_LIBS = 
JAR = 
JAVA = 
JAVAC = 
JAVAH = 
## JAVA_HOME might be used in the next three.  
## They are for packages 'JavaGD' and 'rJava'
JAVA_HOME = 
JAVA_CPPFLAGS = 
JAVA_LIBS = 
JAVA_LD_LIBRARY_PATH = 
LAPACK_LIBS = -L"$(R_HOME)/lib$(R_ARCH)" -lRlapack
LDFLAGS = -L/usr/local/lib -Wl,-R/usr/local/lib/R/lib
## We only need this is if it is external and not libc, as otherwise link to R
## Oo macOS, where libintl is static and so compiled in, can still link to R
LIBINTL = /usr/local/lib/libintl.so.8.2 /usr/local/lib/libiconv.so.7.2 -Wl,-rpath,/usr/local/lib
LIBM = -lm
LIBR0 = -L"$(R_HOME)/lib$(R_ARCH)"
LIBR1 = -lR
LIBR = -L"$(R_HOME)/lib$(R_ARCH)" -lR
LIBS = -L/usr/local/lib -lpcre2-8 -ldeflate -lzstd -llzma -lbz2 -lz -R/usr/local/lib/R/lib -lgfortran -lm -lm -liconv -licuuc -licui18n
## needed by R CMD config
LIBnn = lib
LIBTOOL = $(SHELL) "$(R_HOME)/bin/libtool"
## set for --enable-lto, --enable-lto=check
LTO = 
LTO_FC = 
LTO_LD = 
## set for --enable-lto=R, used in INSTALL
LTO_OPT = 
LTO_FC_OPT = 
## needed to build applications linking to static libR
MAIN_LD = $(CC)
MAIN_LDFLAGS = -Wl,-export-dynamic  -pthread
MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LDFLAGS)
MKINSTALLDIRS = "$(R_HOME)/bin/mkinstalldirs"
NM = /usr/bin/nm -B
OBJC = 
OBJCFLAGS =  $(LTO)
OBJC_LIBS = 
OBJCXX = 
R_ARCH = 
RANLIB = ranlib
SAFE_FFLAGS = -O2
## A version of SHLIB_LIBADD not overridden in install.R.
SAN_LIBS =
SED = /usr/bin/sed
SHELL = /bin/sh
SHLIB_CFLAGS = 
SHLIB_CXXFLAGS = 
SHLIB_CXXLD = $(CXX)
SHLIB_CXXLDFLAGS = -shared# $(CXXFLAGS) $(CXXPICFLAGS) $(LTO_LD)
SHLIB_CXX11LD = $(CXX11) $(CXX11STD)
SHLIB_CXX11LDFLAGS = -shared# $(CXX11FLAGS) $(CXX11PICFLAGS) $(LTO_LD)
SHLIB_CXX14LD = $(CXX14) $(CXX14STD)
SHLIB_CXX14LDFLAGS = -shared# $(CXX14FLAGS) $(CXX14PICFLAGS) $(LTO_LD)
SHLIB_CXX17LD = $(CXX17) $(CXX17STD)
SHLIB_CXX17LDFLAGS = -shared# $(CXX17FLAGS) $(CXX17PICFLAGS) $(LTO_LD)
SHLIB_CXX20LD = $(CXX20) $(CXX20STD)
SHLIB_CXX20LDFLAGS = -shared# $(CXX20FLAGS) $(CXX20PICFLAGS) $(LTO_LD)
SHLIB_CXX23LD = $(CXX23) $(CXX23STD)
SHLIB_CXX23LDFLAGS = -shared# $(CXX23FLAGS) $(CXX23PICFLAGS) $(LTO_LD)
SHLIB_CXX26LD = $(CXX26) $(CXX26STD)
SHLIB_CXX26LDFLAGS = -shared# $(CXX26FLAGS) $(CXX26PICFLAGS) $(LTO_LD)
SHLIB_EXT = .so
SHLIB_FCLD = $(FC)
SHLIB_FCLDFLAGS = -shared -fPIC# $(FCFLAGS) $(FPICFLAGS)
SHLIB_FFLAGS = 
SHLIB_LD = $(CC)
## used for add-on packages linked by C
SHLIB_LDFLAGS = -shared -fPIC# $(CFLAGS) $(CPICFLAGS) $(LTO_LD)
## used for standard packages
SHLIB_LDFLAGS_R = -shared -fPIC# $(CFLAGS) $(CPICFLAGS) $(LTO_LD)
## used in install.R to add OBJC_LIBS, FLIBS ....
SHLIB_LIBADD = 
## We want to ensure libR is picked up from $(R_HOME)/lib
## before e.g. /usr/local/lib if a version is already installed.
SHLIB_LINK = $(SHLIB_LD) $(SHLIB_LDFLAGS) $(LIBR0) $(LDFLAGS)
SHLIB_OPENMP_CFLAGS = 
SHLIB_OPENMP_CXXFLAGS = 
SHLIB_OPENMP_FFLAGS = 
STRIP_STATIC_LIB = strip --strip-debug
STRIP_SHARED_LIB = strip --strip-unneeded
TCLTK_CPPFLAGS = -I/usr/local/include/tcl8.5 -I/usr/local/include/tk8.5 -I/usr/X11R6/include
TCLTK_LIBS = -L/usr/local/lib -ltcl85 -L/usr/local/lib -ltk85 -L/usr/X11R6/lib -lX11 -lXss -lXext
YACC = yacc

## for linking to libR.a
STATIC_LIBR = #  "$(R_HOME)/lib$(R_ARCH)/libR.a"  $(BLAS_LIBS) $(FLIBS)  $(LIBINTL) -lreadline  $(LIBS)

## These are recorded as macros for legacy use in packages
## set on AIX, formerly for old glibc (-D__NO_MATH_INLINES)
R_XTRA_CFLAGS = 
##  was formerly set on HP-UX
R_XTRA_CPPFLAGS =  -I"$(R_INCLUDE_DIR)" -DNDEBUG
## currently unset
R_XTRA_CXXFLAGS = 
## used for gfortran >= 7 in R 3.6.1 - 4.2.x
R_XTRA_FFLAGS = 

## SHLIB_CFLAGS SHLIB_CXXFLAGS SHLIB_FFLAGS are apparently currently unused
## SHLIB_CXXFLAGS is undocumented, there is no SHLIB_FCFLAGS
ALL_CFLAGS =  $(PKG_CFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(CFLAGS)
## XDEFS was a temporary measure for use by R CMD INSTALL
ALL_CPPFLAGS =  -I"$(R_INCLUDE_DIR)" -DNDEBUG $(PKG_CPPFLAGS) $(CLINK_CPPFLAGS) $(CPPFLAGS)  $(XDEFS)
## CXX_DEFS allows adding defines only for C++, e.g. -DR_NO_REMAP
ALL_CXXFLAGS =  $(PKG_CXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(CXXFLAGS) $(CXX_DEFS)
ALL_OBJCFLAGS = $(PKG_OBJCFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(OBJCFLAGS)
ALL_OBJCXXFLAGS = $(PKG_OBJCXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(OBJCXXFLAGS)
ALL_FFLAGS =  $(PKG_FFLAGS) $(FPICFLAGS) $(SHLIB_FFLAGS) $(FFLAGS)
## can be overridden by R CMD SHLIB
P_FCFLAGS = $(PKG_FFLAGS)
ALL_FCFLAGS =  $(P_FCFLAGS) $(FPICFLAGS) $(SHLIB_FFLAGS) $(FCFLAGS)
## LIBR here as a couple of packages use this without SHLIB_LINK
ALL_LIBS = $(PKG_LIBS) $(SHLIB_LIBADD) $(SAN_LIBS) $(LIBR)# $(LIBINTL)

.SUFFIXES:
.SUFFIXES: .c .cc .cpp .d .f .f90 .f95 .m .mm .M .o

.c.o:
	$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c $< -o $@
.c.d:
	@echo "making $@ from $<"
	@$(CC) -MM $(ALL_CPPFLAGS) $< > $@
.m.d:
	@echo > $@
.cc.o:
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@
.cpp.o:
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@
.cc.d:
	@echo "making $@ from $<"
	@$(CXX) -M $(ALL_CPPFLAGS) $< > $@
.cpp.d:
	@echo "making $@ from $<"
	@$(CXX) -M $(ALL_CPPFLAGS) $< > $@
.m.o:
	$(OBJC) $(ALL_CPPFLAGS) $(ALL_OBJCFLAGS) -c $< -o $@
.mm.o:
	$(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $@
.M.o:
	$(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $@
.f.o:
	$(FC) $(ALL_FFLAGS) -c $< -o $@
.f95.o:
	$(FC) $(ALL_FCFLAGS) -c  $< -o $@
.f90.o:
	$(FC) $(ALL_FCFLAGS) -c  $< -o $@
