The R Project SVN R

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6994 pd 1
#-*- Makefile -*-
21544 ripley 2
## This files contains tabs: make sure your editor leaves them unchanged.
4394 ripley 3
 
17913 ripley 4
## ===== configuration macros for building packages or R  ===============
5
 
6
# Alternatives MINGW (mingw), CROSS (Linux)
27849 ripley 7
BUILD=MINGW
4394 ripley 8
 
17913 ripley 9
HELP = YES
17915 ripley 10
ifeq ($(strip $(BUILD)),CROSS)
11
WINHELP = NO
12
else
27883 ripley 13
WINHELP = CHM # NO or CHM
17915 ripley 14
endif
17913 ripley 15
 
16
## ============== configuration macros for building R ===================
17
 
27883 ripley 18
# Comment out if the msvcrt.dll malloc/free is required.
17913 ripley 19
LEA_MALLOC=YES
20
 
21
# Set to YES and specify the path if you want to use the ATLAS BLAS.
19520 ripley 22
USE_ATLAS=NO
26742 ripley 23
ATLAS_PATH=/R/ATLAS/lib/WinNT_PIIISSE1
17913 ripley 24
 
27884 ripley 25
# Set to YES and specify the DLL name if you want to use K. Goto's BLAS.
26
USE_GOTO=NO
27
GOTO_DLL=libgoto_p4_512-r0.9.dll
28
 
6098 pd 29
# Where does 'HTML Help Workshop' live? (unused if compiled HTML help is
8641 ripley 30
# not requested. Spaces allowed.)
31
HHWDIR=C:/Program Files/HTML Help Workshop
6098 pd 32
 
9349 ripley 33
# Where does Tcl/Tk live? Spaces allowed.
23131 ripley 34
TCL_HOME = $(RHOME)/Tcl
22407 ripley 35
TCL_VERSION = 84
9349 ripley 36
 
17913 ripley 37
## ====== configuration macros for building installers ===========
38
 
26742 ripley 39
# location where Inno Setup 4.x was installed
40
ISDIR=C:/packages/Inno4
17913 ripley 41
 
22407 ripley 42
## =================== cross-compilation settings  =================
18256 ripley 43
 
44
ifeq ($(strip $(BUILD)),CROSS)
27883 ripley 45
# Next might be i386-mingw32msvc- or i586- depending on the cross-compiler.
18256 ripley 46
BINPREF=mingw32-
18307 ripley 47
# Set this to where the mingw32 include files are. It must be accurate.
18256 ripley 48
HEADER=/users/ripley/R/cross-tools/mingw32/include
49
endif
22574 ripley 50
# path (possibly full path) to same version of R on the host system
27849 ripley 51
R_EXE=R
18256 ripley 52
 
17913 ripley 53
## =============== end of user-customizable parts  ===================
54
 
16251 ripley 55
ifeq ($(strip $(BUILD)),MINGW)
4394 ripley 56
BINPREF=
9372 ripley 57
MINGW32CFLAG=
58
MINGW32LDFLAG=
4394 ripley 59
FLIBS=-lg2c
60
AWK=gawk
22948 ripley 61
## only safe for gcc >= 3.1
62
DEPARG=-MM
9372 ripley 63
endif
4394 ripley 64
 
65
ifeq ($(strip $(BUILD)),CROSS)
66
MINGW32CFLAG=-isystem $(HEADER)
9372 ripley 67
MINGW32LDFLAG=
4394 ripley 68
FLIBS=-lg2c
69
AWK=awk
22948 ripley 70
## BDR's build of cross-compiler is 2.95.3
71
DEPARG=-M
9372 ripley 72
endif
4394 ripley 73
 
