Makefile.am 7.05 KB
Newer Older
Uwe Schulzweida's avatar
Uwe Schulzweida committed
1
2
## Process this file with automake to produce Makefile.in
#
Ralf Mueller's avatar
Ralf Mueller committed
3
EXTRA_DIST = cdilib.c $(top_srcdir)/interfaces/f2003/bindGen.rb
4

5
6
noinst_LTLIBRARIES = libcdiresunpack.la

7
8
9
include_HEADERS =
lib_LTLIBRARIES =

10
if ENABLE_CDI_LIB
11
12
13
14
15
16
  lib_LTLIBRARIES += libcdi.la
  include_HEADERS += cdi.h
# add cdi.inc only if cfortran interface is required
if USE_FC
  include_HEADERS += cdi.inc
endif
17
18
19
if CREATE_ISOC
  lib_LTLIBRARIES += libcdi_f2003.la
endif
20
else
21
  noinst_LTLIBRARIES += libcdi.la
22
23
24
if CREATE_ISOC
  noinst_LTLIBRARIES += libcdi_f2003.la
endif
Uwe Schulzweida's avatar
Uwe Schulzweida committed
25
endif
26

27
AM_CFLAGS = $(PPM_CORE_CFLAGS) $(YAXT_CFLAGS) $(MPI_C_INCLUDE)
28
29

libcdi_la_SOURCES = 	 \
30
31
	async_worker.c   \
	async_worker.h	 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
32
	basetime.c     	 \
33
	basetime.h	 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
34
35
	binary.c	 \
	binary.h	 \
36
37
38
	calendar.c 	 \
	calendar.h	 \
	cdf.c            \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
39
	cdf.h	 	 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
40
	cdf_config.h	 \
41
	cdf_int.c	 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
42
	cdf_int.h	 \
43
44
	cdf_util.c	 \
	cdf_util.h	 \
45
46
47
48
49
50
	cdi.h	 	 \
	cdi_error.c      \
	cdi_limits.h	 \
	cdi_util.c       \
	cgribex.h	 \
	cgribexlib.c  	 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
51
	datetime.h	 \
52
	dmemory.c      	 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
53
	dmemory.h	 \
54
55
	cksum.c		\
	cksum.h		\
56
57
	cdi_cksum.c	\
	cdi_cksum.h	\
58
	cdi_uuid.h	 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
59
	dtypes.h	 \
60
	error.c        	 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
61
	error.h	 	 \
62
	exse.h	 	 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
63
	extra.h	 	 \
64
65
	extralib.c       \
	file.c         	 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
66
	file.h	 	 \
67
68
	gaussgrid.c      \
	gribapi.c  	 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
69
	gribapi.h	 \
70
	gribapi_utilities.h \
71
	grid.c           \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
72
	grid.h	 	 \
73
74
	ieg.h	 	 \
	ieglib.c         \
75
76
	input_file.c	 \
	input_file.h     \
77
	institution.c  	 \
78
	institution.h  	 \
79
	model.c        	 \
80
	model.h        	 \
81
	namespace.c      \
82
	namespace.h      \
83
84
	serialize.h	\
	serialize.c	\
85
86
	referenceCounting.c \
	referenceCounting.h \
87
88
	resource_handle.c\
	resource_handle.h\
89
90
	service.h	 \
	servicelib.c     \
91
92
	stream_cdf_i.c   \
	stream_cdf_o.c   \
93
	stream_cdf_time.c \
94
95
96
97
98
99
100
101
102
103
	stream_cdf.h	 \
	stream_cgribex.c \
	stream_cgribex.h \
	stream_ext.c     \
	stream_ext.h	 \
	stream_grb.c     \
	stream_grb.h     \
	stream_gribapi.h \
	stream_ieg.c     \
	stream_ieg.h	 \
104
105
	cdi_int.c        \
	cdi_int.h	 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
106
	stream_scan.c    \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
107
	stream_scan.h	 \
108
109
110
111
	stream_record.c  \
	stream_srv.c     \
	stream_srv.h	 \
	stream_var.c     \
112
        grb_write.c      \
113
        grb_read.c       \
114
        cdf_write.c      \
115
        cdf_read.c       \
116
117
        cdf_lazy_grid.c  \
        cdf_lazy_grid.h  \
118
119
        subtype.c        \
        subtype.h        \
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
	swap.h	 	 \
	table.c        	 \
	table.h	 	 \
	tablepar.h	 \
	taxis.c          \
	taxis.h	         \
	timebase.c 	 \
	timebase.h	 \
	tsteps.c         \
	util.c         	 \
	varscan.c      	 \
	varscan.h        \
	version.c      	 \
	vlist.c 	 \
	vlist.h	         \
135
136
	cdi_key.c 	 \
	cdi_key.h 	 \
