File: Makefile.am

package info (click to toggle)
coda 2.20-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 11,292 kB
  • sloc: ansic: 124,817; sh: 4,657; java: 2,391; python: 1,091; yacc: 1,003; makefile: 596; lex: 204; fortran: 60; xml: 5
file content (681 lines) | stat: -rw-r--r-- 17,918 bytes parent folder | download
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
ACLOCAL_AMFLAGS = -I m4

.PHONY: doc

# *** general build settings ****

DOXYGEN = @DOXYGEN@
INDENT = @INDENT@

PYTHON_SWIGFLAGS = -w119,451 -python -Ipython -I$(srcdir)/python -DPRINTF_ATTR= @SWIGFLAGS@
JAVA_SWIGFLAGS = -w119,451 -java -Ijava -I$(srcdir)/java -package nl.stcorp.coda -outdir java/nl/stcorp/coda -DPRINTF_ATTR= @SWIGFLAGS@
JNICPPFLAGS = @JNICPPFLAGS@
JNIEXT = @JNIEXT@
JAVAROOT = java

AM_CPPFLAGS = -Ilibcoda -I$(srcdir)/libcoda
AM_YFLAGS = -d
AM_LFLAGS = -olex.yy.c

HDF4LIBS = @HDF4LIBS@
HDF5LIBS = @HDF5LIBS@

SUFFIXES = .i

BUILT_SOURCES =
CLEANFILES =
EXTRA_DIST =
INDENTFILES =

INSTALL_DATA_HOOK_TARGETS =
install-data-hook: $(INSTALL_DATA_HOOK_TARGETS)

CLEAN_LOCAL_TARGETS =
clean-local: $(CLEAN_LOCAL_TARGETS)

# *** targets ***

if SUBPACKAGE_MODE

noinst_PROGRAMS = codadd
noinst_LTLIBRARIES = libcoda.la 

else

# programs

bin_PROGRAMS = codacheck codacmp codadd codadump codaeval codafind
noinst_PROGRAMS = findtypedef

# libraries (+ related files)

lib_LTLIBRARIES = libcoda.la
noinst_LTLIBRARIES = 

if BUILD_IDL
idldlmexec_LTLIBRARIES = coda_idl.la
endif

if BUILD_MATLAB
matlabmexexec_LTLIBRARIES = coda_matlab.la
endif

if BUILD_PYTHON
codapython_PYTHON = \
	$(srcdir)/python/__init__.py \
	$(srcdir)/python/codapython.py \
	python/codac.py
codapython_LTLIBRARIES = _codac.la
endif

if BUILD_JAVA
java_LTLIBRARIES = libcoda_jni.la
endif

# empty directory for .codadef definition files

install_codadefdir:
	test -z "$(DESTDIR)$(definitionsdir)" || $(MKDIR_P) "$(DESTDIR)$(definitionsdir)"
INSTALL_DATA_HOOK_TARGETS += install_codadefdir

# headers

nodist_include_HEADERS = coda.h

endif

# *** build rules ***

# expat

# pcre

# zlib

# libcoda

