Blame src/mpi/romio/Makefile.am

Packit 0848f5
# -*- Mode: Makefile; -*-
Packit 0848f5
#
Packit 0848f5
# (C) 2011 by Argonne National Laboratory.
Packit 0848f5
#     See COPYRIGHT in top-level directory.
Packit 0848f5
#
Packit 0848f5
Packit 0848f5
## TODO: need to write an automakefile that handles two primary cases:
Packit 0848f5
## 1) that ROMIO is being embedded within the MPI library, as in MPICH or Open
Packit 0848f5
##    MPI
Packit 0848f5
## 2) that ROMIO is being built standalone, old-school style.  This case is
Packit 0848f5
##    basically unused in modern practice.
Packit 0848f5
Packit 0848f5
# help autoreconf and friends realize where the macros live
Packit 0848f5
ACLOCAL_AMFLAGS = -I confdb
Packit 0848f5
Packit 0848f5
# empty variable initializations so that later code can append (+=)
Packit 0848f5
include_HEADERS = 
Packit 0848f5
nodist_include_HEADERS =
Packit 0848f5
noinst_HEADERS = 
Packit 0848f5
AM_CPPFLAGS =
Packit 0848f5
EXTRA_DIST =
Packit 0848f5
SUFFIXES = 
Packit 0848f5
doc1_src_txt =
Packit 0848f5
Packit 0848f5
# ------------------------------------------------------------------------
Packit 0848f5
# variables to be populated by the included Makefile.mk fragments:
Packit 0848f5
Packit 0848f5
# These are files that contain MPI routines (e.g., MPI_File_open).
Packit 0848f5
# In MPICH these will have an MPI_ and a PMPI_ version.  Other implementations
Packit 0848f5
# (like OMPI) only want these to be MPI_ routines, possibly with some
Packit 0848f5
# name-shifting prefix.
Packit 0848f5
romio_mpi_sources = 
Packit 0848f5
Packit 0848f5
# regular old source files that implement ROMIO, such as ADIO code
Packit 0848f5
romio_other_sources =
Packit 0848f5
Packit 0848f5
# code that may need to be "up" called from the MPI library and/or is
Packit 0848f5
# MPI-implementation-specific in some way
Packit 0848f5
glue_sources = 
Packit 0848f5
Packit 0848f5
# ------------------------------------------------------------------------
Packit 0848f5
# when building under MPICH we must be able to find mpi.h
Packit 0848f5
AM_CPPFLAGS += $(MPI_H_INCLUDE)
Packit 0848f5
Packit 0848f5
# ------------------------------------------------------------------------
Packit 0848f5
# handle the "include" directory here
Packit 0848f5
AM_CPPFLAGS += -I$(top_builddir)/include -I$(top_srcdir)/include
Packit 0848f5
# nodist_ b/c these are created by config.status and should not be distributed
Packit 0848f5
nodist_include_HEADERS += include/mpio.h include/mpiof.h
Packit 0848f5
Packit 0848f5
# ------------------------------------------------------------------------
Packit 0848f5
Packit 0848f5
SUBDIRS =
Packit 0848f5
DIST_SUBDIRS = test test-internal
Packit 0848f5
Packit 0848f5
# for the sake of parallel make and avoiding an excessive number of convenience
Packit 0848f5
# libs, we use a subdir automake fragment strategy
Packit 0848f5
include mpi-io/Makefile.mk
Packit 0848f5
include adio/Makefile.mk
Packit 0848f5
Packit 0848f5
EXTRA_DIST += autogen.sh
Packit 0848f5
Packit 0848f5
if BUILD_ROMIO_EMBEDDED
Packit 0848f5
# Build a libtool convenience library that the enclosing MPI implementation can
Packit 0848f5
# use by adding it to the right _LIBADD variable.
Packit 0848f5
noinst_LTLIBRARIES = libromio.la
Packit 0848f5
libromio_la_SOURCES = $(romio_mpi_sources) $(romio_other_sources) $(glue_sources)
Packit 0848f5
Packit 0848f5
## NOTE: ROMIO's old build system builds a bunch of _foo.o objects that contain
Packit 0848f5
## PMPI_ implementations as well as calls to only other PMPI routines.  In
Packit 0848f5
## MPICH, these are the objects that need to go into libmpi, while the foo.o
Packit 0848f5
## objects should go into libpmpi.  Furthermore, the -D option for ROMIO's
Packit 0848f5
## source files is different and inverted (in the boolean sense) compared with
Packit 0848f5
## MPICH's defintion.  And ROMIO was dumping all of the symbols into the main
Packit 0848f5
## libmpi library, regardless of the separate profiling library's existence.
Packit 0848f5
##
Packit 0848f5
## Annoying, right?
Packit 0848f5
if BUILD_PROFILING_LIB
Packit 0848f5
# The current best strategy for now is to build the PMPI symbols as a separate
Packit 0848f5
# convenience lib to permit adding the special "-D..." argument for all objects.
Packit 0848f5
# MPICH will then link in both convenience library into libmpi, since it
Packit 0848f5
# won't work very well the other way around.
Packit 0848f5
noinst_LTLIBRARIES += libpromio.la
Packit 0848f5
libpromio_la_SOURCES = $(romio_mpi_sources)
Packit 0848f5
libpromio_la_CPPFLAGS = $(AM_CPPFLAGS) -DMPIO_BUILD_PROFILING 
Packit 0848f5
endif BUILD_PROFILING_LIB
Packit 0848f5
Packit 0848f5
else !BUILD_ROMIO_EMBEDDED
Packit 0848f5
lib_LTLIBRARIES = libromio.la
Packit 0848f5
libromio_la_SOURCES = $(romio_mpi_sources) $(romio_other_sources) $(glue_sources)
Packit 0848f5
if BUILD_PROFILING_LIB
Packit 0848f5
libpromio_la_SOURCES = $(romio_mpi_sources)
Packit 0848f5
libpromio_la_CPPFLAGS = $(AM_CPPFLAGS) -DMPIO_BUILD_PROFILING
Packit 0848f5
endif BUILD_PROFILING_LIB
Packit 0848f5
Packit 0848f5
endif
Packit 0848f5
Packit 0848f5
# --------------------------------------------------------------------------
Packit 0848f5
.PHONY: coverage
Packit 0848f5
gcov_sources = $(libmpl_la_SOURCES)
Packit 0848f5
# assumes that these sources were compiled appropriately ("-fprofile-arcs"
Packit 0848f5
# and "-ftest-coverage")
Packit 0848f5
coverage:
Packit 0848f5
	@for file in $(gcov_sources) ; do \
