Statistics
| Revision:

root / tmp / org.txm.statsengine.r.core.win32 / res / win32 / etc / i386 / Makeconf @ 2486

History | View | Annotate | Download (6 kB)

1
#-*- Makefile -*-
2
# $(R_HOME}/etc$(R_ARCH)/Makeconf
3

    
4
# Hand-edited version for gnuwin32.
5

    
6
ifdef DEBUG
7
  DLLFLAGS=
8
  DEBUGFLAG=-gdwarf-2
9
else
10
  DLLFLAGS=-s
11
  DEBUGFLAG=
12
endif
13

    
14
DLLFLAGS+= -static-libgcc
15
LINKFLAGS+= -static-libgcc
16

    
17
## Things which are substituted by fixed/Makefile (and also -O3 -> -O2)
18
WIN = 32
19
BINPREF = 
20
# SYMPAT = 's/^.* [BCDRT] _/ /p' for 32-bit
21
# SYMPAT = 's/^.* [BCDRT] / /p' for 64-bit
22
SYMPAT = 's/^.* [BCDRT] _/ /p'
23
IMPDIR = bin/i386
24
# flags for multilib builds, for compilers, dlltool and windres
25
M_ARCH = -m32
26
DT_ARCH = -m i386 --as-flags --32
27
RC_ARCH = -F pe-i386
28
# Used by packages tcltk and tkrplot
29
TCL_HOME = $(R_HOME)/Tcl
30
LOCAL_SOFT = d:/RCompile/CRANpkg/extralibs64/local
31

    
32
ifneq ($(strip $(LOCAL_SOFT)),)
33
LOCAL_CPPFLAGS = -I"$(LOCAL_SOFT)/include"
34
LOCAL_LIBS = -L"$(LOCAL_SOFT)/lib$(R_ARCH)" -L"$(LOCAL_SOFT)/lib"
35
endif
36

    
37
DLLTOOL = $(BINPREF)dlltool --as $(BINPREF)as $(DT_ARCH)
38
DLLTOOLFLAGS = -k
39
NM = $(BINPREF)nm
40
RESCOMP = $(BINPREF)windres $(RC_ARCH)
41
## MAIN_LD needs to be set by the package
42
LINKER = $(MAIN_LD)
43
## as a default
44
DLL = $(CC)
45

    
46
## Things defined in Renviron on Unix
47
SED = sed
48
TAR = tar
49

    
50
## Things defined in MkRules
51
CAT = cat
52
CP = cp
53
MKDIR = mkdir
54
RM = rm -f
55
SORT = sort
56

    
57
## For use in packages
58
GRAPHAPP_LIB = -lRgraphapp
59
TCL_VERSION = 85
60
ZLIB_LIBS = -lRzlib
61

    
62
AR = $(BINPREF)ar
63
## Used by packages 'maps' and 'mapdata'
64
AWK = gawk
65
BLAS_LIBS = -L"$(R_HOME)/$(IMPDIR)" -lRblas
66
C_VISIBILITY = 
67
CC = $(BINPREF)gcc $(M_ARCH)
68
CFLAGS = -O3 -Wall $(DEBUGFLAG) -std=gnu99 -mtune=core2
69
CPICFLAGS = 
70
CPPFLAGS =
71
CXX = $(BINPREF)g++ $(M_ARCH)
72
CXXCPP = $(CXX) -E
73
CXXFLAGS = -O2 -Wall $(DEBUGFLAG) -mtune=core2
74
CXXPICFLAGS = 
75
CXX1X = $(BINPREF)g++ $(M_ARCH)
76
CXX1XFLAGS = -O2 -Wall $(DEBUGFLAG) -mtune=core2
77
CXX1XPICFLAGS =
78
CXX1XSTD = -std=c++0x
79
DYLIB_EXT = .dll
80
DYLIB_LD = $(DLL)
81
DYLIB_LDFLAGS = -shared
82
DYLIB_LINK = $(DYLIB_LD) $(DYLIB_LDFLAGS) $(LDFLAGS)
83
ECHO = echo
84
ECHO_C = 
85
ECHO_N = -n
86
ECHO_T = 
87
FC = $(BINPREF)gfortran $(M_ARCH)
88
FCFLAGS = -O3 $(DEBUGFLAG) -mtune=core2
89
# additional libs needed when linking with $(FC), e.g. on Solaris
90
FCLIBS =
91
F77 = $(BINPREF)gfortran $(M_ARCH)
92
F77_VISIBILITY = 
93
FFLAGS = -O3 $(DEBUGFLAG) -mtune=core2
94
FLIBS = -lgfortran
95
FCPICFLAGS =
96
FPICFLAGS = 
97
FOUNDATION_CPPFLAGS =
98
FOUNDATION_LIBS =
99
JAR =
100
JAVA =
101
JAVAC = 
102
JAVAH =
103
# JAVA_HOME = 
104
# JAVA_LD_LIBRARY_PATH = 
105
JAVA_LIBS = -L"$(JAVA_HOME)/bin/client" -ljvm -ljvm-w32
106
JAVA_CPPFLAGS = -I"$(JAVA_HOME)/../include" -I"$(JAVA_HOME)/../include/win32"
107
LAPACK_LIBS = -L"$(R_HOME)/$(IMPDIR)" -lRlapack
108
## we only need this is if it is external, as otherwise link to R
109
LIBINTL=
110
LIBM = -lm
111
LIBR = -L"$(R_HOME)/$(IMPDIR)" -lR
112
LIBS =  -lm
113
## needed by R CMD config
114
LIBnn = lib
115
LIBTOOL =
116
LDFLAGS =
117
## needed to build applications linking to static libR
118
# MAIN_LD =
119
# MAIN_LDFLAGS =
120
# MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LDFLAGS)
121
# don't have this: would 'mkdir -p' do?
122
# MKINSTALLDIRS = $(R_HOME)/bin/mkinstalldirs
123
## There is no ObjC support in the recommended toolchain,
124
## but if a toolchain had support, this it what it would be.
125
OBJC = $(CC)
126
OBJCFLAGS = -O2
127
OBJC_LIBS = -lobjc
128
OBJCXX =
129
R_ARCH = /i386
130
RANLIB = $(BINPREF)ranlib
131
SAFE_FFLAGS = -O3 -ffloat-store
132
SED = sed
133
## it seems some makes (but not ours) get upset if SHELL is set.
134
# SHELL = /bin/sh
135
SHLIB_CFLAGS = 
136
SHLIB_CXXFLAGS = 
137
SHLIB_CXXLD = $(CXX)
138
## ideally -shared -static-libstdc++, but not for gcc 4.2.1
139
SHLIB_CXXLDFLAGS = -shared
140
SHLIB_CXX1XLD = $(CXX1X)
141
SHLIB_CXX1XLDFLAGS = -shared
142
SHLIB_EXT = .dll
143
SHLIB_FCLD = $(FC)
144
## ideally -shared -static-libgfortran, but not for gcc 4.2.1
145
SHLIB_FCLDFLAGS = -shared
146
SHLIB_FFLAGS = 
147
SHLIB_LD = $(CC)
148
SHLIB_LDFLAGS = -shared
149
SHLIB_LIBADD =
150
SHLIB_LINK = $(SHLIB_LD) -Wl,--export-all-symbols $(SHLIB_LDFLAGS) $(LDFLAGS)
151
SHLIB_OPENMP_CFLAGS = -fopenmp
152
SHLIB_OPENMP_CXXFLAGS = -fopenmp
153
SHLIB_OPENMP_FCFLAGS = -fopenmp
154
SHLIB_OPENMP_FFLAGS = -fopenmp
155
SHLIB_PTHREAD_FLAGS = -pthread
156
STRIP_LIBS = $(BINPREF)strip --strip-unneeded
157
STRIP_STATIC_LIBS = $(BINPREF)strip --strip-debug
158
TCLTK_CPPFLAGS = -I "$(TCL_HOME)/include" -DWin32
159
TCLTK_LIBS = -L"$(TCL_HOME)/bin" -ltcl$(TCL_VERSION) -ltk$(TCL_VERSION)
160

    
161
STATIC_LIBR =
162

    
163
R_XTRA_CFLAGS =
164
R_XTRA_CPPFLAGS = -I"$(R_HOME)/include" -DNDEBUG
165
R_XTRA_CXXFLAGS = 
166
R_XTRA_FFLAGS = 
167

    
168
ALL_CFLAGS = $(R_XTRA_CFLAGS) $(PKG_CFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(CFLAGS)
169
ALL_CPPFLAGS = $(R_XTRA_CPPFLAGS) $(PKG_CPPFLAGS) $(CPPFLAGS) $($*-CPPFLAGS) $(CLINK_CPPFLAGS) $(LOCAL_CPPFLAGS)
170
ALL_CXXFLAGS = $(R_XTRA_CXXFLAGS) $(PKG_CXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(CXXFLAGS)
171
ALL_OBJCFLAGS = $(PKG_OBJCFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(OBJCFLAGS)
172
ALL_OBJCXXFLAGS = $(PKG_OBJCXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(OBJCXXFLAGS)
173
ALL_FFLAGS = $(R_XTRA_FFLAGS) $(PKG_FFLAGS) $(FPICFLAGS) $(SHLIB_FFLAGS) $(FFLAGS)
174
ALL_LIBS = $(PKG_LIBS) $(LOCAL_LIBS) $(SHLIB_LIBADD) $(LIBR) $(LIBINTL)
175

    
176
.SUFFIXES:
177
.SUFFIXES: .c .cc .cpp .d .f .f90 .f95 .m .mm .M .o .a .def .dll .exe .rc
178

    
179
.c.o:
180
	$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c $< -o $@
181
.c.d:
182
	@echo "making $@ from $<"
183
	@$(CC) -std=gnu99 -MM $(ALL_CPPFLAGS) $< > $@
184
.cc.o:
185
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@
186
.cpp.o:
187
	$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@
188
.cc.d:
189
	@echo "making $@ from $<"
190
	@$(CXX) -M $(ALL_CPPFLAGS) $< > $@
191
.cpp.d:
192
	@echo "making $@ from $<"
193
	@$(CXX) -M $(ALL_CPPFLAGS) $< > $@
194
.m.o:
195
	$(OBJC) $(ALL_CPPFLAGS) $(ALL_OBJCFLAGS) -c $< -o $@
196
.m.d:
197
	@echo "making $@ from $<"
198
	@$(OBJC) -MM $(ALL_CPPFLAGS) $< > $@
199
.mm.o:
200
	$(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $@
201
.M.o:
202
	$(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $@
203
.f.o:
204
	$(F77) $(ALL_FFLAGS) -c $< -o $@
205
.f95.o:
206
	$(FC) $(PKG_FCFLAGS) $(FCPICFLAGS) $(FCFLAGS) -c  $< -o $@
207
.f90.o:
208
	$(FC) $(PKG_FCFLAGS) $(FCPICFLAGS) $(FCFLAGS) -c  $< -o $@
209

    
210
%.exe:
211
	$(LINKER) $(LINKFLAGS) $($*-LINKFLAGS) -o $@ $^ $($*-LIBS) $(LOCAL_LIBS) $(LIBS)
212

    
213
%.dll:
214
	@echo EXPORTS > $*.def
215
	@$(NM) $^ | $(SED) -n $(SYMPAT) >> $*.def
216
	$(SHLIB_LD) -shared $(DLLFLAGS) -o $@ $*.def $^ $(ALL_LIBS)
217
	@$(RM) $*.def
218

    
219
lib%.dll.a: %.def
220
	$(DLLTOOL) $(DLLTOOLFLAGS) $($*-DLLTOOLFLAGS) --dllname $*.dll --input-def $*.def --output-lib $@
221

    
222
%.a:
223
	@$(RM) $@
224
	$(AR) crs $@ $^
225

    
226
%.o: %.rc
227
	$(RESCOMP) $(RESFLAGS) -i $< -o $@