libcoda_la_SOURCES = \
	libcoda/coda-ascbin-cursor.c \
	libcoda/coda-ascbin.h \
	libcoda/coda-ascii-cursor.c \
	libcoda/coda-ascii-internal.h \
	libcoda/coda-ascii.c \
	libcoda/coda-ascii.h \
	libcoda/coda-bin-cursor.c \
	libcoda/coda-bin-internal.h \
	libcoda/coda-bin.c \
	libcoda/coda-bin.h \
	libcoda/coda-cdf-cursor.c \
	libcoda/coda-cdf-internal.h \
	libcoda/coda-cdf-type.c \
	libcoda/coda-cdf.c \
	libcoda/coda-cdf.h \
	libcoda/coda-check.c \
	libcoda/coda-cursor-read.c \
	libcoda/coda-cursor.c \
	libcoda/coda-definition-parse.c \
	libcoda/coda-definition.c \
	libcoda/coda-definition.h \
	libcoda/coda-detection.c \
	libcoda/coda-errno.c \
	libcoda/coda-expr-parser.y \
	libcoda/coda-expr-tokenizer.l \
	libcoda/coda-expr.c \
	libcoda/coda-expr.h \
	libcoda/coda-filefilter.c \
	libcoda/coda-filefilter.h \
	libcoda/coda-grib-cursor.c \
	libcoda/coda-grib-internal.h \
	libcoda/coda-grib-type.c \
	libcoda/coda-grib.c \
	libcoda/coda-grib.h \
	libcoda/coda-internal.h \
	libcoda/coda-mem-cursor.c \
	libcoda/coda-mem-internal.h \
	libcoda/coda-mem-type.c \
	libcoda/coda-mem.c \
	libcoda/coda-mem.h \
	libcoda/coda-netcdf-cursor.c \
	libcoda/coda-netcdf-internal.h \
	libcoda/coda-netcdf-type.c \
	libcoda/coda-netcdf.c \
	libcoda/coda-netcdf.h \
	libcoda/coda-path.h \
	libcoda/coda-product.c \
	libcoda/coda-read-array.h \
	libcoda/coda-read-bits.h \
	libcoda/coda-read-bytes.h \
	libcoda/coda-read-bytes-in-bounds.h \
	libcoda/coda-read-partial-array.h \
	libcoda/coda-rinex.c \
	libcoda/coda-rinex.h \
	libcoda/coda-sp3.c \
	libcoda/coda-sp3.h \
	libcoda/coda-swap2.h \
	libcoda/coda-swap4.h \
	libcoda/coda-swap8.h \
	libcoda/coda-time.c \
	libcoda/coda-transpose-array.h \
	libcoda/coda-tree.c \
	libcoda/coda-tree.h \
	libcoda/coda-type.c \
	libcoda/coda-type.h \
	libcoda/coda-utils.c \
	libcoda/coda-xml-internal.h \
	libcoda/coda-xml-parser.c \
	libcoda/coda-xml.c \
	libcoda/coda-xml.h \
	libcoda/coda.c \
	libcoda/hashtable.c \
	libcoda/hashtable.h \
	libcoda/ipow.h \
	libcoda/ziparchive.c \
	libcoda/ziparchive.h
libcoda_hdf4_files = \
	libcoda/coda-hdf4-cursor.c \
	libcoda/coda-hdf4-internal.h \
	libcoda/coda-hdf4-type.c \
	libcoda/coda-hdf4.c \
	libcoda/coda-hdf4.h
libcoda_hdf5_files = \
	libcoda/coda-hdf5-cursor.c \
	libcoda/coda-hdf5-internal.h \
	libcoda/coda-hdf5-type.c \
	libcoda/coda-hdf5.c \
	libcoda/coda-hdf5.h
if WITH_HDF4
libcoda_la_SOURCES += $(libcoda_hdf4_files)
else
INDENTFILES += $(libcoda_hdf4_files)
endif
if WITH_HDF5
libcoda_la_SOURCES += $(libcoda_hdf5_files)
else
INDENTFILES += $(libcoda_hdf5_files)
endif
libcoda_la_CPPFLAGS =      $(AM_CPPFLAGS)
libcoda_la_LDFLAGS = -no-undefined -version-info $(LIBCODA_CURRENT):$(LIBCODA_REVISION):$(LIBCODA_AGE)
libcoda_la_LIBADD = -lexpat -lz -lpcre $(HDF4LIBS) $(HDF5LIBS)
INDENTFILES += $(libcoda_la_SOURCES) libcoda/coda.h.in
BUILT_SOURCES += libcoda/coda-expr-parser.h

# tools/codacheck

codacheck_SOURCES = tools/codacheck/codacheck.c
codacheck_LDADD = libcoda.la
INDENTFILES += $(codacheck_SOURCES)

# tools/codacmp

codacmp_SOURCES = tools/codacmp/codacmp.c
codacmp_LDADD = libcoda.la
INDENTFILES += $(codacmp_SOURCES)

# tools/codadd

codadd_SOURCES = \
	tools/codadd/codadd.c \
	tools/codadd/codadd-definition.c \
	tools/codadd/codadd-detect.c \
	tools/codadd/codadd-doc.c \
	tools/codadd/codadd-list.c \
	tools/codadd/codadd-xmlschema.c
if SUBPACKAGE_MODE
codadd_LDFLAGS = -all-static
endif
codadd_LDADD = libcoda.la
INDENTFILES += $(codadd_SOURCES)

# tools/codadump

codadump_SOURCES = \
	tools/codadump/codadump-ascii.c \
	tools/codadump/codadump-debug.c \
	tools/codadump/codadump-dim.c \
	tools/codadump/codadump-filter.c \
	tools/codadump/codadump-json.c \
	tools/codadump/codadump-traverse.c \
	tools/codadump/codadump-yaml.c \
	tools/codadump/codadump.c \
	tools/codadump/codadump-filter.h \
	tools/codadump/codadump.h
codadump_hdf4_files = tools/codadump/codadump-hdf4.c
if WITH_HDF4
codadump_SOURCES += $(codadump_hdf4_files)
else
INDENTFILES += $(codadump_hdf4_files)
endif
codadump_CPPFLAGS = -Itools/codadump -I$(srcdir)/tools/codadump $(AM_CPPFLAGS)
codadump_LDADD = libcoda.la $(HDF4LIBS)
INDENTFILES += $(codadump_SOURCES)

# tools/codaeval

codaeval_SOURCES = \
	tools/codaeval/codaeval.c
codaeval_LDADD = libcoda.la
INDENTFILES += $(codaeval_SOURCES)

# tools/codafind

codafind_SOURCES = \
	tools/codafind/codafind.c
codafind_LDADD = libcoda.la
INDENTFILES += $(codafind_SOURCES)

# fortran

if !SUBPACKAGE_MODE

fortran_DATA = \
	fortran/Makefile \
	fortran/coda.inc \
	fortran/coda_fortran.c \
	fortran/example.f

fortran_SCRIPTS = \
	fortran/checkf77.sh

endif

EXTRA_DIST += \
	fortran/Makefile.in \
	fortran/coda.inc \
	fortran/coda_fortran.c \
	fortran/checkf77.sh \
	fortran/example.f

# idl

CODA_IDL_SOURCE_FILES = idl/coda_idl.c
INDENTFILES += $(CODA_IDL_SOURCE_FILES)

if BUILD_IDL
coda_idl_la_SOURCES = $(CODA_IDL_SOURCE_FILES)
coda_idl_la_LDFLAGS = -module -shared -avoid-version
coda_idl_la_LIBADD = libcoda.la
coda_idl_la_DEPENDENCIES = libcoda.la
endif

# matlab

CODA_MATLAB_SOURCE_FILES = \
	matlab/coda-matlab.h \
	matlab/coda-matlab-getdata.c \
	matlab/coda-matlab-traverse.c \
	matlab/coda_matlab.c
INDENTFILES += $(CODA_MATLAB_SOURCE_FILES)

if BUILD_MATLAB
coda_matlab_la_SOURCES = $(CODA_MATLAB_SOURCE_FILES)
coda_matlab_la_CPPFLAGS = -DMATLAB_MEX_FILE
coda_matlab_la_LDFLAGS = -module -shared -avoid-version -export-symbols-regex mexFunction -shrext @MEXEXT@
coda_matlab_la_LIBADD = libcoda.la
coda_matlab_la_DEPENDENCIES = libcoda.la
endif

# python

python/codac.c: libcoda/coda.h.in $(srcdir)/python/codac.i \
    $(srcdir)/python/coda_typemaps.i \
    $(srcdir)/python/coda_ignore.i \
    $(srcdir)/python/coda_rename.i
	@$(MKDIR_P) python
	$(SWIG) $(PYTHON_SWIGFLAGS) -o python/codac.c $(srcdir)/python/codac.i