Packit 0848f5
	    dir=`dirname $$file` ; \
Packit 0848f5
	    bname=`basename $$file` ; \
Packit 0848f5
	    aux=`echo $$bname | sed -e 's,\.*$$,,'` ; \
Packit 0848f5
	    echo "( $(GCOV) -b -f -o $$file $$file && mv $${bname}.gcov $$dir )" ; \
Packit 0848f5
	    ( $(GCOV) -b -f -o $$file $$file && mv $${bname}.gcov $$dir ) ; \
Packit 0848f5
	    rm -f *.gcov ; \
Packit 0848f5
	done
Packit 0848f5
	for subdir in $(SUBDIRS) - ; do \
Packit 0848f5
	    if test $$subdir = "-" ; then break ; fi ; \
Packit 0848f5
	    ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) coverage ) ; \
Packit 0848f5
	done
Packit 0848f5
# --------------------------------------------------------------------------
Packit 0848f5
.PHONY: mandoc mandoc-local htmldoc htmldoc-local
Packit 0848f5
SUFFIXES += .man-phony .html-phony .man1-phony .html1-phony .txt
Packit 0848f5
Packit 0848f5
# "make V=1" support for our documentation recipes
Packit 0848f5
doctextman_verbose = $(doctextman_verbose_$(V))
Packit 0848f5
doctextman_verbose_ = $(doctextman_verbose_$(AM_DEFAULT_VERBOSITY))
Packit 0848f5
doctextman_verbose_0 = @echo "   DOCTEXTMAN  " $@;
Packit 0848f5
doctexthtml_verbose = $(doctexthtml_verbose_$(V))
Packit 0848f5
doctexthtml_verbose_ = $(doctexthtml_verbose_$(AM_DEFAULT_VERBOSITY))
Packit 0848f5
doctexthtml_verbose_0 = @echo "   DOCTEXTHTML  " $@;
Packit 0848f5
Packit 0848f5
# Build dir paths where the man pages will be created.  Will usually be
Packit 0848f5
# overridden by MPICH make.
Packit 0848f5
mandoc_path1=$(abs_top_builddir)/man/man1
Packit 0848f5
mandoc_path3=$(abs_top_builddir)/man/man3
Packit 0848f5
htmldoc_path1=$(abs_top_builddir)/www/www1
Packit 0848f5
htmldoc_path3=$(abs_top_builddir)/www/www3
Packit 0848f5
doctext_docnotes=
Packit 0848f5
# Provide an easily replaced url root for the generated index file.
Packit 0848f5
# You can override this with URL desired in the index file generated by doctext.
Packit 0848f5
# You can ignore this if you don't use mapnames or tohtml to add links
Packit 0848f5
# to the MPI manual pages to documents.
Packit 0848f5
htmldoc_root3="--your-url-here--"
Packit 0848f5
Packit 0848f5
.c.man-phony:
Packit 0848f5
	$(doctextman_verbose)$(DOCTEXT) -man -mpath $(mandoc_path3) -ext 3 \
