Rev 42498 | Blame | Compare with Previous | 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 GCC3 (MinGW gcc3), GCC4 (MinGW gcc4) or CROSS (e.g. Linux)BUILD=GCC3## if cross-building, is this gcc3 or gcc4?CROSS-GCC=gcc3## 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# If you want to use AMD's ACML BLAS,# set to YES and specify the path to libacml.aUSE_ACML=NOACML_PATH=c:/Program Files/AMD/acml3.6.0/gnu32/lib## Set this to YES if you want to use ACML's LAPACK not R's.USE_ACML_LAPACK=NO# Support for the Goto BLAS 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 unicows# USE_UNICOWS = YES# 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## ====== configuration macros for building installer ===========# location where Inno Setup 5.1.x was installed. Spaces allowed.ISDIR=C:/packages/Inno51## ====== 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)F95=gfortran$(GCC4_SUFF)else# needs to be set by userF95=endifF95FLAGS=-O3 $(PKG_FCFLAGS)## =================== cross-compilation settings =================ifeq ($(strip $(BUILD)),CROSS)# Next might be mingw32- or i386-mingw32msvc- or i586-# depending on the cross-compiler.BINPREF=i586-mingw32-# Set this to where the mingw32 include files are. It must be accurate.# It should contain fcntl.h and windows.hHEADER=/users/ripley/R/cross-tools5/i586-mingw32/include# 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'endif## =============== end of user-customizable parts ===================DEPARG=-MMMINGW32LDFLAG=C99FLAG=-std=gnu99ifeq ($(strip $(BUILD)),GCC3)BINPREF=MINGW32CFLAG=F77=g77FLIBS=-lg2cAWK=gawkendififeq ($(strip $(BUILD)),GCC4)BINPREF=MINGW32CFLAG=F77=gfortran$(GCC4_SUFF)FLIBS=-lgfortranAWK=gawk## for mingw-runtime <= 3.11# C99FLAG=-std=gnu99 -fgnu89-inline## alternative is -dw2, which currently fails building R, or empty## for unofficial builds including TDM's and GFortran from the WikiGCC4_SUFF=-sjljendififeq ($(strip $(BUILD)),CROSS)MINGW32CFLAG=-isystem $(HEADER)ifeq ($(strip $(CROSS-GCC)),gcc4)F77=$(BINPREF)gfortranFLIBS=-lgfortranelseF77=$(BINPREF)g77FLIBS=-lg2cendifAWK=awkendifBLAS_LIBS= -L$(RHOME)/bin -lRblasifeq ($(strip $(USE_ACML_LAPACK)),YES)LAPACK_LIBS=-L"$(ACML_PATH)" -lacml -lg2celseLAPACK_LIBS= -L$(RHOME)/bin -lRlapackendififdef USE_UNICOWSLIBEXTRAS+=-lunicowsendifPERL=perlRM=rm -fSED=sedECHO=echoCP=cpMKDIR=mkdirCAT=catCC=$(BINPREF)gcc$(GCC4_SUFF) $(MINGW32CFLAG)CXX=$(BINPREF)g++$(GCC4_SUFF) $(MINGW32CFLAG)OBJC=$(BINPREF)gcc$(GCC4_SUFF) $(MINGW32CFLAG)AS=$(BINPREF)asDLL_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) -kMAIN_LD=$(CC)LINKER=$(MAIN_LD) $(MINGW32LDFLAG)AR=$(BINPREF)arRANLIB=$(BINPREF)ranlibNM=$(BINPREF)nmCPP=$(CC) -ERESCOMP=$(BINPREF)windres.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) $(CFLAGS) $($*-CFLAGS) $< -o $@.cc.d:@echo "making $@ from $<"@$(CXX) $(DEPARG) $(CXXFLAGS) $($*-CXXFLAGS) $< -o $@.cpp.d:@echo "making $@ from $<"@$(CXX) $(DEPARG) $(CXXFLAGS) $($*-CXXFLAGS) $< -o $@.C.d:@echo "making $@ from $<"@$(CXX) $(DEPARG) $(CXXFLAGS) $($*-CXXFLAGS) $< -o $@.m.d:@echo "making $@ from $<"@$(OBJC) $(DEPARG) $(OBJCFLAGS) $($*-OBJCFLAGS) $< -o $@.c.o:$(CC) $(CFLAGS) $($*-CFLAGS) -c $< -o $@.f.o:$(F77) $(FFLAGS) $($*-FFLAGS) -c $< -o $@.cc.o:$(CXX) $(CXXFLAGS) $($*-CXXFLAGS) -c $< -o $@.cpp.o:$(CXX) $(CXXFLAGS) $($*-CXXFLAGS) -c $< -o $@.C.o:$(CXX) $(CXXFLAGS) $($*-CXXFLAGS) -c $< -o $@.m.o:$(OBJC) $(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:"$(F95)" $(F95FLAGS) -c $< -o $@.f95.o:"$(F95)" $(F95FLAGS) -c $< -o $@