EXTRA_DIST += \
	python/codac.c \
	python/codac.py \
	$(srcdir)/python/codac.i \
	$(srcdir)/python/coda_typemaps.i \
	$(srcdir)/python/coda_ignore.i \
	$(srcdir)/python/coda_rename.i

if BUILD_PYTHON
_codac_la_SOURCES = python/codac.c
_codac_la_LDFLAGS = -module -shared -avoid-version
_codac_la_LIBADD = libcoda.la
_codac_la_DEPENDENCIES = libcoda.la
endif

# java

java/coda_jni.c: libcoda/coda.h.in $(srcdir)/java/codac.i \
    $(srcdir)/java/coda_ignore.i \
    $(srcdir)/java/coda_rename.i
	@$(MKDIR_P) java/nl/stcorp/coda
	$(SWIG) $(JAVA_SWIGFLAGS) -o java/coda_jni.c  $(srcdir)/java/codac.i

java_files = \
	$(srcdir)/java/nl/stcorp/coda/CodaException.java \
	$(srcdir)/java/nl/stcorp/coda/Product.java \
	$(srcdir)/java/nl/stcorp/coda/Type.java \
	$(srcdir)/java/nl/stcorp/coda/Cursor.java \
	$(srcdir)/java/nl/stcorp/coda/Expression.java \
	$(srcdir)/java/nl/stcorp/coda/Coda.java \
	java/nl/stcorp/coda/ArrayOrderingEnum.java \
	java/nl/stcorp/coda/FilefilterStatusEnum.java \
	java/nl/stcorp/coda/FormatEnum.java \
	java/nl/stcorp/coda/NativeTypeEnum.java \
	java/nl/stcorp/coda/SpecialTypeEnum.java \
	java/nl/stcorp/coda/ExpressionTypeEnum.java \
	java/nl/stcorp/coda/TypeClassEnum.java \
	java/nl/stcorp/coda/codacConstants.java \
	java/nl/stcorp/coda/codac.java \
	java/nl/stcorp/coda/codacJNI.java \
	java/nl/stcorp/coda/SWIGTYPE_p_coda_product_struct.java \
	java/nl/stcorp/coda/SWIGTYPE_p_coda_expression_struct.java \
	java/nl/stcorp/coda/SWIGTYPE_p_coda_cursor_struct.java \
	java/nl/stcorp/coda/SWIGTYPE_p_coda_type_struct.java

EXTRA_DIST += \
	java/coda_jni.c \
	$(java_files) \
	java/CodaExample.java \
	$(srcdir)/java/codac.i \
	$(srcdir)/java/coda_ignore.i \
	$(srcdir)/java/coda_rename.i


if BUILD_JAVA
noinst_JAVA = $(java_files)

java_class_files = \
	nl/stcorp/coda/CodaException.class \
	nl/stcorp/coda/Product.class \
	nl/stcorp/coda/Type.class \
	nl/stcorp/coda/Cursor.class \
	nl/stcorp/coda/Expression.class \
	nl/stcorp/coda/Coda.class \
	nl/stcorp/coda/ArrayOrderingEnum.class \
	nl/stcorp/coda/FilefilterStatusEnum.class \
	nl/stcorp/coda/FormatEnum.class \
	nl/stcorp/coda/NativeTypeEnum.class \
	nl/stcorp/coda/SpecialTypeEnum.class \
	nl/stcorp/coda/ExpressionTypeEnum.class \
	nl/stcorp/coda/TypeClassEnum.class \
	nl/stcorp/coda/codacConstants.class \
	nl/stcorp/coda/codac.class \
	nl/stcorp/coda/codacJNI.class \
	nl/stcorp/coda/SWIGTYPE_p_coda_product_struct.class \
	nl/stcorp/coda/SWIGTYPE_p_coda_expression_struct.class \
	nl/stcorp/coda/SWIGTYPE_p_coda_cursor_struct.class \
	nl/stcorp/coda/SWIGTYPE_p_coda_type_struct.class \
	nl/stcorp/coda/ArrayOrderingEnum\$$SwigNext.class \
	nl/stcorp/coda/FilefilterStatusEnum\$$SwigNext.class \
	nl/stcorp/coda/FormatEnum\$$SwigNext.class \
	nl/stcorp/coda/ExpressionTypeEnum\$$SwigNext.class \
	nl/stcorp/coda/NativeTypeEnum\$$SwigNext.class \
	nl/stcorp/coda/SpecialTypeEnum\$$SwigNext.class \
	nl/stcorp/coda/TypeClassEnum\$$SwigNext.class

