Rev 78954 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
#-*- Makefile -*-## Defaults for user settings, see MkRules.dist for descriptions. Rtools42## assumes that the compiler toolchain (e.g. gcc, as, ...) is on PATHLOCAL_SOFT ?= $(shell which `echo $(CC) | sed -e 's/ .*//g'` | sed -e 's!/bin/[^/]\+!!g')EXT_LIBS ?= $(LOCAL_SOFT)G_FLAG ?= -gdwarf-2USE_ATLAS ?= NOATLAS_PATH ?=MULTI ?=TOOL_PATH ?=BINPREF ?=BINPREF64 ?=COMPILED_BY ?= gcc-$(shell $(CC) --version | egrep -o "([0-9]{1,}\.){2,}[0-9]{1,}")M_ARCH ?=AS_ARCH ?=RC_ARCH ?=DT_ARCH ?=WIN ?= 64USE_ICU ?= YESICU_PATH ?=ICU_LIBS ?= -lsicuin -lsicuuc $(EXT_LIBS)/lib/sicudt.a -lstdc++USE_CAIRO ?= YESCAIRO_CPPFLAGS ?= -I$(EXT_LIBS)/include/cairoCAIRO_LIBS ?= "-lcairo -lfontconfig -lfreetype -lpng -lpixman-1 -lexpat -lharfbuzz -lbz2 -lintl -lz -liconv -lgdi32 -lmsimg32"CURL_CA_BUNDLE ?=USE_LIBCURL = yesCURL_LIBS ?= -lcurl -lzstd -lrtmp -lssl -lssh2 -lgcrypt -lcrypto -lgdi32 -lz -lws2_32 -lgdi32 -lcrypt32 -lidn2 -lunistring -liconv -lgpg-error -lwldap32 -lwinmmBUILD_HTML ?= NOMIKTEX ?= TRUETEXI2ANY ?= texi2anyTEXI2DVI = env COMSPEC= texi2dviMAKEINFO = texi2anyEOPTS ?= -mfpmath=sse -msse2 -mstackrealignOPENMP ?= -fopenmpPTHREAD ?= -pthreadISDIR ?= C:/Program Files (x86)/Inno Setup 6QPDF ?=HOME32 ?=DLLs32 ?=DLLs64 ?=WIX3DIR ?=WIX_PERSONAL ?= 0## =============== end of user setting defaults ===================ifeq "$(MULTI)" "64"WIN = 64M_ARCH = -m64AS_ARCH = --64RC_ARCH = -F pe-x86-64DT_ARCH = -m i386:x86-64 --as-flags --64BINPREF64 = $(TOOL_PATH)endififeq "$(MULTI)" "32"WIN = 32# these are normally the defaultsM_ARCH = -m32AS_ARCH = --32RC_ARCH = -F pe-i386DT_ARCH = -m i386 --as-flags --32BINPREF = $(TOOL_PATH)endififeq "$(WIN)" "64"R_ARCH = /x64arch_DEFS = -DR_ARCH='"x64"'BINPREF = $(BINPREF64)SYMPAT = 's/^.* [BCDRT] / /p'NM_FILTER ?= | $(SED) -e '/[.]refptr[.]/d' -e '/[.]weak[.]/d'elseR_ARCH = /i386arch_DEFS = -DR_ARCH='"i386"'SYMPAT = 's/^.* [BCDRT] _/ /p'endif## -std=c99 would force __STRICT_ANSI__ disabling strdup etc, and also allocaC99FLAG=-std=gnu99## earlier Rtools needed -sjlj; the alternative is -dw2, which failed building R.GCC4_SUFF=BINDIR=bin$(R_ARCH)ifdef USE_IMPLIBSIMPDIR=libelseIMPDIR=$(BINDIR)endifAR = $(BINPREF)arCAT=catCC=$(BINPREF)gcc$(GCC4_SUFF) $(C99FLAG) $(M_ARCH)CP=cp# as set by makeCPP=$(CC) -EDLL=$(CC)DLLTOOL=$(BINPREF)dlltool## some versions have trouble with paths, so we always need this## even for native buildsDLLTOOLFLAGS=--as $(BINPREF)as $(DT_ARCH) -kECHO=echoFC=$(BINPREF)gfortran$(GCC4_SUFF) $(M_ARCH)FLIBS=-lgfortran -lquadmathLINKER=$(MAIN_LD)MAIN_LD=$(CC)## MAKEINFO = $(TEXI2ANY)MKDIR=mkdirNM=$(BINPREF)nmRANLIB = $(BINPREF)ranlibRESCOMP=$(BINPREF)windres $(RC_ARCH)SHLIB_LD=$(CC)SHLIB_LDFLAGS=-shared## If the Fortran compiler is gfortran >= 7, add## -fno-optimize-sibling-calls to avoid recent gfortran optimizations## that break with LAPACK/BLAS-style passing of length-1 strings## (without hidden arguments giving their lengths).#### One could also use -ftail-call-workaround=2, which would be less## restrictive, and has been added after the breakages were discovered.## However, it is documented that this option may be removed in the future.## https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90329GFVER = $(shell echo "__GNUC__" | $(FC) -E -P -)GF7OPTS =ifneq ($(GFVER),"")GF7OPTS = $(shell [ $(GFVER) -ge 7 ] && echo "-fno-optimize-sibling-calls")endififneq "$(LTO)" ""AR = $(BINPREF)gcc-arNM = $(BINPREF)gcc-nmRANLIB = $(BINPREF)gcc-ranlibDLLFLAGS += $(CFLAGS)endif# as set by makeRM=rm -fSED=sedSORT=sort.SUFFIXES:.SUFFIXES: .c .cc .cpp .C .f .o .a .def .exp .dll .exe .d .f90 .f95 .m .S.c.d:@echo "making $@ from $<"@$(CC) -MM $(CPPFLAGS) $($*-CPPFLAGS) $(DEFINES) $< -o $@.c.o:$(CC) $(CPPFLAGS) $($*-CPPFLAGS) $(CFLAGS) $($*-CFLAGS) $(DEFINES) -c $< -o $@.f.o:$(FC) $(FFLAGS) $($*-FFLAGS) -c $< -o $@## $($*-LINKFLAGS) is used for Rgui Rterm and Rscript%.exe:$(LINKER) $(LINKFLAGS) $($*-LINKFLAGS) -o $@ $^ $($*-LIBS) $(LIBS)## It does little sense to have $($*-DLLFLAGS) here (and not in etc/Makeconf)## $($*-DLLLIBS) is used for R and lapack%.dll:@$(ECHO) EXPORTS > $*.def@$(NM) $^ | $(SED) -n $(SYMPAT) $(NM_FILTER) >> $*.def$(DLL) -shared $(DLLFLAGS) $($*-DLLFLAGS) -o $@ $*.def $^ $($*-DLLLIBS) $(DLLLIBS)@$(RM) $*.def## It does no sense to have $($*-DLLTOOLFLAGS) here, and it is unused.lib%.dll.a: %.def$(DLLTOOL) $(DLLTOOLFLAGS) $($*-DLLTOOLFLAGS) --dllname $*.dll --input-def $*.def --output-lib $@%.a:# @$(ECHO) -------- Building $@ from $^ --------@$(RM) $@$(AR) crs $@ $^%.o: %.rc$(RESCOMP) $(RESFLAGS) $($*-RESFLAGS) -i $< -o $@