ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/make_basic.mk
(Generate patch)

Comparing make_basic.mk (file contents):
Revision 1.45 by arta, Tue Apr 21 04:27:52 2009 UTC vs.
Revision 1.46 by arta, Fri Jun 5 21:03:51 2009 UTC

# Line 5 | Line 5 | DBNAME = POSTGRESQL
5   # This optional file has custom definitions created by the configure script
6   -include $(SRCDIR)/custom.mk
7  
8 < PGIPATH = /usr/include/pgsql    
8 > PGIPATH = /usr/include/pgsql
9  
10 + _JSOCROOT_ = ..
11 +
12 + #***********************************************************************************************#
13 + #
14 + # COMPILER SELECTION
15 + #
16   COMPILER = icc
17 < F77 = ifort
17 > FCOMPILER = ifort
18  
19 < ifeq ($(JSOC_MACHINE), mac_osx_ppc)
20 < COMPILER = gcc
15 < F77 = f77
19 > ifneq ($(AUTOCOMPILER),)
20 > COMPILER = $(AUTOCOMPILER)
21   endif
22 < ifeq ($(JSOC_MACHINE), mac_osx_ia32)
23 < COMPILER = gcc
24 < F77 = f77
22 >
23 > ifneq ($(AUTOFCOMPILER),)
24 > FCOMPILER = $(AUTOFCOMPILER)
25 > endif
26 >
27 > # can set through custom.mk or through environment
28 > ifneq ($(CUSTOM_COMPILER),)
29 > COMPILER = $(CUSTOM_COMPILER)
30   endif
31  
32 + ifneq ($(CUSTOM_FCOMPILER),)
33 + FCOMPILER = $(CUSTOM_FCOMPILER)
34 + endif
35 + #***********************************************************************************************#
36 +
37 +
38 + #***********************************************************************************************#
39 + #
40 + # DEBUGGING
41 + #
42   # Check for debug vs. release build - release is default.
43   #   To do a debug build, either set the environment variable JSOC_DEBUG to 1, OR
44   #   modify the following line so that DEBUG = 1.  The environment variable takes precedence.
45 + #
46   DEBUG = 0
47  
48   ifdef JSOC_DEBUG
# Line 31 | Line 52 | else
52   DEBUG = 0
53   endif
54   endif
55 + #***********************************************************************************************#
56  
57 +
58 + #***********************************************************************************************#
59 + #
60 + # WARNINGS
61 + #
62   # No warnings are displayed, by default, for a release build.
63 + #
64   WARN = 0
65  
66   # Builder can request warnings via environment variable (setenv JSOC_WARN 1).
# Line 49 | Line 77 | endif
77   ifeq ($(DEBUG), 1)
78   WARN = 1
79   endif
80 + #***********************************************************************************************#
81  
53 _JSOCROOT_ = ..
54
55 # if fortran compiler
56 D_GCC_FORT =
57 ifeq ($(F77), ifort)
58  D_GCC_FORT = -DINTEL_FORTRAN
59 endif
60
61 ifeq ($(JSOC_MACHINE), linux_x86_64)
62  ifeq ($(F77), ifort)
63    F77 = ifort -mcmodel=medium
64  endif
65 endif
82  
83   #***********************************************************************************************#
84   #
85 + # THIRD-PARTY LIBRARIES
86 + #
87   # This section contains make variables that hold the paths to and names of third-party libraries.
88   # Variables that end in 'H' contain the -I link flags that contain the include paths
89   # for the library headers, variables that end in 'L' contain the -L link flags that
# Line 127 | Line 145 | GSLLIBS = $(GSLL) -lgsl -lgslcblas
145   #***********************************************************************************************#
146  
147  
148 + #***********************************************************************************************#
149 + #
150 + # CUSTOM BUILDS
151 + #
152   # Compilation define customizations (eg., for remote DRMS builds)
153   CUSTOMSW =
154   ifneq ($(DRMS_DEFAULT_RETENTION),)
# Line 138 | Line 160 | ifneq ($(CUSTOM_DEFINES),)
160   CUSTOMSW := $(CUSTOMSW) -D$(CUSTOM_DEFINES)
161   endif
162  
141 ### Build flags for all targets
163   #
164 < LL_ALL          = $(SYSLIBS)
144 <
145 < GCC_LF_ALL      = $(STATIC) -g
146 < ifeq ($(JSOC_MACHINE), linux_ia64)
147 <  ICC_LF_ALL    = $(STATIC)
148 < else
149 <  ICC_LF_ALL    = $(STATIC) -xW
150 < endif
164 > #***********************************************************************************************#
165  
152 GCC_CF_GCCCOMP  = -DGCCCOMP $(D_GCC_FORT)
153 ICC_CF_ICCCOMP  = -DICCCOMP $(D_GCC_FORT)
166  
167 + #***********************************************************************************************#
168 + #
169 + # WARNINGS
170 + #
171   # Disable several warnings/remarks when compiling with icc - icc's Wall is a bit picky, it
172   # complains about extern declarations in .c files.
173   #   1418 (remark) - external function definition with no prior declaration
# Line 163 | Line 179 | ifeq ($(WARN), 1)
179   # Show warnings (always true for a debug build).
180   ICC_WARN = -Winline -Wall -wd1418 -wd1419 -wd310 -wd279 -wd981 -Wno-comment
181   GCC_WARN = -Winline -Wall -Wno-comment
182 < F77_WARN =
182 > FCOMPILER_WARN =
183   else
184   # Don't show warnings.
185   ICC_WARN = -w0 -vec-report0 -Wno-comment
186   GCC_WARN = -Wno-comment
187 < F77_WARN = -vec-report0
187 > ifeq ($(FCOMPILER), ifort)
188 > FCOMPILER_WARN = -vec-report0
189 > else
190 > FCOMPILER_WARN =
191 > endif
192   endif
193 + #***********************************************************************************************#
194 +
195 +
196 + #***********************************************************************************************#
197 + #
198 + # GLOBAL LINK FLAGS
199 + #
200 + # Link flags for all targets
201 + #
202 + LL_ALL          = $(SYSLIBS)
203 + GCC_LF_ALL      = $(STATIC)
204 + ICC_LF_ALL      = $(STATIC)
205 +
206 + # Fortran global LINK flags
207 + F_LF_ALL        = -nofor_main -no-ipo
208 + #***********************************************************************************************#
209 +
210 + #***********************************************************************************************#
211 + #
212 + # GLOBAL COMPILE FLAGS
213 + #
214 + GCC_CF_GCCCOMP  = -DGCCCOMP
215 + ICC_CF_ICCCOMP  = -DICCCOMP
216  
217   # can't figure out how to get stupid make to do if/else if/else
218   ifeq ($(DEBUG), 0)
219    GCC_CF_ALL    = -I$(SRCDIR)/base/include -std=gnu99 -O2 $(GCC_WARN) $(GCC_CF_GCCCOMP) $(CUSTOMSW)
220 + # -xW tells the icc compiler to optimize for Pentium 4
221    ICC_CF_ALL = -I$(SRCDIR)/base/include -std=c99 -D_GNU_SOURCE -xW $(ICC_WARN) $(ICC_CF_ICCCOMP) $(CUSTOMSW)
222  
223    ifeq ($(JSOC_MACHINE), linux_x86_64)
# Line 189 | Line 233 | ifeq ($(DEBUG), 0)
233    endif
234  
235   else
236 <
236 > # -g tells the icc and gcc compilers to generate full debugging information
237    GCC_CF_ALL = -I$(SRCDIR)/base/include -std=gnu99 -g $(GCC_WARN) $(GCC_CF_GCCCOMP) $(CUSTOMSW)
238    ICC_CF_ALL = -I$(SRCDIR)/base/include -std=c99 -D_GNU_SOURCE -g $(ICC_WARN) $(ICC_CF_ICCCOMP) $(CUSTOMSW)
239 + endif
240  
241 + # Fortran global COMPILE flags
242 + ifeq ($(JSOC_MACHINE), linux_x86_64)
243 +  ifeq ($(FCOMPILER), ifort)
244 +    F_CF_ALL := -mcmodel=medium
245 +  endif
246   endif
247  
248 < # Fortran global LINK flags
249 < F_LF_ALL        = -nofor_main -no-ipo
248 > # Other compiler-specific Fortran COMPILE flags
249 > ifeq ($(FCOMPILER), ifort)
250 >  ifeq ($(JSOC_MACHINE), linux_x86_64)
251 >    FCFLAGS_OPT := -xW
252 >  endif
253 >  FCLFAGS_INIT := -ftrapuv
254 > else
255 >  # must be gfortran
256 >  FCFLAGS_OPT   := -g
257 >  FCLFAGS_INIT  :=
258 > endif
259  
201 # Fortran global COMPILE flags
260   ifeq ($(DEBUG), 0)
261 < FF_ALL          = -xW -ftrapuv $(F77_WARN)
261 > # -xW optimizes ifort compilation for Pentium 4
262 > # -ftrapuv initializes stack local variables to an unusual value to aid error detection.
263 >  F_CF_ALL      := $(F_CF_ALL) $(FCFLAGS_OPT) $(FCLFAGS_INIT) $(FCOMPILER_WARN)
264   else
265 < FF_ALL          = -ftrapuv $(F77_WARN)
265 >  F_CF_ALL      := $(F_CF_ALL) $(FCLFAGS_INIT) $(FCOMPILER_WARN)
266   endif
267 + #***********************************************************************************************#
268 +
269  
270 < ### Build tools
270 > #***********************************************************************************************#
271 > #
272 > # BUILD TOOLS
273   #
274   # The C compiler named here must output full (header) dependencies in $(@).d.
275   # It may be necessary to create a script similar to ccd-gcc for your compiler.
# Line 236 | Line 300 | else
300    COMPLINK      = $(ICC_COMPLINK)
301   endif
302  
303 < FCOMP           = $(F77) $(FF_ALL) $(FF_TGT) -o $@ -c $<
304 < FLINK           = $(F77) $(F_LF_ALL) $(LF_TGT) -o $@ $^ $(LL_TGT) $(LL_ALL)
303 > FCOMP           = $(FCOMPILER) $(F_CF_ALL) $(FF_TGT) -o $@ -c $<
304 > FLINK           = $(FCOMPILER) $(F_LF_ALL) $(LF_TGT) -o $@ $^ $(LL_TGT) $(LL_ALL)
305  
306   SLBIN           = ln -sf ../../_$(JSOC_MACHINE)/$@ ../bin/$(JSOC_MACHINE)/
307   SLLIB           = ln -sf ../../_$(JSOC_MACHINE)/$@ ../lib/$(JSOC_MACHINE)/
308 + #***********************************************************************************************#
309 +
310  
311 + #***********************************************************************************************#
312 + #
313 + # LIBRARY COLLECTIONS
314 + #
315   ALL_LIBS_FPIC = $(LIBDRMSCLIENT_FPIC) $(LIBDBCLIENT_FPIC) $(LIBCMDPARAMS_FPIC) $(LIBTHREADUTIL_FPIC) $(LIBRICECOMP_FPIC) $(LIBDEFS_FPIC) $(LIBMISC_FPIC) $(LIBDSTRUCT_FPIC) $(LIBTIMEIO_FPIC) $(LIBFITSRW_FPIC)
316  
317   ### Standard parts
# Line 275 | Line 345 | MODLIBS_SOCK = $(LIBJSOC_MAIN_SOCK) $(LI
345  
346   # FMODLIBS: Libraries linked with DRMS Fortran modules
347   FMODLIBS_SOCK = $(LIBJSOC_MAIN_SOCK_F) $(LIBINTHANDLESF) $(LIBDRMSCLIENT) $(LIBDEFSCLIENT) $(LIBDBCLIENT) $(FSRCLIBS)
348 + #***********************************************************************************************#
349 +
350  
351 + #***********************************************************************************************#
352 + #
353 + # PROJECT MAKE RULES
354 + #
355   # Make rules that apply to all projects outside of the base DRMS/SUMS system
356   -include $(SRCDIR)/proj/make_basic.mk
357 + #***********************************************************************************************#
358  
359 +
360 + #***********************************************************************************************#
361 + #
362 + # MODULE TYPES
363 + #
364   # Make rules that apply to all projects, inside and outside of the base DRMS/SUMS system
365   $(CEXE):        %:      %.o $(EXELIBS)
366                  $(LINK)
# Line 320 | Line 402 | $(MODEXE_USEF_SOCK):   LL_TGT := $(LL_TGT)
402   $(MODEXE_USEF_SOCK): %_sock: %.o $(MODLIBS_SOCK)
403                          $(FLINK)
404                          $(SLBIN)
405 + #***********************************************************************************************#

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines