1
+
#
 
2
+
# Copyright by The HDF Group.
 
3
+
# Copyright by the Board of Trustees of the University of Illinois.
 
4
+
# All rights reserved.
 
5
+
#
 
6
+
# This file is part of HDF5.  The full HDF5 copyright notice, including
 
7
+
# terms governing use, modification, and redistribution, is contained in
 
8
+
# the COPYING file, which can be found at the root of the source code
 
9
+
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
 
10
+
# If you do not have access to either file, you may request a copy from
 
11
+
# help@hdfgroup.org.
 
12
+
##
 
13
+
## Makefile.am
 
14
+
## Run automake to generate a Makefile.in from this file.
 
15
+
##
 
16
+
# 
 
17
+
# This makefile mostly just reinvokes make in the various subdirectories
 
18
+
# but does so in the correct order.  You can alternatively invoke make from
 
19
+
# each subdirectory manually.
 
20
+
#
 
21
+
# Top-level HDF5 Makefile(.in)
 
22
+
 
23
+
# pmake has issues if variables are undefined.  Solve this problem in
 
24
+
# top-level Makefile by defining .MAKEFLAGS target to -V before pmake can
 
25
+
# encounter any undefined variables.
 
26
+
# Automake resists putting anything but variable definitions first in
 
27
+
# a Makefile.in, so we'll put a placebo comment here and use sed in
 
28
+
# bin/reconfigure to turn it into the .MAKEFLAGS target.  Sigh.  -JL 2005
 
29
+
# Configure should set AM_MAKEFLAGS to -V to solve this problem in
 
30
+
# subdirectories.
 
31
+
# NOTE: This means that invoking pmake in a subdirectory will not work.
 
32
+
#xxx.MAKEFLAGS:@AM_MAKEFLAGS@
 
33
+
#xxx    $(MAKE) all
 
34
+
#xxx
 
35
+
 
36
+
include $(top_srcdir)/config/commence.am
 
37
+
 
38
+
# Define subdirectories to build.
 
39
+
## Automake understands that `make distclean' should recurse into
 
40
+
## conditional subdirectories even if `make all' does not.
 
41
+
## We need to list the examples directory in the DIST_SUBDIRS variable
 
42
+
## so that it will be visited by `make distclean'
 
43
+
# Add this directory to SUBDIRS so that examples get built after tools
 
44
+
# but before examples in extra interfaces (c++ and fortran).
 
45
+
# Since we're explicitly listing DIST_SUBDIRS, we also need to list
 
46
+
# directories that are only conditionally built (so that their Makefiles
 
47
+
# are cleaned as well).
 
48
+
# Note that `make clean' will not affect the examples or doc directories. 
 
49
+
 
50
+
# Conditionals.  These conditionals are defined during configure
 
51
+
# Define each variable to empty if it is not used to placate pmake
 
52
+
if BUILD_PARALLEL_CONDITIONAL
 
53
+
   TESTPARALLEL_DIR =testpar
 
54
+
else
 
55
+
   TESTPARALLEL_DIR=
 
56
+
endif
 
57
+
if BUILD_CXX_CONDITIONAL
 
58
+
   CXX_DIR =c++
 
59
+
else
 
60
+
   CXX_DIR=
 
61
+
endif
 
62
+
if BUILD_FORTRAN_CONDITIONAL
 
63
+
   FORTRAN_DIR =fortran
 
64
+
else
 
65
+
   FORTRAN_DIR=
 
66
+
endif
 
67
+
if BUILD_JAVA_CONDITIONAL
 
68
+
   JAVA_DIR=java
 
69
+
else
 
70
+
   JAVA_DIR=
 
71
+
endif
 
72
+
if BUILD_HDF5_HL_CONDITIONAL
 
73
+
   HDF5_HL_DIR =hl
 
74
+
else
 
75
+
   HDF5_HL_DIR=
 
76
+
endif
 
77
+
 
78
+
SUBDIRS = src test $(TESTPARALLEL_DIR) tools . $(CXX_DIR) $(FORTRAN_DIR) \
 
79
+
          $(JAVA_DIR) $(HDF5_HL_DIR)
 
80
+
DIST_SUBDIRS = src test testpar tools . c++ fortran hl examples java
 
81
+
 
82
+
# Some files generated during configure that should be cleaned
 
83
+
DISTCLEANFILES=config/stamp1 config/stamp2
 
84
+
 
85
+
# Some files/directories generated during check that should be cleaned
 
86
+
CHECK_CLEANFILES+=*-tmp
 
87
+
 
88
+
# Define rules for lib, progs, check, and tests.
 
89
+
# These simply involve recursing into subdirectories.
 
90
+
test _test: check
 
91
+
 
92
+
lib progs check-p check-s:
 
93
+
    for d in $(SUBDIRS); do                                \
 
94
+
      if test $$d != .; then                                        \
 
