The R Project SVN R

Rev

Rev 27883 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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