java/coda.jar: classnoinst.stamp
	cd java && $(JAR) -cf coda.jar $(java_class_files)

java_DATA = \
	java/CodaExample.java \
	java/build.xml \
	java/coda.jar

libcoda_jni_la_SOURCES = java/coda_jni.c
libcoda_jni_la_CPPFLAGS = $(JNICPPFLAGS) $(AM_CPPFLAGS) -fno-strict-aliasing
libcoda_jni_la_LDFLAGS = -module -shared -avoid-version -shrext $(JNIEXT)
libcoda_jni_la_LIBADD = libcoda.la
libcoda_jni_la_DEPENDENCIES = libcoda.la

CLEANFILES += java/coda.jar

CLEAN_LOCAL_TARGETS += clean_java_class_files
clean_java_class_files:
	cd java && rm -f $(java_class_files)

endif

# *** misc distribution files ***

EXTRA_DIST += \
	CHANGES \
	COPYING \
	FAQ \
	INSTALL \
	LICENSES \
	README \
	bootstrap \
	codadef.sh

# *** idl data ***

CODA_IDL_DLMFILES = idl/coda_idl.dlm

EXTRA_DIST += $(CODA_IDL_DLMFILES) \
	idl/coda_idl.def \
	idl/coda_idl.dlm.in

if BUILD_IDL
idldlmexec_DATA = $(CODA_IDL_DLMFILES)
endif

# *** matlab data ***

CODA_MATLAB_MFILES = \
	matlab/coda_attributes.m \
	matlab/coda_class.m \
	matlab/coda_clearall.m \
	matlab/coda_close.m \
	matlab/coda_description.m \
	matlab/coda_eval.m \
	matlab/coda_fetch.m \
	matlab/coda_fieldavailable.m \
	matlab/coda_fieldcount.m \
	matlab/coda_fieldnames.m \
	matlab/coda_getopt.m \
	matlab/coda_open.m \
	matlab/coda_open_as.m \
	matlab/coda_options.m \
	matlab/coda_param.m \
	matlab/coda_product_class.m \
	matlab/coda_product_type.m \
	matlab/coda_product_version.m \
	matlab/coda_setopt.m \
	matlab/coda_size.m \
	matlab/coda_time_to_string.m \
	matlab/coda_unit.m \
	matlab/coda_version.m

EXTRA_DIST += $(CODA_MATLAB_MFILES) \
	matlab/coda_matlab.def

if BUILD_MATLAB
matlabmexexec_DATA = $(CODA_MATLAB_MFILES)
endif

# *** documentation ***

include doclibcoda.mk
include docjava.mk

DOCFILES = \
	doc/html/index.html \
	doc/html/css/codadef.css \
	doc/html/css/codadoc.css \
	doc/html/images/coda-large.png \
	$(LIBCODA_DOCFILES) \
	$(JAVA_DOCFILES) \
	doc/html/codadef/codadef-cdf.html \
	doc/html/codadef/codadef-expressions.html \
	doc/html/codadef/codadef-format.html \
	doc/html/codadef/codadef-grib.html \
	doc/html/codadef/codadef-hdf4.html \
	doc/html/codadef/codadef-hdf5.html \
	doc/html/codadef/codadef-netcdf.html \
	doc/html/codadef/codadef-rinex.html \
	doc/html/codadef/codadef-sp3.html \
	doc/html/codadef/codadef-xml.html \
	doc/html/codacheck/index.html \
	doc/html/codacmp/index.html \
	doc/html/codadd/index.html \
	doc/html/codadump/index.html \
	doc/html/codaeval/index.html \
	doc/html/codafind/index.html \
	doc/html/fortran/index.html \
	doc/html/idl/index.html \
	doc/html/matlab/index.html \
	doc/html/python/index.html

