Rev 43796 | Blame | Last modification | View Log | Download | RSS feed
#-*- Makefile -*-## This files contains tabs: make sure your editor leaves them unchanged.## ===== configuration macros for building packages or R ===============# Alternatives GCC4 (MinGW gcc4) or CROSS (e.g. Linux)# or F2C (use suitable f2c rather than a Fortran compiler).BUILD=GCC4## These are overridden by R CMD INSTALL: they only apply to## standard packages when building R and when using 'make pkg-foo'HELP = YESHELPTYPES = -txt -html -latex -exampleifeq ($(strip $(BUILD)),CROSS)WINHELP = NOelseWINHELP = CHM # NO or CHMendif# an alternative is to use -g here, if the debugger supports only stabs.G_FLAG=-gdwarf-2## ============== configuration macros for building R ===================# Comment out if the msvcrt.dll malloc/free is required.LEA_MALLOC=YES# Set to YES and specify the path if you want to use the ATLAS BLAS.USE_ATLAS=NOATLAS_PATH=/R/ATLAS/lib/WinNT_P4SSE2# Support for the ACML and Goto BLASes has been withdrawn: see R-admin.html# Where does 'HTML Help Workshop' live? (unused if compiled HTML help is# not requested. Spaces allowed.)HHWDIR=C:/Program Files/HTML Help Workshop# Define this to enable memory profiling.# R_MEMORY_PROFILING=YES# Where does Tcl/Tk live? Spaces allowed.TCL_HOME = $(RHOME)/TclTCL_VERSION = 84# Define to use svnversion to set SVN-REVISION (slow, but more informative# than without it because mixed or modified revisions will be indicated)# USE_SVNVERSION = YES# We normally link against DLLs, but this macro forces the use of import libs# Needed if using other compilers, and currently on Win64# USE_IMPLIBS = YES# 32- or 64-bit Windows?WIN=32ifeq ($(strip $(WIN)),64)USE_IMPLIBS = YESendif## ====== configuration macros for building installer ===========# location where Inno Setup 5.[12].x was installed. Spaces allowed.ISDIR=C:/packages/Inno## ====== configuration macros for building MSI installer ===========# location where WiX was installed. Spaces allowed, slashes required.WIXDIR=C:/packages/WiX## ====== configuration macros for building packages ================## For a package using F90/95 set the name or path of gfortran.exe## or g95.exe. Spaces allowed.ifeq ($(strip $(BUILD)),GCC4)FC=gfortran$(GCC4_SUFF)else# needs to be set by userFC=endifFCFLAGS=-O3## =================== cross-compilation settings =================ifeq ($(strip $(BUILD)),CROSS)# Next might be i586-mingw32- or x86_64-pc-mingw32- or ...# depending on the cross-compiler.ifeq ($(strip $(WIN)),64)BINPREF=x86_64-pc-mingw32-elseBINPREF=i586-mingw32-endif# Optional, if compiler has been relocated# Set this to full path to dir where the mingw32 include files are.# It should contain fcntl.h and windows.hHEADER=# path (possibly full path) to same version of R on the host systemR_EXE='I failed to read the instructions to set R_EXE in MkRules'## SHLIB extension on host: 'so' or 'dll'CROSS_EXT=soendif## =============== end of user-customizable parts ===================DEPARG=-MMMINGW32LDFLAG=C99FLAG=-std=gnu99ifeq ($(strip $(BUILD)),GCC4)BINPREF=MINGW32CFLAG=F77=gfortran$(GCC4_SUFF)FLIBS=-lgfortranAWK=gawk## for mingw-runtime <= 3.11# C99FLAG=-std=gnu99 -fgnu89-inline## earlier Rtools needs -sjlj## an alternative is -dw2, which currently fails building R.GCC4_SUFF=endififeq ($(strip $(BUILD)),CROSS)ifneq ($(strip $(HEADER)),)MINGW32CFLAG=-isystem $(HEADER)endifF77=$(BINPREF)gfortranFLIBS=-lgfortranAWK=awkendififeq ($(strip $(BUILD)),F2C)BINPREF=MINGW32CFLAG=F77=sh $(RHOME)/src/scripts/f77_f2cFLIBS=-lf2cAWK=gawkendififeq ($(strip $(USE_IMPLIBS)),YES)IMPDIR=libelseIMPDIR=binendifBLAS_LIBS= -L$(RHOME)/$(IMPDIR) -lRblasLAPACK_LIBS= -L$(RHOME)/$(IMPDIR) -lRlapackGRAPHAPP_LIB=-lgraphappAR=$(BINPREF)arAS=$(BINPREF)asCAT=catCC=$(BINPREF)gcc$(GCC4_SUFF) $(MINGW32CFLAG) $(C99FLAG)CP=cp# as set by makeCPP=$(CC) -ECXX=$(BINPREF)g++$(GCC4_SUFF) $(MINGW32CFLAG)## overridden in some packagesDLL_LDMAIN=$(CC)DLL=$(DLL_LDMAIN) $(MINGW32LDFLAG)## formerly used version without -k for front-ends/libproxy.aDLLTOOL=$(BINPREF)dlltool## some versions have trouble with paths, so we always need this## even for native buildsDLLTOOLFLAGS=--as $(AS) -kECHO=echoFIND=findLINKER=$(MAIN_LD) $(MINGW32LDFLAG)MAIN_LD=$(CC)MKDIR=mkdirNM=$(BINPREF)nmOBJC=$(BINPREF)gcc$(GCC4_SUFF) $(MINGW32CFLAG)PERL=perlRANLIB=$(BINPREF)ranlibRESCOMP=$(BINPREF)windres --preprocessor="$(BINPREF)gcc$(GCC4_SUFF) -E -xc -DRC_INVOKED"# as set by makeRM=rm -fSED=sedSORT=sort## from etc/Renviron.site on UnixEGREP=grep -eLN_S=cp -pTAR=tar.SUFFIXES:.SUFFIXES: .c .cc .cpp .C .f .o .a .def .exp .dll .exe .d .f90 .f95 .m .S.c.d:@echo "making $@ from $<"@$(CC) $(DEPARG) $(CPPFLAGS) $($*-CPPFLAGS) $< -o $@.cc.d:@echo "making $@ from $<"@$(CXX) $(DEPARG) $(CPPFLAGS) $($*-CPPFLAGS) $< -o $@.cpp.d:@echo "making $@ from $<"@$(CXX) $(DEPARG) $(CPPFLAGS) $($*-CPPFLAGS) $< -o $@.C.d:@echo "making $@ from $<"@$(CXX) $(DEPARG) $(CPPFLAGS) $($*-CPPFLAGS) $< -o $@.m.d:@echo "making $@ from $<"@$(OBJC) $(DEPARG) $(CPPFLAGS) $($*-CPPFLAGS) $< -o $@.c.o:$(CC) $(CPPFLAGS) $($*-CPPFLAGS) $(CFLAGS) $($*-CFLAGS) -c $< -o $@.f.o:$(F77) $(FFLAGS) $($*-FFLAGS) -c $< -o $@.cc.o:$(CXX) $(CPPFLAGS) $($*-CPPFLAGS) $(CXXFLAGS) $($*-CXXFLAGS) -c $< -o $@.cpp.o:$(CXX) $(CPPFLAGS) $($*-CPPFLAGS) $(CXXFLAGS) $($*-CXXFLAGS) -c $< -o $@.C.o:$(CXX) $(CPPFLAGS) $($*-CPPFLAGS) $(CXXFLAGS) $($*-CXXFLAGS) -c $< -o $@.m.o:$(OBJC) $(CPPFLAGS) $($*-CPPFLAGS) $(OBJCFLAGS) $($*-OBJCFLAGS) -c $< -o $@%.exe:$(LINKER) $(LINKFLAGS) $($*-LINKFLAGS) -o $@ $^ $($*-LIBS) $(LIBS)%.dll:@$(ECHO) EXPORTS > $*.def@$(NM) $^ | $(SED) -n 's/^.* [BCDRT] _/ /p' >> $*.def$(DLL) -shared $(DLLFLAGS) $($*-DLLFLAGS) -o $@ $*.def $^ $($*-DLLLIBS) $(DLLLIBS)@$(RM) $*.deflib%.dll.a: %.def$(DLLTOOL) $(DLLTOOLFLAGS) $($*-DLLTOOLFLAGS) --dllname $*.dll --input-def $*.def --output-lib $@%.a:# @$(ECHO) -------- Building $@ from $^ --------@$(RM) $@$(AR) crs $@ $^ifeq ($(strip $(BUILD)),CROSS)%.o: %.rc$(RESCOMP) $(RESFLAGS) $($*-RESFLAGS) -I $(HEADER) -i $< -o $@else%.o: %.rc$(RESCOMP) $(RESFLAGS) $($*-RESFLAGS) -i $< -o $@endif.f90.o:"$(FC)" $(PKG_FCFLAGS) $(FCFLAGS) -c $< -o $@.f95.o:"$(FC)" $(PKG_FCFLAGS) $(FCFLAGS) -c $< -o $@