The R Project SVN R

Rev

Rev 47666 | Rev 47698 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 47666 Rev 47689
Line 1... Line 1...
1
#-*- Makefile -*-
1
#-*- Makefile -*-
2
## This files contains tabs: make sure your editor leaves them unchanged.
2
## This files contains tabs: make sure your editor leaves them unchanged.
3
 
3
 
4
## ===== configuration macros for building packages or R  ===============
4
## ===== configuration macros for building packages or R  ===============
5
 
5
 
6
# Alternatives GCC4 (MinGW gcc4) or CROSS (e.g. Linux)
-
 
7
# or F2C (use suitable f2c rather than a Fortran compiler).
6
# Alternatives GCC4 or F2C (use suitable f2c rather than a Fortran compiler).
8
 
7
 
9
BUILD=GCC4
8
BUILD=GCC4
10
 
9
 
11
# an alternative is to use -gstabs here, if the debugger supports only stabs.
10
# an alternative is to use -gstabs here, if the debugger supports only stabs.
12
G_FLAG=-gdwarf-2
11
G_FLAG=-gdwarf-2
Line 75... Line 74...
75
# needs to be set by user
74
# needs to be set by user
76
FC=
75
FC=
77
endif
76
endif
78
FCFLAGS=-O3
77
FCFLAGS=-O3
79
 
78
 
80
## =================== cross-compilation settings  =================
-
 
81
 
-
 
82
ifeq ($(strip $(BUILD)),CROSS)
-
 
83
# Next might be i586-mingw32- or x86_64-pc-mingw32- or ...
-
 
84
# depending on the cross-compiler.
-
 
85
ifeq ($(strip $(WIN)),64)
-
 
86
BINPREF=x86_64-pc-mingw32-
-
 
87
else
-
 
88
BINPREF=i386-mingw32-
-
 
89
endif
-
 
90
# Optional, if compiler has been relocated
-
 
91
# Set this to full path to dir where the mingw32 include files are.
-
 
92
# It should contain fcntl.h and windows.h
-
 
93
HEADER=
-
 
94
# path (possibly full path) to same version of R on the host system
-
 
95
R_EXE='I failed to read the instructions to set R_EXE in MkRules'
-
 
96
 
-
 
97
## SHLIB extension on host: 'so' or 'dll'
-
 
98
CROSS_EXT=so
-
 
99
endif
-
 
100
 
-
 
101
## =============== end of user-customizable parts  ===================
79
## =============== end of user-customizable parts  ===================
102
 
80
 
103
DEPARG=-MM
81
DEPARG=-MM
104
MINGW32LDFLAG=
82
MINGW32LDFLAG=
105
C99FLAG=-std=gnu99
83
C99FLAG=-std=gnu99
Line 115... Line 93...
115
## earlier Rtools needs -sjlj
93
## earlier Rtools needs -sjlj
116
## an alternative is -dw2, which currently fails building R.
94
## an alternative is -dw2, which currently fails building R.
117
GCC4_SUFF=
95
GCC4_SUFF=
118
endif
96
endif
119
 
97
 
120
ifeq ($(strip $(BUILD)),CROSS)
-
 
121
ifneq ($(strip $(HEADER)),)
-
 
122
MINGW32CFLAG=-isystem $(HEADER)
-
 
123
endif
-
 
124
F77=$(BINPREF)gfortran
-
 
125
FLIBS=-lgfortran
-
 
126
AWK=awk
-
 
127
endif
-
 
128
 
-
 
129
ifeq ($(strip $(BUILD)),F2C)
98
ifeq ($(strip $(BUILD)),F2C)
130
BINPREF=
99
BINPREF=
131
MINGW32CFLAG=
100
MINGW32CFLAG=
132
F77=sh $(RHOME)/src/scripts/f77_f2c
101
F77=sh $(RHOME)/src/scripts/f77_f2c
133
FLIBS=-lf2c
102
FLIBS=-lf2c
Line 237... Line 206...
237
%.a:
206
%.a:
238
#	@$(ECHO) -------- Building $@ from $^ --------
207
#	@$(ECHO) -------- Building $@ from $^ --------
239
	@$(RM) $@
208
	@$(RM) $@
240
	$(AR) crs $@ $^
209
	$(AR) crs $@ $^
241
 
210
 
242
ifeq ($(strip $(BUILD)),CROSS)
-
 
243
%.o: %.rc
-
 
244
	$(RESCOMP) $(RESFLAGS) $($*-RESFLAGS) -I $(HEADER) -i $< -o $@
-
 
245
else
-
 
246
%.o: %.rc
211
%.o: %.rc
247
	$(RESCOMP) $(RESFLAGS) $($*-RESFLAGS) -i $< -o $@
212
	$(RESCOMP) $(RESFLAGS) $($*-RESFLAGS) -i $< -o $@
248
endif
-
 
249
 
213
 
250
.f90.o:
214
.f90.o:
251
	"$(FC)" $(PKG_FCFLAGS) $(FCFLAGS) -c $< -o $@
215
	"$(FC)" $(PKG_FCFLAGS) $(FCFLAGS) -c $< -o $@
252
.f95.o:
216
.f95.o:
253
	"$(FC)" $(PKG_FCFLAGS) $(FCFLAGS) -c $< -o $@
217
	"$(FC)" $(PKG_FCFLAGS) $(FCFLAGS) -c $< -o $@