-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathplatform_specific.mk.intel-mac
146 lines (130 loc) · 4.02 KB
/
platform_specific.mk.intel-mac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#
# platform_specific.mk.intel-mac
#
# This file is included in other Makefiles and defines platform specific macros.
# Should not contain any relative directories (other than .) since these Makefiles
# exist at various levels in the directory tree.
# Extended regular expressions flag for sed (used with cleaning up run_tests results)
SED_EXTREGEX_FLAG = -E
# If READLINE_LIBDIR is given, -I$(READLINE_LIBDIR)/../include must be the first
# include flag (other than .) so the correct readline include files are used.
ifneq ($(strip $(READLINE_LIBDIR)),)
MYINCLUDES = -I. \
-I$(READLINE_LIBDIR)/../include \
-I$(NETCDF_LIBDIR)/../include \
-I$(DIR_PREFIX)/fer/common \
-I$(DIR_PREFIX)/fmt/cmn \
-I$(DIR_PREFIX)/ppl/tmap_inc \
-I$(DIR_PREFIX)/ppl/include \
-I/opt/X11/include \
-I$(DIR_PREFIX)/xgks/src/lib \
-I$(DIR_PREFIX)/xgks/port
else
MYINCLUDES = -I. \
-I$(NETCDF_LIBDIR)/../include \
-I$(DIR_PREFIX)/fer/common \
-I$(DIR_PREFIX)/fmt/cmn \
-I$(DIR_PREFIX)/ppl/tmap_inc \
-I$(DIR_PREFIX)/ppl/include \
-I/opt/X11/include \
-I$(DIR_PREFIX)/xgks/src/lib \
-I$(DIR_PREFIX)/xgks/port
endif
MYDEFINES = -Dcrptd_cat_argument \
-Ddouble_p \
-Dgfortran \
-Dreclen_in_bytes \
-Dunix \
-Dxgks \
-DG77 \
-DG77_SIGNAL \
-DINTERNAL_READ_FORMAT_BUG \
-DMANDATORY_FORMAT_WIDTHS \
-DNEED_IAND \
-DNO_DOUBLE_ESCAPE_SLASH \
-DNO_OPEN_CARRIAGECONTROL \
-DNO_OPEN_SHARED \
-DNO_OPEN_READONLY \
-DNO_OPEN_RECORDTYPE \
-DNO_PASSED_CONCAT \
-DNO_PREPEND_STRING \
-DSTAR_1_SUPPORTED \
-DX_REFRESH
PLATFORM = $(shell uname -s -r)
AR = $(shell which ar)
RANLIB = $(shell which ranlib)
ARFLAGS = -cr
# Flags for compiling all C code
CFLAGS = -fPIC $(MYDEFINES) $(MYINCLUDES)
# Flags for compiling the PlotPlus FORTRAN code (ppl subdirectory)
PPLUS_FFLAGS = -fPIC \
-fno-automatic \
-fno-second-underscore \
-fdollar-ok \
-ffixed-line-length-132 \
$(MYDEFINES) $(MYINCLUDES)
# Flags for compiling non-PlotPlus FORTRAN code
FFLAGS = -fPIC \
-fno-automatic \
-fno-second-underscore \
-fdollar-ok \
-ffixed-line-length-132 \
-ffpe-trap=overflow \
-fimplicit-none \
-fdefault-real-8 \
-fdefault-double-8 \
$(MYDEFINES) $(MYINCLUDES)
OPT_FLAGS = -O -DNDEBUG
PPLUS_OPT_FLAGS = -O0
DBG_FLAGS = -O0 -g
PROF_FLAGS = -O0 -g -pg
# Below this line are macro definitions used only for the final linking of the executable
LD = $(FC)
LDFLAGS = -static-libgfortran -Wl,-export_dynamic -Wl,-headerpad_max_install_names
# If $(READLINE_LIBDIR) is given (and not blank), statically link in the readline
# and history libraries given under that directory; otherwise, just use the usual
# flags to link in the system readline and history libraries.
ifneq ($(strip $(READLINE_LIBDIR)),)
SYSLIB = -L/opt/X11/lib -lX11 \
$(READLINE_LIBDIR)/libreadline.a \
$(READLINE_LIBDIR)/libhistory.a \
-lncurses \
-lcurl \
-ldl \
-lz \
-lm
else
SYSLIB = -L/opt/X11/lib -lX11 \
-lreadline \
-lhistory \
-lcurl \
-ldl \
-lz \
-lm
endif
# NetCDF4: either shared-object libraries (HDF5 and compression library
# requirements recorded in NetCDF libraries) or static libraries (HDF5
# and compression library requirements need to be specified).
ifeq ($(strip $(HDF5_LIBDIR)),)
CDFLIB = -L$(NETCDF_LIBDIR) \
-lnetcdff \
-lnetcdf
else ifeq ($(strip $(SZ_LIBDIR)),)
CDFLIB = $(NETCDF_LIBDIR)/libnetcdff.a \
$(NETCDF_LIBDIR)/libnetcdf.a \
$(HDF5_LIBDIR)/libhdf5_hl.a \
$(HDF5_LIBDIR)/libhdf5.a
else
CDFLIB = $(NETCDF_LIBDIR)/libnetcdff.a \
$(NETCDF_LIBDIR)/libnetcdf.a \
$(HDF5_LIBDIR)/libhdf5_hl.a \
$(HDF5_LIBDIR)/libhdf5.a \
$(SZ_LIBDIR)/libsz.a
endif
# Directly compile the .F source files to the .o object files
# since gfortran can handle the C compiler directives in Fortran code
%.o : %.F
$(FC) $(FFLAGS) -c $*.F -o $*.o
#
# End of platform_specific.mk.intel-mac
#