|
| 1 | +## |
| 2 | +## Copyright (C) by Argonne National Laboratory |
| 3 | +## See COPYRIGHT in top-level directory |
| 4 | +## |
| 5 | + |
| 6 | +## TODO: need to write an automakefile that handles two primary cases: |
| 7 | +## 1) that ROMIO is being embedded within the MPI library, as in MPICH or Open |
| 8 | +## MPI |
| 9 | +## 2) that ROMIO is being built standalone, old-school style. This case is |
| 10 | +## basically unused in modern practice. |
| 11 | + |
| 12 | +# help autoreconf and friends realize where the macros live |
| 13 | +ACLOCAL_AMFLAGS = -I confdb |
| 14 | + |
| 15 | +# empty variable initializations so that later code can append (+=) |
| 16 | +include_HEADERS = |
| 17 | +nodist_include_HEADERS = |
| 18 | +noinst_HEADERS = |
| 19 | +AM_CFLAGS = @VISIBILITY_CFLAGS@ |
| 20 | +AM_CPPFLAGS = |
| 21 | +EXTRA_DIST = |
| 22 | +SUFFIXES = |
| 23 | +doc1_src_txt = |
| 24 | + |
| 25 | +external_subdirs = @mpl_srcdir@ |
| 26 | +external_dist_subdirs = @mpl_dist_srcdir@ |
| 27 | +external_includes = @mpl_includedir@ |
| 28 | +external_ldflags = @mpl_libdir@ |
| 29 | +external_libs = @mpl_lib@ |
| 30 | + |
| 31 | +# ------------------------------------------------------------------------ |
| 32 | +# variables to be populated by the included Makefile.mk fragments: |
| 33 | + |
| 34 | +# These are files that contain MPI routines (e.g., MPI_File_open). |
| 35 | +# In MPICH these will have an MPI_ and a PMPI_ version. Other implementations |
| 36 | +# (like OMPI) only want these to be MPI_ routines, possibly with some |
| 37 | +# name-shifting prefix. |
| 38 | +romio_mpi_sources = |
| 39 | + |
| 40 | +# regular old source files that implement ROMIO, such as ADIO code |
| 41 | +romio_other_sources = |
| 42 | + |
| 43 | +# code that may need to be "up" called from the MPI library and/or is |
| 44 | +# MPI-implementation-specific in some way |
| 45 | +glue_sources = |
| 46 | + |
| 47 | +# ------------------------------------------------------------------------ |
| 48 | +# when building under MPICH we must be able to find mpi.h |
| 49 | +AM_CPPFLAGS += $(MPI_H_INCLUDE) |
| 50 | + |
| 51 | +# ------------------------------------------------------------------------ |
| 52 | +# handle the "include" directory here |
| 53 | +AM_CPPFLAGS += -I$(top_builddir)/include -I$(top_srcdir)/include $(external_includes) |
| 54 | +# nodist_ b/c these are created by config.status and should not be distributed |
| 55 | +nodist_include_HEADERS += include/mpio.h include/mpiof.h |
| 56 | + |
| 57 | +# ------------------------------------------------------------------------ |
| 58 | + |
| 59 | +SUBDIRS = $(external_subdirs) |
| 60 | +DIST_SUBDIRS = test test-internal $(external_dist_subdirs) |
| 61 | + |
| 62 | +# for the sake of parallel make and avoiding an excessive number of convenience |
| 63 | +# libs, we use a subdir automake fragment strategy |
| 64 | +include mpi-io/Makefile.mk |
| 65 | +include adio/Makefile.mk |
| 66 | + |
| 67 | +EXTRA_DIST += autogen.sh |
| 68 | + |
| 69 | +if BUILD_ROMIO_EMBEDDED |
| 70 | +# Build a libtool convenience library that the enclosing MPI implementation can |
| 71 | +# use by adding it to the right _LIBADD variable. |
| 72 | +noinst_LTLIBRARIES = libromio.la |
| 73 | +libromio_la_SOURCES = $(romio_mpi_sources) $(romio_other_sources) $(glue_sources) |
| 74 | + |
| 75 | +## NOTE: ROMIO's old build system builds a bunch of _foo.o objects that contain |
| 76 | +## PMPI_ implementations as well as calls to only other PMPI routines. In |
| 77 | +## MPICH, these are the objects that need to go into libmpi, while the foo.o |
| 78 | +## objects should go into libpmpi. Furthermore, the -D option for ROMIO's |
| 79 | +## source files is different and inverted (in the boolean sense) compared with |
| 80 | +## MPICH's defintion. And ROMIO was dumping all of the symbols into the main |
| 81 | +## libmpi library, regardless of the separate profiling library's existence. |
| 82 | +## |
| 83 | +## Annoying, right? |
| 84 | +if BUILD_PROFILING_LIB |
| 85 | +# The current best strategy for now is to build the PMPI symbols as a separate |
| 86 | +# convenience lib to permit adding the special "-D..." argument for all objects. |
| 87 | +# MPICH will then link in both convenience library into libmpi, since it |
| 88 | +# won't work very well the other way around. |
| 89 | +noinst_LTLIBRARIES += libpromio.la |
| 90 | +libpromio_la_SOURCES = $(romio_mpi_sources) |
| 91 | +libpromio_la_CPPFLAGS = $(AM_CPPFLAGS) -DMPIO_BUILD_PROFILING |
| 92 | +libpromio_la_LDFLAGS = $(external_ldflags) |
| 93 | +libpromio_la_LIBADD = $(external_libs) |
| 94 | +else !BUILD_PROFILING_LIB |
| 95 | +libromio_la_LDFLAGS = $(external_ldflags) |
| 96 | +libromio_la_LIBADD = $(external_libs) |
| 97 | +endif !BUILD_PROFILING_LIB |
| 98 | + |
| 99 | +else !BUILD_ROMIO_EMBEDDED |
| 100 | +lib_LTLIBRARIES = libromio.la |
| 101 | +libromio_la_SOURCES = $(romio_mpi_sources) $(romio_other_sources) $(glue_sources) |
| 102 | +if BUILD_PROFILING_LIB |
| 103 | +libpromio_la_SOURCES = $(romio_mpi_sources) |
| 104 | +libpromio_la_CPPFLAGS = $(AM_CPPFLAGS) -DMPIO_BUILD_PROFILING |
| 105 | +endif BUILD_PROFILING_LIB |
| 106 | + |
| 107 | +endif |
| 108 | + |
| 109 | +# -------------------------------------------------------------------------- |
| 110 | +.PHONY: coverage |
| 111 | +gcov_sources = $(libmpl_la_SOURCES) |
| 112 | +# assumes that these sources were compiled appropriately ("-fprofile-arcs" |
| 113 | +# and "-ftest-coverage") |
| 114 | +coverage: |
| 115 | + @for file in $(gcov_sources) ; do \ |
| 116 | + dir=`dirname $$file` ; \ |
| 117 | + bname=`basename $$file` ; \ |
| 118 | + aux=`echo $$bname | sed -e 's,\.*$$,,'` ; \ |
| 119 | + echo "( $(GCOV) -b -f -o $$file $$file && mv $${bname}.gcov $$dir )" ; \ |
| 120 | + ( $(GCOV) -b -f -o $$file $$file && mv $${bname}.gcov $$dir ) ; \ |
| 121 | + rm -f *.gcov ; \ |
| 122 | + done |
| 123 | + for subdir in $(SUBDIRS) - ; do \ |
| 124 | + if test $$subdir = "-" ; then break ; fi ; \ |
| 125 | + ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) coverage ) ; \ |
| 126 | + done |
| 127 | +# -------------------------------------------------------------------------- |
| 128 | +.PHONY: mandoc mandoc-local htmldoc htmldoc-local |
| 129 | +SUFFIXES += .man-phony .html-phony .man1-phony .html1-phony .txt |
| 130 | + |
| 131 | +# "make V=1" support for our documentation recipes |
| 132 | +doctextman_verbose = $(doctextman_verbose_$(V)) |
| 133 | +doctextman_verbose_ = $(doctextman_verbose_$(AM_DEFAULT_VERBOSITY)) |
| 134 | +doctextman_verbose_0 = @echo " DOCTEXTMAN " $@; |
| 135 | +doctexthtml_verbose = $(doctexthtml_verbose_$(V)) |
| 136 | +doctexthtml_verbose_ = $(doctexthtml_verbose_$(AM_DEFAULT_VERBOSITY)) |
| 137 | +doctexthtml_verbose_0 = @echo " DOCTEXTHTML " $@; |
| 138 | + |
| 139 | +# Build dir paths where the man pages will be created. Will usually be |
| 140 | +# overridden by MPICH make. |
| 141 | +mandoc_path1=$(abs_top_builddir)/man/man1 |
| 142 | +mandoc_path3=$(abs_top_builddir)/man/man3 |
| 143 | +htmldoc_path1=$(abs_top_builddir)/www/www1 |
| 144 | +htmldoc_path3=$(abs_top_builddir)/www/www3 |
| 145 | +doctext_docnotes= |
| 146 | +# Provide an easily replaced url root for the generated index file. |
| 147 | +# You can override this with URL desired in the index file generated by doctext. |
| 148 | +# You can ignore this if you don't use mapnames or tohtml to add links |
| 149 | +# to the MPI manual pages to documents. |
| 150 | +htmldoc_root3="--your-url-here--" |
| 151 | + |
| 152 | +.c.man-phony: |
| 153 | + $(doctextman_verbose)$(DOCTEXT) -man -mpath $(mandoc_path3) -ext 3 \ |
| 154 | + -heading MPI -quotefmt -nolocation $(doctext_docnotes) $< |
| 155 | +.c.html-phony: |
| 156 | + $(doctexthtml_verbose)$(DOCTEXT) -html -mpath $(htmldoc_path3) \ |
| 157 | + -heading MPI -quotefmt -nolocation \ |
| 158 | + -index $(htmldoc_path3)/mpi.cit -indexdir $(htmldoc_root3) \ |
| 159 | + $(doctext_docnotes) $< |
| 160 | + |
| 161 | +.txt.man1-phony: |
| 162 | + $(doctextman_verbose)$(DOCTEXT) -man -mpath $(mandoc_path1) -ext 1 \ |
| 163 | + -heading MPI -quotefmt -nolocation $(doctext_docnotes) $< |
| 164 | +.txt.html1-phony: |
| 165 | + $(doctexthtml_verbose)$(DOCTEXT) -html -mpath $(htmldoc_path1) \ |
| 166 | + -heading MPI -quotefmt -nolocation $(doctext_docnotes) $< |
| 167 | + |
| 168 | +# use mandoc-local target to force directory creation before running DOCTEXT |
| 169 | +mandoc: |
| 170 | + test -d $(mandoc_path1) || $(MKDIR_P) $(mandoc_path1) |
| 171 | + test -d $(mandoc_path3) || $(MKDIR_P) $(mandoc_path3) |
| 172 | + $(MAKE) $(AM_MAKEFLAGS) mandoc-local |
| 173 | +mandoc-local: $(romio_mpi_sources:.c=.man-phony) $(doc1_src_txt:.txt=.man1-phony) |
| 174 | + |
| 175 | +# use htmldoc-local target to force directory creation before running DOCTEXT |
| 176 | +htmldoc: |
| 177 | + test -d $(top_builddir)/www/www1 || $(MKDIR_P) $(top_builddir)/www/www1 |
| 178 | + test -d $(top_builddir)/www/www3 || $(MKDIR_P) $(top_builddir)/www/www3 |
| 179 | + $(MAKE) $(AM_MAKEFLAGS) htmldoc-local |
| 180 | +htmldoc-local: $(romio_mpi_sources:.c=.html-phony) $(doc1_src_txt:.txt=.html1-phony) |
| 181 | + |
| 182 | +# -------------------------------------------------------------------------- |
| 183 | + |
| 184 | +# sometimes helpful when debugging macros to see the preprocessed output. |
| 185 | +# Also using '-CC' because comments provide useful landmarks |
| 186 | + |
| 187 | +SUFFIXES += .i |
| 188 | + |
| 189 | +.c.i: |
| 190 | + $(COMPILE) -CC -E -o $@ $< |
| 191 | + |
0 commit comments