Packit 0848f5
	    -heading MPI -quotefmt -nolocation $(doctext_docnotes) $<
Packit 0848f5
.c.html-phony:
Packit 0848f5
	$(doctexthtml_verbose)$(DOCTEXT) -html -mpath $(htmldoc_path3) \
Packit 0848f5
	    -heading MPI -quotefmt -nolocation \
Packit 0848f5
	    -index $(htmldoc_path3)/mpi.cit -indexdir $(htmldoc_root3) \
Packit 0848f5
		$(doctext_docnotes) $<
Packit 0848f5
Packit 0848f5
.txt.man1-phony:
Packit 0848f5
	$(doctextman_verbose)$(DOCTEXT) -man -mpath $(mandoc_path1) -ext 1 \
Packit 0848f5
	    -heading MPI -quotefmt -nolocation $(doctext_docnotes) $<
Packit 0848f5
.txt.html1-phony:
Packit 0848f5
	$(doctexthtml_verbose)$(DOCTEXT) -html -mpath $(htmldoc_path1) \
Packit 0848f5
	    -heading MPI -quotefmt -nolocation $(doctext_docnotes) $<
Packit 0848f5
Packit 0848f5
# use mandoc-local target to force directory creation before running DOCTEXT
Packit 0848f5
mandoc:
Packit 0848f5
	test -d $(mandoc_path1) || $(MKDIR_P) $(mandoc_path1)
Packit 0848f5
	test -d $(mandoc_path3) || $(MKDIR_P) $(mandoc_path3)
Packit 0848f5
	$(MAKE) $(AM_MAKEFLAGS) mandoc-local
Packit 0848f5
mandoc-local: $(romio_mpi_sources:.c=.man-phony) $(doc1_src_txt:.txt=.man1-phony)
Packit 0848f5
Packit 0848f5
# use htmldoc-local target to force directory creation before running DOCTEXT
Packit 0848f5
htmldoc:
Packit 0848f5
	test -d $(top_builddir)/www/www1 || $(MKDIR_P) $(top_builddir)/www/www1
Packit 0848f5
	test -d $(top_builddir)/www/www3 || $(MKDIR_P) $(top_builddir)/www/www3
Packit 0848f5
	$(MAKE) $(AM_MAKEFLAGS) htmldoc-local
Packit 0848f5
htmldoc-local: $(romio_mpi_sources:.c=.html-phony) $(doc1_src_txt:.txt=.html1-phony)
Packit 0848f5
Packit 0848f5
# --------------------------------------------------------------------------
Packit 0848f5