EXTRA_DIST += \
	$(DOCFILES) \
	libcoda/doc/Doxyfile.in \
	libcoda/doc/extrapages.txt \
	libcoda/doc/footer.html \
	libcoda/doc/header.html \
	java/doc/Doxyfile.in \
	java/doc/extrapages.txt \
	java/doc/footer.html \
	java/doc/header.html \
	doclibcoda.mk \
	docjava.mk

if !SUBPACKAGE_MODE
nobase_pkgdata_DATA = $(DOCFILES)
endif

doc: libcoda_doc java_doc

docclean: libcoda_docclean java_docclean

libcoda_doc: coda.h libcoda/doc/Doxyfile
	@if test "x$(DOXYGEN)" = x ; then \
	  echo "Doxygen not available. Documentation was not (re)created." ; \
	else \
	  $(MAKE) libcoda_docclean ; \
	  echo "creating libcoda documentation" ; \
	  test -d doc/html || $(MKDIR_P) doc/html ; \
	  cd libcoda/doc ; \
	  $(DOXYGEN) Doxyfile ; \
	  cd ../.. ; \
	  rm -rf doc/html/libcoda/doxygen.* doc/html/libcoda/tab* doc/html/libcoda/*.png ; \
	  echo "creating doclibcoda.mk" ; \
	  $(MAKE) doclibcoda_include ; \
	fi

libcoda_docclean:
	@echo "removing libcoda documentation"
	@rm -rf doc/html/libcoda

doclibcoda_include:
	@find doc/html/libcoda -type f | LANG= sort | $(AWK) 'BEGIN {printf("LIBCODA_DOCFILES =")}; {printf(" \\\n\t%s", $$0)}' > doclibcoda.mk2
	@echo "" >> doclibcoda.mk2
	@find doc/html/libcoda -type f | LANG= sort | $(AWK) '{printf("%s:\n\t$$(MAKE) libcoda_doc\n", $$0)}' >> doclibcoda.mk2
	@if diff $(srcdir)/doclibcoda.mk doclibcoda.mk2 >/dev/null 2>&1 ; then \
	  echo "doclibcoda.mk is unchanged" ; \
	  rm -f doclibcoda.mk2 ; \
	else \
	  mv doclibcoda.mk2 $(srcdir)/doclibcoda.mk ; \
	fi

java_doc: $(java_files) java/doc/Doxyfile
	@if test "x$(DOXYGEN)" = x ; then \
	  echo "Doxygen not available. Documentation was not (re)created." ; \
	else \
	  $(MAKE) java_docclean ; \
	  echo "creating coda java documentation" ; \
	  test -d doc/html || $(MKDIR_P) doc/html ; \
	  cd java/doc ; \
	  $(DOXYGEN) Doxyfile ; \
	  cd ../.. ; \
	  rm -rf doc/html/java/doxygen.* doc/html/java/tab* doc/html/java/dir_*.html doc/html/java/*.png ; \
	  echo "creating docjava.mk" ; \
	  $(MAKE) docjava_include ; \
	fi

java_docclean:
	@echo "removing coda java documentation"
	@rm -rf doc/html/java

docjava_include:
	@find doc/html/java -type f | LANG= sort | $(AWK) 'BEGIN {printf("JAVA_DOCFILES =")}; {printf(" \\\n\t%s", $$0)}' > docjava.mk2
	@echo "" >> docjava.mk2
	@find doc/html/java -type f | LANG= sort | $(AWK) '{printf("%s:\n\t$$(MAKE) java_doc\n", $$0)}' >> docjava.mk2
	@if diff $(srcdir)/docjava.mk docjava.mk2 >/dev/null 2>&1 ; then \
	  echo "docjava.mk is unchanged" ; \
	  rm -f docjava.mk2 ; \
	else \
	  mv docjava.mk2 $(srcdir)/docjava.mk ; \
	fi


# *** indent ***

findtypedef_SOURCES = findtypedef.l
findtypedef_LDADD = @LIBOBJS@

EXTRA_DIST += .indent.pro.in

.indent.pro: $(srcdir)/.indent.pro.in findtypedef$(EXEEXT) $(INDENTFILES)
	@echo creating .indent.pro
	@$(RM) indent.types
	@touch indent.types
	@for file in $(INDENTFILES) ; do \
	  ./findtypedef `test -f $$file || echo '$(srcdir)/'`$$file ; \
	done >> indent.types
	@cp $(srcdir)/.indent.pro.in .indent.pro
	@sort -u indent.types | sed "s/^/-T /" >> .indent.pro
	@$(RM) indent.types

indent:
	@$(RM) .indent.pro
	@$(MAKE) .indent.pro
	@echo Indenting
	@test "x$(INDENTFILES)" = x || for file in $(INDENTFILES) ; do \
	  $(INDENT) `test -f $$file || echo '$(srcdir)/'`$$file ; \
	  $(RM) `test -f $$file || echo '$(srcdir)/'`$$file~ ; \
	done

# *** CMake-specific ***

EXTRA_DIST += \
	CMakeLists.txt \
	CMakeModules/FindNumPy.cmake \
	CMakeModules/FindHDF4.cmake \
	CMakeModules/FindHDF5.cmake \
	CMakeModules/FindIDL.cmake \
	CMakeModules/FindZLIB.cmake \
	CMakeModules/FindJPEG.cmake \
	CMakeModules/FindSZIP.cmake \
	config.h.cmake.in \
	cpack_wix_patch.xml \
	libcoda/coda.h.cmake.in

config.h.cmake.in: config.h.in Makefile.am
	cat $(srcdir)/config.h.in | sed -e 's/#[ ]*undef \(.*\)/#cmakedefine \1 \$${\1}/' > config.h.cmake.in2
	@if diff $(srcdir)/config.h.cmake.in config.h.cmake.in2 >/dev/null 2>&1 ; then \
	  echo "config.h.cmake.in is unchanged" ; \
	  rm -f config.h.cmake.in2 ; \
	else \
	  mv config.h.cmake.in2 $(srcdir)/config.h.cmake.in ; \
	fi

libcoda/coda.h.cmake.in: libcoda/coda.h.in Makefile.am
	cat $(srcdir)/libcoda/coda.h.in | sed 's/#[ ]*undef \(.*\)/#cmakedefine \1 \$${\1}/' > libcoda/coda.h.cmake.in2
	@if diff $(srcdir)/libcoda/coda.h.cmake.in libcoda/coda.h.cmake.in2 >/dev/null 2>&1 ; then \
	  echo "libcoda/coda.h.cmake.in is unchanged" ; \
	  rm -f libcoda/coda.h.cmake.in2 ; \
	else \
	  mv libcoda/coda.h.cmake.in2 $(srcdir)/libcoda/coda.h.cmake.in ; \
	fi

# *** development install targets to avoid long installs ***

install-python:
	$(MAKE) install-codapythonLTLIBRARIES install-codapythonPYTHON

install-matlab:
	$(MAKE) install-nodist_matlabmexexecDATA

install-idl:
	@$(MAKE) install-idldlmexecLTLIBRARIES install-idldlmexecDATA

# *** cppcheck ***
cppcheck:
	cppcheck -q $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcoda_la_CPPFLAGS) $(CPPFLAGS) libcoda/*.c libcoda/*.h