137
138
	cdi_att.c 	 \
	cdi_att.h 	 \
139
	vlist_var.c 	 \
140
	vlist_var.h	 \
141
	zaxis.c		 \
142
	zaxis.h		 \
Thomas Jahns's avatar
Thomas Jahns committed
143
	stream.c         \
144
	stream_write.c   \
145
	stream_read.c    \
146
	swap.c           \
Thomas Jahns's avatar
Thomas Jahns committed
147
148
149
150
151
152
	iterator.c          \
	iterator.h          \
	iterator_fallback.c \
	iterator_fallback.h \
	iterator_grib.c     \
	iterator_grib.h
153

154
155
156
157
158
# cfortran.h is an optional part of libcdi
libcdi_la_USE_FC_extra_sources = \
	cfortran.h       \
	cdiFortran.c

159
# these only contain code if grib_api is available
Thomas Jahns's avatar
Thomas Jahns committed
160
libcdi_la_HAVE_LIBGRIB_API_extra_sources = \
161
	gribapi_utilities.c stream_gribapi.c
Thomas Jahns's avatar
Thomas Jahns committed
162

163
if USE_FC
Thomas Jahns's avatar
Thomas Jahns committed
164
libcdi_la_SOURCES += 	 \
165
166
	$(libcdi_la_USE_FC_extra_sources)
endif
Thomas Jahns's avatar
Thomas Jahns committed
167
168
169
170
171
172

if HAVE_LIBGRIB_API
libcdi_la_SOURCES += 	 \
	$(libcdi_la_HAVE_LIBGRIB_API_extra_sources)
endif

173
EXTRA_DIST += \
Thomas Jahns's avatar
Thomas Jahns committed
174
	$(libcdi_la_USE_FC_extra_sources) \
175
176
	$(libcdi_la_HAVE_LIBGRIB_API_extra_sources) \
	$(libcdipio_la_HAVE_PARALLEL_NC4_extra_sources)
177
178


179

180
libcdi_f2003_la_SOURCES = mo_cdi.f90
181
182
183
libcdi_f2003_ladir = $(includedir)
nodist_libcdi_f2003_la_HEADERS =
if CREATE_ISOC
184
185
186
if FORTRAN_MOD_UC
nodist_libcdi_f2003_la_HEADERS += MO_CDI.$(FCMODEXT)
else
187
188
nodist_libcdi_f2003_la_HEADERS += mo_cdi.$(FCMODEXT)
endif
189
endif
190
191
libcdi_f2003_la_LIBADD = libcdi.la

192
193
194
libcdiresunpack_la_SOURCES = \
	resource_unpack.c

195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
if USE_MPI
if ENABLE_CDI_LIB
lib_LTLIBRARIES += libcdipio.la
include_HEADERS += cdipio.h cdipio.inc
else
noinst_LTLIBRARIES += libcdipio.la
endif
endif

libcdipio_la_SOURCES =							\
	cdipio.h							\
	cdipioFortran.c							\
	cfortran.h							\
	pio.c								\
	pio.h								\
	pio_comm.c							\
	pio_comm.h							\
212
213
	pio_conf.c							\
	pio_conf.h							\
214
	pio_dbuffer.c							\
215
	pio_id_set.h							\
216
217
218
219
	pio_impl.h							\
	pio_interface.c							\
	pio_interface.h							\
	pio_mpinonb.c							\
220
	pio_mpi_fw_ordered.c						\
221
	pio_mpi_fw_at_all.c						\
222
	pio_mpi_fw_at_reblock.c						\
223
224
225
226
227
228
229
230
231
	pio_record_send.c						\
	pio_posixasynch.c						\
	pio_posixfpguardsendrecv.c					\
	pio_posixnonb.c							\
	pio_list_set.c							\
	resource_unpack.h						\
	resource_unpack.c						\
	pio_client.c							\
	pio_client.h							\
232
	pio_roles.c							\
233
	pio_rpc.c							\
234
	pio_rpc.h							\
235
236
237
238
	pio_server.c							\
	pio_server.h							\
	pio_serialize.h							\
	pio_serialize.c							\
239
240
	pio_util.c							\
	pio_util.h							\
241
242
	pio_cdf_int.h

243
244
245
246
247
248
249
250
251
libcdipio_la_HAVE_PARALLEL_NC4_extra_sources =				\
	pio_cdf_int.c

if USE_MPI
if HAVE_PARALLEL_NC4
libcdipio_la_SOURCES += $(libcdipio_la_HAVE_PARALLEL_NC4_extra_sources)
endif
endif

252
libcdipio_la_LIBADD    = libcdi.la $(PPM_CORE_LIBS) $(YAXT_LIBS) $(MPI_C_LIB)
253