74
PERL=perl
75
RM=rm -f
76
SED=sed
77
ECHO=echo
78
CP=cp
79
MKDIR=mkdir
80
CAT=cat
9372 ripley 81
CC=$(BINPREF)gcc $(MINGW32CFLAG)
9940 pd 82
CXX=$(BINPREF)g++ $(MINGW32CFLAG)
4394 ripley 83
F77=$(BINPREF)g77
84
AS=$(BINPREF)as
9940 pd 85
DLL_LDMAIN=gcc
86
DLL=$(BINPREF)$(DLL_LDMAIN) $(MINGW32LDFLAG)
4394 ripley 87
DLLTOOL=$(BINPREF)dlltool -k --as $(AS)
9372 ripley 88
LINKER=$(BINPREF)gcc $(MINGW32LDFLAG)
4394 ripley 89
AR=$(BINPREF)ar
90
RANLIB=$(BINPREF)ranlib
91
NM=$(BINPREF)nm
92
CPP=$(CC) -E
9372 ripley 93
RESCOMP=$(BINPREF)windres
4394 ripley 94
 
17913 ripley 95
.SUFFIXES: .c .cc .cpp .C .f .o .a .def .exp .dll .exe .d
96
 
14136 ripley 97
.c.d:
98
	@echo "making $@ from $<"
22948 ripley 99
	@$(CC) $(DEPARG) $(CFLAGS) $($*-CFLAGS) $< -o $@
14136 ripley 100
 
21115 ripley 101
.cc.d:
102
	@echo "making $@ from $<"
22948 ripley 103
	@$(CXX) $(DEPARG) $(CXXFLAGS) $($*-CXXFLAGS) $< -o $@
21115 ripley 104
 
105
.cpp.d:
106
	@echo "making $@ from $<"
22948 ripley 107
	@$(CXX) $(DEPARG) $(CXXFLAGS) $($*-CXXFLAGS) $< -o $@
21115 ripley 108
 
109
.C.d:
110
	@echo "making $@ from $<"
22948 ripley 111
	@$(CXX) $(DEPARG) $(CXXFLAGS) $($*-CXXFLAGS) $< -o $@
21115 ripley 112
 
4394 ripley 113
.c.o:
15534 ripley 114
	$(CC) $(CFLAGS) $($*-CFLAGS) -c $< -o $@
6994 pd 115
 
4394 ripley 116
.f.o:
117
	$(F77) $(FFLAGS) $($*-FFLAGS) -c $< -o $@
118
 
9940 pd 119
.cc.o:
15534 ripley 120
	$(CXX) $(CXXFLAGS) $($*-CXXFLAGS) -c $< -o $@
9940 pd 121
 
10002 ripley 122
.cpp.o:
15534 ripley 123
	$(CXX) $(CXXFLAGS) $($*-CXXFLAGS) -c $< -o $@
10002 ripley 124
 
125
.C.o:
15534 ripley 126
	$(CXX) $(CXXFLAGS) $($*-CXXFLAGS) -c $< -o $@
10002 ripley 127
 
9372 ripley 128
%.exe:
15534 ripley 129
	$(LINKER) $(LINKFLAGS) $($*-LINKFLAGS) -o $@ $^ $($*-LIBS) $(LIBS)
4394 ripley 130
 
18256 ripley 131
%.dll:
21638 ripley 132
#	@$(ECHO) ------- Building $@ from $^ --------
21580 ripley 133
	@$(ECHO) LIBRARY $* > $*.def
134
	@$(ECHO) EXPORTS >> $*.def
135
	@$(NM) $^ > Defs
136
	@$(SED) -n '/^........ [BCDRT] _/s/^........ [BCDRT] _/ /p' Defs >> $*.def
137
	@$(RM) Defs
15534 ripley 138
	$(DLL) --shared $(DLLFLAGS) $($*-DLLFLAGS) -o $@ $*.def $^ $($*-DLLLIBS) $(DLLLIBS)
21580 ripley 139
	@$(RM) $*.def
4394 ripley 140
 
141
lib%.a: %.def
142
	@$(ECHO) -------- Building $@ from $^ --------
143
	$(DLLTOOL) $(DLLTOOLFLAGS) $($*-DLLTOOLFLAGS) --dllname $*.dll --def $*.def --output-lib lib$*.a
6994 pd 144
 
9372 ripley 145
%.a:
21638 ripley 146
#	@$(ECHO) -------- Building $@ from $^ --------
147
	$(AR) cr $@ $^
148
	$(RANLIB) $@
4394 ripley 149
 
15534 ripley 150
%.o: %.rc
9058 ripley 151
	$(RESCOMP) $(RESFLAGS) $($*-RESFLAGS) -i $< -o $@