#-*- Makefile -*- ## ===== configuration macros for building packages or R =============== # Alternatives MINGW (mingw), CROSS (Linux) BUILD=MINGW HELP = YES ifeq ($(strip $(BUILD)),CROSS) WINHELP = NO else WINHELP = CHM # NO, CHM, BOTH endif ## ============== configuration macros for building R =================== LEA_MALLOC=YES # Set to YES and specify the path if you want to use the ATLAS BLAS. USE_ATLAS=NO ATLAS_PATH=/R/ATLAS/lib/WinNT_P4SSE2 # Where does 'HTML Help Workshop' live? (unused if compiled HTML help is # not requested. Spaces allowed.) HHWDIR=C:/Program Files/HTML Help Workshop # Where does Tcl/Tk live? Spaces allowed. TCL_HOME = C:/packages/Tcl TCL_VERSION = 83 ## ====== configuration macros for building installers =========== # location where Inno Setup was installed ISDIR=C:/packages/Inno ## =================== cross-compiler settings ================= ifeq ($(strip $(BUILD)),CROSS) # Next two might be i386-mingw32msvc- or i586- depending on the cross-compiler. BINPREF=mingw32- # Set this to where the mingw32 include files are. It must be accurate. HEADER=/users/ripley/R/cross-tools/mingw32/include endif ## =============== end of user-customizable parts =================== ## want survival before boot for xrefs REC_NONBUNDLES=KernSmooth survival boot cluster foreign grid lattice mgcv nlme rpart RECOMMENDED=VR $(REC_NONBUNDLES) REC_PKGS=$(REC_NONBUNDLES) MASS class nnet spatial ifeq ($(strip $(BUILD)),MINGW) BINPREF= MINGW32CFLAG= MINGW32LDFLAG= FLIBS=-lg2c AWK=gawk endif ifeq ($(strip $(BUILD)),CROSS) MINGW32CFLAG=-isystem $(HEADER) MINGW32LDFLAG= FLIBS=-lg2c AWK=awk endif PERL=perl RM=rm -f SED=sed ECHO=echo CP=cp MKDIR=mkdir CAT=cat CC=$(BINPREF)gcc $(MINGW32CFLAG) CXX=$(BINPREF)g++ $(MINGW32CFLAG) F77=$(BINPREF)g77 AS=$(BINPREF)as DLL_LDMAIN=gcc DLL=$(BINPREF)$(DLL_LDMAIN) $(MINGW32LDFLAG) DLLTOOL=$(BINPREF)dlltool -k --as $(AS) LINKER=$(BINPREF)gcc $(MINGW32LDFLAG) AR=$(BINPREF)ar RANLIB=$(BINPREF)ranlib NM=$(BINPREF)nm CPP=$(CC) -E RESCOMP=$(BINPREF)windres .SUFFIXES: .c .cc .cpp .C .f .o .a .def .exp .dll .exe .d .c.d: @echo "making $@ from $<" @$(CC) -M $(CFLAGS) $($*-CFLAGS) $< -o $@ .cc.d: @echo "making $@ from $<" @$(CXX) -M $(CXXFLAGS) $($*-CXXFLAGS) $< -o $@ .cpp.d: @echo "making $@ from $<" @$(CXX) -M $(CXXFLAGS) $($*-CXXFLAGS) $< -o $@ .C.d: @echo "making $@ from $<" @$(CXX) -M $(CXXFLAGS) $($*-CXXFLAGS) $< -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 $@ %.exe: $(LINKER) $(LINKFLAGS) $($*-LINKFLAGS) -o $@ $^ $($*-LIBS) $(LIBS) %.dll: @$(ECHO) ------- Building $@ from $^ -------- $(ECHO) LIBRARY $* > $*.def $(ECHO) EXPORTS >> $*.def $(NM) $^ > Defs $(SED) -n '/^........ [BCDRT] _/s/^........ [BCDRT] _/ /p' Defs >> $*.def $(RM) Defs $(DLL) --shared $(DLLFLAGS) $($*-DLLFLAGS) -o $@ $*.def $^ $($*-DLLLIBS) $(DLLLIBS) $(RM) $*.def lib%.a: %.def @$(ECHO) -------- Building $@ from $^ -------- $(DLLTOOL) $(DLLTOOLFLAGS) $($*-DLLTOOLFLAGS) --dllname $*.dll --def $*.def --output-lib lib$*.a %.a: @$(ECHO) -------- Building $@ from $^ -------- $(AR) cr $@ $^ $(RANLIB) $@ %.o: %.rc $(RESCOMP) $(RESFLAGS) $($*-RESFLAGS) -i $< -o $@