forked from teuben/nemo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makedefs.in
236 lines (177 loc) · 6.51 KB
/
makedefs.in
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# -*- makefile -*-
# ONLY EDIT THIS FILE IF IT'S $NEMOLIB/makedefs
# diff $NEMO/makedefs $NEMOLIB
# ((the one in $NEMO is the configure generated one that gets copied))
# ((to $NEMOLIB via the "make config_extra" command during the))
# (("make postconfig" step of the install))
# DSO linking: might need to wrap offending libraries
# -Wl,--no-as-needed -lX11 -Wl,-as-needed
# instead of
# -lX11
# Another option is to add -Wl,--no-as-needed to CFLAGS
# This is the current default in configure (to use it)
# Comment the next line if you do not want this, or use --without-dso
NEMO_CFLAGS1 = @DSO_LINK@
# we could actually also define a set of NEMO, and derived, variables, such that the build
# system does not need to source nemo_start
# NEMO = @NEMO@
# NEMOLIB = $(NEMO)/lib
# NEMOBIN = $(NEMO)/bin
# NEMOOBJ = $(NEMO)/obj
# NEMOINC = $(NEMO)/inc
# handy for recursion
@SET_MAKE@
# Compilers:
CC = @CC@
FC = @F77@
F77 = @F77@
CXX = @CXX@
# HDF library
# common examples:
#HDF_INC=-I/local/include -I/usr/local/include -I/usr/include/hdf
#
# Might need to add something like: -L/local/lib -R /local/lib
# if your solaris system requires that
#HDF_LIB=-ldf -ljpeg -lz -lsz
HDF_INC = @HDF_INC@
HDF_LIB = @HDF_LIB@
# PVM library
PVM_INC = @PVM_INC@
PVM_LIB = @PVM_LIB@
# PNG library
PNG_LIB = @PNG_LIB@
# CFITSIO library
CFITSIO_INC = @CFITSIO_INC@
CFITSIO_LIB = @CFITSIO_LIB@
# MIRIAD library
# (could also depend on $(MIR) and $(MIRLIB) if you don't like these)
MIRIAD_INC = @MIRIAD_INC@
MIRIAD_LIB = @MIRIAD_LIB@
# GSL
GSL_CFLAGS = @GSL_CFLAGS@
GSL_LIBS = @GSL_LIBS@
# FFTW
# -lfftw3, or -lfftw3f or -lfftw3l (depending on precision library, for float or long double)
# [actually still not used yet]
FFTW_CFLAGS = @FFTW_CFLAGS@
FFTW_LIBS = @FFTW_LIBS@
# READLINE
RDL_LIBS = @RDL_LIBS@
# LOADOBJ stuff; -DMACH=.....
MACH = @LOADOBJ_MACH@
# Fortran: you need FLIBS if you link using 'cc' and link
# with (certain) fortran. See also F77_FUNC macros (config.h)
# if you need to use fortran names from your C code, or if you
# need to define C code that is to be called from Fortran
# F77_CMAIN_FFLAGS is needed if you link with fortran, but main is in C
# on older MacOS you need to remove any -lcrt1.o and -lcrt2.o (or the like) references
FLIBS = @FLIBS@
FORLIBS = $(FLIBS)
F77_CMAIN_FFLAGS = @F77_CMAIN_FFLAGS@
# YAPPLIB: was removed from NEMORC.{gen,local}
# sometimes (for native cc/f77 compiler on solaris) you need to append $(FLIBS) here
# since FLIBS isn't computed properly
# Note for some PGPLOT devices (e.g. PNDRIV) you will need to add -lpng)
# for PLPLOT a choice between -lplplotd and -lplplotf needs to be consistent with
# the definition triggered for pl_real in yapp_plplot.c !! this is not automated yet
# via configure.
YAPPLIB = $(NEMOLIB)/yapp_@[email protected] @YAPP_LIBS@
# Solaris 2.6+: -R /opt/SUNWspro/lib -L/opt/SUNWspro/lib -lF77 -lM77 -lV77 -lsunmath
## C compiler:
#set opts="-rdynamic -ansi -fwritable-strings -Wconversion -Wnested-externs"
#exec gcc -fPIC -Dlinux -DSYSV -I$NEMOINC -I$NEMOLIB -L$NEMOLIB $opts $* $link
## Fortran compiler
# some older gnu compilers may still need -fno-globals
NEMO_CFLAGS = @NEMO_CFLAGS@ -I$(NEMOINC) -I$(NEMOLIB) @XINCS@ $(GSL_CFLAGS) $(MACH) $(NEMO_CFLAGS1)
NEMO_FFLAGS = @NEMO_FFLAGS@
NEMO_LDFLAGS =
NEMO_LIBS = -L$(NEMOLIB) -lnemo @LOADOBJ_LIBS@ $(GSL_LIBS) $(RDL_LIBS) $(CFITSIO_LIB) @MATH_LIBS@ @MACOS_LIBS@
NEMO_LIBSPP = -L$(NEMOLIB) -lnemo++ -lnemo @LOADOBJ_LIBS@ $(GSL_LIBS) $(RDL_LIBS) $(CFITSIO_LIB) @MATH_LIBS@ @MACOS_LIBS@
# some graphics libraries:
GLLIBS = @GLLIBS@
XLIBS = @XLIBS@
# generic compile flags for C,Fortran,Linker
# If you must absolutely be pedantic, the following gnu compiler flags are the recommended ones
# (see GSL users guide - appendix A)
# PEDFLAG="-ansi -pedantic -Werror -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wtraditional -Wconversion -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wnested-externs -fshort-enums -fno-common -Dinline= -g -O4"
# optimization only
OPT = @CFLAGS@
FOPT = @FFLAGS@
LOPT = @LDFLAGS@
# for shared libaries
CCSHARED = @CCSHARED@
# everything
CFLAGS = $(OPT) $(CCSHARED) $(NEMO_CFLAGS)
FFLAGS = $(OPT) $(CCSHARED) $(NEMO_FFLAGS)
LDFLAGS = $(OPT) $(NEMO_LDFLAGS)
CPPFLAGS = @CPPFLAGS@
RANLIB = @RANLIB@
# -----------------------------------------------------------------------------
# rules
.SUFFIXES: .so .doc
# NEMO compile rules
.o.a:
@echo "***Skipping ar for $* at this stage"
.c.o:
$(CC) $(CFLAGS) $(LOCAL_INC) -c $<
.cc.o:
$(CXX) $(CFLAGS) $(LOCAL_INC) -c $<
.c.so:
$(CC) $(CFLAGS) $(LOCAL_INC) -c $<
ldso $*
.cc.so:
$(CXX) $(CFLAGS) $(LOCAL_INC) -c $<
ldso $*
.f.so:
$(FC) $(FFLAGS) -c $<
ldso $*
.c.a:
$(CC) $(CFLAGS) $(LOCAL_INC) -c $<
.c:
$(CC) $(CFLAGS) $(LOCAL_INC) -o $* $*.c $(NEMO_LIBS) $(LOCAL_LIB) $(FORLIBS) $(EL)
.cc:
$(CXX) $(CFLAGS) $(LOCAL_INC) -o $* $*.c $(NEMO_LIBSPP) $(LOCAL_LIB) $(FORLIBS) $(EL)
.o:
$(CC) $(CFLAGS) $(LOCAL_INC) -o $* $*.o $(NEMO_LIBS) $(LOCAL_LIB) $(FORLIBS) $(EL)
# -----------------------------------------------------------------------------
# some fortran code needs a REAL FUNCTIONS SECOND (e.g. scfm)
# this macro should point to the .o file (if needed)
# Sometimes it is FORLIBS, sometimes your etime.o or second.o
# On Solaris you need second.o; Linux can keep it blank (it's in libg2c)
# SECOND = $(NEMOLIB)/second.o
# xxxTYPE's: falcON now uses PLATFORM := $(shell uname -m)
PLATFORM := $(shell uname -m)
makedefs_help:
@echo ========================================================================
@echo NEMOVER=$(NEMOVER)
@echo CC=$(CC)
@echo CFLAGS=$(CFLAGS)
@echo CPP=$(CPP)
@echo CPPFLAGS=$(CPPFLAGS)
@echo CXX=$(CXX)
@echo CXXFLAGS=$(CXXFLAGS)
@echo F77=$(F77)
@echo FFLAGS=$(FFLAGS)
@echo DEFS=$(DEFS)
@echo CFLAGS=$(CFLAGS)
@echo FFLAGS=$(FFLAGS)
@echo LDFLAGS=$(LDFLAGS)
@echo FC=$(F77)
@echo LN_S=$(LN_S)
@echo GLLIBS=$(GLLIBS)
@echo XLIBS=$(XLIBS)
@echo LIBS=@LIBS@
@echo RANLIB=$(RANLIB)
@echo YAPPLIB=$(YAPPLIB)
@echo PLATFORM=$(PLATFORM)
@echo HOSTTYPE=$(HOSTTYPE)
@echo MACHTYPE=$(MACHTYPE)
@echo OSTYPE=$(OSTYPE)
@echo ========================================================================
# this peculiar include will include a file LocalMakedefs in the local/current
# directory only if it is present, but not complain if not present. This is
# the recommended way to tailor a particular directory, e.g. for debugging
# you could add something like
# NEMO_CFLAGS += -Wall -W -g
#
-include LocalMakedefs