Uwe Schulzweida's avatar
Uwe Schulzweida committed
254
#
255
256
#cdilib.c:
#	$(top_srcdir)/src/make_cdilib $(top_srcdir)/src
Uwe Schulzweida's avatar
Uwe Schulzweida committed
257
#
258
259
#cdilib.o: cdilib.c
#	$(COMPILE) -c $<
Uwe Schulzweida's avatar
Uwe Schulzweida committed
260

261
LOCALTARGETS  =
Deike Kleberg's avatar
Deike Kleberg committed
262
263
if ENABLE_CDI_LIB
LOCALTARGETS += pkgconfig/cdi.pc
264
265
266
if USE_MPI
LOCALTARGETS += pkgconfig/cdipio.pc
endif
Uwe Schulzweida's avatar
Uwe Schulzweida committed
267
if CREATE_ISOC
268
LOCALTARGETS += pkgconfig/cdi_f2003.pc
Uwe Schulzweida's avatar
Uwe Schulzweida committed
269
endif
270
271
endif

Uwe Schulzweida's avatar
Uwe Schulzweida committed
272
#
273
274
mo_cdi.f90: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/src/cdi.h $(top_srcdir)/interfaces/f2003/bindGen.rb
	$(AM_V_GEN)$(RUBY) $(top_srcdir)/interfaces/f2003/bindGen.rb $(top_srcdir)/src/cdi.h $@
275
276
277
278

if FORTRAN_MOD_UC
MO_CDI.$(FCMODEXT): mo_cdi.lo
else
279
mo_cdi.$(FCMODEXT): mo_cdi.lo
280
endif
281
	@if test ! -f $@; then rm -f $<; $(MAKE) $<; fi
Uwe Schulzweida's avatar
Uwe Schulzweida committed
282
#
283
284
pkgconfig/cdi.pc: pkgconfig/cdi.pc.in ../config.status
	(cd .. ; ./config.status src/pkgconfig/cdi.pc)
285
286
287

pkgconfig/cdipio.pc: pkgconfig/cdipio.pc.in ../config.status
	(cd .. ; ./config.status src/pkgconfig/cdipio.pc)
288
289
290
291

pkgconfig/cdi_f2003.pc: pkgconfig/cdi_f2003.pc.in ../config.status
	(cd .. ; ./config.status src/pkgconfig/cdi_f2003.pc)

292
293
cdilib.c: 
	(cd $(top_srcdir)/src ; ./make_cdilib )
294
#
295
all-local: $(LOCALTARGETS)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
296
#
297
CLEANFILES  := `ls *~`
298
#CLEANFILES += cdilib.c
Uwe Schulzweida's avatar
Uwe Schulzweida committed
299
if CREATE_ISOC
300
301
302
if FORTRAN_MOD_UC
CLEANFILES += MO_CDI.$(FCMODEXT)
else
303
CLEANFILES += mo_cdi.$(FCMODEXT)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
304
endif
305
endif
306

Deike Kleberg's avatar
Deike Kleberg committed
307
if ENABLE_CDI_LIB
308
PKGCONFIG_FILES = pkgconfig/cdi.pc
Deike Kleberg's avatar
Deike Kleberg committed
309
CLEANFILES += pkgconfig/cdi.pc
310
311
if USE_MPI
PKGCONFIG_FILES += pkgconfig/cdipio.pc
312
313
314
315
316
CLEANFILES += pkgconfig/cdipio.pc
endif
if CREATE_ISOC
PKGCONFIG_FILES += pkgconfig/cdi_f2003.pc
CLEANFILES += pkgconfig/cdi_f2003.pc
317
endif
Deike Kleberg's avatar
Deike Kleberg committed
318

319
install-exec-local: $(PKGCONFIG_FILES)
320
	$(mkinstalldirs) "$(DESTDIR)$(libdir)/pkgconfig"
321
322
323
324
325
326
	@for pkgconfigfile in $(PKGCONFIG_FILES) ; do \
		echo $(install_sh_DATA) $$pkgconfigfile \
		"$(DESTDIR)$(libdir)/$$pkgconfigfile" ; \
		$(install_sh_DATA) $$pkgconfigfile \
		"$(DESTDIR)$(libdir)/$$pkgconfigfile" ; \
	done
327
328

uninstall-local:
329
330
331
332
333
	@for pkgconfigfile in $(PKGCONFIG_FILES) ; do \
		echo rm -f "$(DESTDIR)$(libdir)/$$pkgconfigfile" ; \
		rm -f "$(DESTDIR)$(libdir)/$$pkgconfigfile" ; \
	done
	-@rmdir "$(DESTDIR)$(libdir)/pkgconfig"
334

Deike Kleberg's avatar
Deike Kleberg committed
335
336
337
338
339
340
341
endif

install-exec-hook:
	-@rmdir "$(DESTDIR)$(libdir)"
install-data-hook:
	-@rmdir "$(DESTDIR)$(includedir)"