95
+
       (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1;            \
 
96
+
      fi;                                                           \
 
97
+
    done
 
98
+
 
99
+
# Make all, tests, and (un)install
 
100
+
tests:
 
101
+
    for d in $(SUBDIRS); do                        \
 
102
+
      if test $$d != .; then                                        \
 
103
+
       (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1;            \
 
104
+
      fi;                                                           \
 
105
+
      done
 
106
+
 
107
+
# Check-clean also recurses into examples directory
 
108
+
check-clean:
 
109
+
    for d in $(SUBDIRS) examples; do               \
 
110
+
      if test $$d != .; then                                        \
 
111
+
       (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1;            \
 
112
+
      fi;                                                           \
 
113
+
    done
 
114
+
    $(RM) -rf prefix-tmp destdir-tmp
 
115
+
 
116
+
# Some C++ compilers/linkers will create a directory named ii_files in
 
117
+
# the root directory, which should be cleaned.
 
118
+
mostlyclean-local:
 
119
+
    if test -d ii_files; then                                       \
 
120
+
      $(RM) -rf ii_files;                                           \
 
121
+
    fi
 
122
+
 
123
+
# 'make install' will now install examples, the same as 'make install-all'.
 
124
+
# 'make-install-all' will be redundant but will still work.
 
125
+
install: install-recursive install-examples
 
126
+
uninstall: uninstall-recursive uninstall-examples 
 
127
+
 
128
+
# 'make install-all' also installs examples
 
129
+
install-all:
 
130
+
    @$(MAKE) $(AM_MAKEFLAGS) install
 
131
+
uninstall-all:
 
132
+
    @$(MAKE) $(AM_MAKEFLAGS) uninstall
 
133
+
 
134
+
# Install examples in this directory and recursively
 
135
+
install-examples uninstall-examples:
 
136
+
    for d in examples $(HDF5_INTERFACES) $(HL); do               \
 
137
+
        (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1;           \
 
138
+
    done
 
139
+
 
140
+
# Placeholder to remind users that docs are now in a separate repository.
 
141
+
install-doc:
 
142
+
    @echo "docs no longer live in this tree.  Use install-examples to install examples."
 
143
+
 
144
+
uninstall-doc:
 
145
+
    @echo "docs no longer live in this tree.  Use install-examples to install examples."
 
146
+
 
147
+
# `make check-install' or `make installcheck' checks that examples can 
 
148
+
#  be successfully built
 
149
+
installcheck-local:
 
150
+
    if test -n "${DESTDIR}"; then                                  \
 
151
+
          (cd ${DESTDIR}$(bindir) && pwd && ./h5redeploy -force);     \
 
152
+
        fi
 
153
+
    @(cd examples && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1;
 
154
+
 
155
+
# check-install is just a synonym for installcheck
 
156
+
check-install: installcheck
 
157
+
 
158
+
# check-all-install tests all installation methods.
 
159
+
# Install via different mechanism and then compare against the default.
 
160
+
# Fine if only libXXX.a files are different since they may have been ranlib'ed.
 
161
+
check-all-install:
 
162
+
    @echo Installing to default location
 
163
+
    $(MAKE) install
 
164
+
    @echo Installing to different prefix location
 
165
+
    $(MAKE) prefix=${ROOT}/prefix-tmp install
 
166
+
    @echo Compare against the default installation.
 
167
+
    @echo Fine if only libXXX.a files are different.
 
168
+
    -diff -r prefix-tmp ${prefix}
 
169
+
    @echo Installing to different $$\DESTDIR location
 
170
+
    env DESTDIR=${ROOT}/destdir-tmp $(MAKE) install
 
171
+
    @echo Compare against the default installation.
 
172
+
    @echo Fine if only libXXX.a files are different.
 
173
+
    -diff -r destdir-tmp${prefix} ${prefix}
 
174
+
 
175
+
# Only source files in the src directory include tracing information,
 
176
+
# so 'make trace' only needs to recurse into that directory.
 
177
+
trace:
 
178
+
    @(cd src && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1;
 
179
+
 
180
+
# Run tests with different Virtual File Drivers.
 
181
+
# Currently, only invoke check-vfd in the test directory.
 
182
+
check-vfd:
 
183
+
    for d in src test; do                                 \
 
184
+
      if test $$d != .; then                                       \
 
185
+
        (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1;          \
 
186
+
      fi;                                                          \
 
187
+
    done
 
188
+
 
189
+
# Automake wants to make config.status depend on configure.  This
 
190
+
# makes sense, but config.status can't always be regenerated
 
191
+
# properly, which can cause builds to fail.
 
192
+
# This is a problem for our Daily Tests, which need to be able to
 
193
+
# 'make distclean' reliably before running configure.
 
194
+
# The simple solution is to override the dependency Automake supplies
 
195
+
# for config.status so that it will never be regenerated.
 
196
+
$(top_builddir)/config.status:
 
197
+
 
198
+
# Don't include conclude.am in root Makefile; tests target needs to
 
199
+
# recurse into reguar subdirs.