Blame test/mpi/f90/io/Makefile.am

Packit 0848f5
# This Makefile.am generated automatically by f77tof90
Packit 0848f5
# from test/mpi/f77/io/Makefile.am.  DO NOT EDIT
Packit 0848f5
# -*- Mode: Makefile; -*-
Packit 0848f5
# vim: set ft=automake :
Packit 0848f5
#
Packit 0848f5
# (C) 2011 by Argonne National Laboratory.
Packit 0848f5
#     See COPYRIGHT in top-level directory.
Packit 0848f5
#
Packit 0848f5
Packit 0848f5
include $(top_srcdir)/Makefile_f90.mtest
Packit 0848f5
Packit 0848f5
EXTRA_DIST = testlist.in
Packit 0848f5
Packit 0848f5
# avoid having to write many "foo_SOURCES = foo.f90" lines
Packit 0848f5
AM_DEFAULT_SOURCE_EXT = .f90
Packit 0848f5
Packit 0848f5
noinst_PROGRAMS = \
Packit 0848f5
    iwriteatf90 \
Packit 0848f5
    iwritef90 \
Packit 0848f5
    iwriteshf90 \
Packit 0848f5
    writef90 \
Packit 0848f5
    writeatf90 \
Packit 0848f5
    writeallf90 \
Packit 0848f5
    writeallbef90 \
Packit 0848f5
    writeordf90 \
Packit 0848f5
    writeordbef90 \
Packit 0848f5
    writeshf90 \
Packit 0848f5
    writeatallf90 \
Packit 0848f5
    writeatallbef90 \
Packit 0848f5
    fileerrf90 \
Packit 0848f5
    fileinfof90 \
Packit 0848f5
    shpositionf90 \
Packit 0848f5
    atomicityf90 \
Packit 0848f5
    miscfilef90 \
Packit 0848f5
    setviewcurf90 \
Packit 0848f5
    c2f90multio \
Packit 0848f5
    c2f2ciof90
Packit 0848f5
Packit 0848f5
if BUILD_MPIX_TESTS
Packit 0848f5
noinst_PROGRAMS += \
Packit 0848f5
    i_setviewcurf90  \
Packit 0848f5
    iwriteatallf90
Packit 0848f5
endif
Packit 0848f5
Packit 0848f5
Packit 0848f5
# We don't want to distribute these source files because they are created by
Packit 0848f5
# "testmerge", hence "nodist_foo_SOURCES"
Packit 0848f5
nodist_iwriteatf90_SOURCES     = iwriteatf90.f90
Packit 0848f5
nodist_iwriteatallf90_SOURCES  = iwriteatallf90.f90
Packit 0848f5
nodist_iwritef90_SOURCES       = iwritef90.f90
Packit 0848f5
nodist_iwriteshf90_SOURCES     = iwriteshf90.f90
Packit 0848f5
nodist_writeallbef90_SOURCES   = writeallbef90.f90
Packit 0848f5
nodist_writeallf90_SOURCES     = writeallf90.f90
Packit 0848f5
nodist_writeatallbef90_SOURCES = writeatallbef90.f90
Packit 0848f5
nodist_writeatallf90_SOURCES   = writeatallf90.f90
Packit 0848f5
nodist_writeatf90_SOURCES      = writeatf90.f90
Packit 0848f5
nodist_writef90_SOURCES        = writef90.f90
Packit 0848f5
nodist_writeordbef90_SOURCES   = writeordbef90.f90
Packit 0848f5
nodist_writeordf90_SOURCES     = writeordf90.f90
Packit 0848f5
nodist_writeshf90_SOURCES      = writeshf90.f90
Packit 0848f5
Packit 0848f5
c2f90multio_SOURCES     = c2f90multio.c
Packit 0848f5
# this is a C only program, so we must either:
Packit 0848f5
# A) prevent the makefile-wide "LDADD=mtestf90.o" from affecting this program, or
Packit 0848f5
# B) link with the fortran compiler, otherwise we'll get link failures from
Packit 0848f5
# compilers with runtime support libs, such as PGI
Packit 0848f5
c2f90multio_LDADD =
Packit 0848f5
Packit 0848f5
c2f2ciof90_SOURCES = c2f2ciof90.f90 c2f902cio.c
Packit 0848f5
Packit 0848f5
## these header files will be distributed because they're listed in
Packit 0848f5
## AC_CONFIG_FILES/AC_OUTPUT
Packit 0848f5
Packit 0848f5
# ensure that dependent tests will be rebuilt when headers are updated
Packit 0848f5
Packit 0848f5
Packit 0848f5
# these files are genereated using testmerge (see below)
Packit 0848f5
generated_io_sources = \
Packit 0848f5
    iwriteatf90.f90        \
Packit 0848f5
    iwriteatallf90.f90     \
Packit 0848f5
    iwritef90.f90          \
Packit 0848f5
    iwriteshf90.f90        \
Packit 0848f5
    writeallbef90.f90      \
Packit 0848f5
    writeallf90.f90        \
Packit 0848f5
    writeatallbef90.f90    \
Packit 0848f5
    writeatallf90.f90      \
Packit 0848f5
    writeatf90.f90         \
Packit 0848f5
    writef90.f90           \
Packit 0848f5
    writeordbef90.f90      \
Packit 0848f5
    writeordf90.f90        \
Packit 0848f5
    writeshf90.f90
Packit 0848f5
Packit 0848f5
EXTRA_DIST += ioharness.defn ioharness.tlt
Packit 0848f5
Packit 0848f5
# a parallel-safe scheme to generate the tests, see the automake-1.11.1 manual,
Packit 0848f5
# section 27.9 "Handling Tools That Produce Multiple Outputs" for an explanation
Packit 0848f5
# 
Packit 0848f5
# Note that using testmerge at make-time adds a dependency on perl for users.
Packit 0848f5
# It's been like this for a long time, so I don't think it's a problem in
Packit 0848f5
# practice.  The best way to fix this is to drop the nodist_foo_SOURCES lines,
Packit 0848f5
# modify testmerge to output the stamp file, and then enclose modified versions
Packit 0848f5
# of these rules in an "if MAINAINER_MODE".  The files also should then move to
Packit 0848f5
# MAINTAINERCLEANFILES from DISTCLEANFILES. [goodell@ 2011-07-11]
Packit 0848f5
gen-src-stamp: $(srcdir)/ioharness.defn $(srcdir)/ioharness.tlt
Packit 0848f5
	@rm -f gen-src-tmp
Packit 0848f5
	@touch gen-src-tmp
Packit 0848f5
	$(top_builddir)/maint/testmerge -defn=$(top_srcdir)/maint/common.defn \
Packit 0848f5
		$(srcdir)/ioharness.defn $(srcdir)/ioharness.tlt
Packit 0848f5
	@mv -f gen-src-tmp $@
Packit 0848f5
Packit 0848f5
$(generated_io_sources): gen-src-stamp
Packit 0848f5
## Recover from the removal of $@
Packit 0848f5
	@if test -f $@; then :; else \
Packit 0848f5
	  trap 'rm -rf gen-src-lock gen-src-stamp' 1 2 13 15; \
Packit 0848f5
## mkdir is a portable test-and-set
Packit 0848f5
	  if mkdir gen-src-lock 2>/dev/null; then \
Packit 0848f5
## This code is being executed by the first process.
Packit 0848f5
	    rm -f gen-src-stamp; \
Packit 0848f5
	    $(MAKE) $(AM_MAKEFLAGS) gen-src-stamp; \
Packit 0848f5
	    rmdir gen-src-lock; \
Packit 0848f5
	  else \
Packit 0848f5
## This code is being executed by the follower processes.
Packit 0848f5
## Wait until the first process is done.
Packit 0848f5
	    while test -d gen-src-lock; do sleep 1; done; \
Packit 0848f5
## Succeed if and only if the first process succeeded.
Packit 0848f5
	    test -f gen-src-stamp; exit $$?; \
Packit 0848f5
	  fi; \
Packit 0848f5
	fi
Packit 0848f5
Packit 0848f5
# just in case
Packit 0848f5
CLEANFILES += gen-src-tmp gen-src-stamp
Packit 0848f5
Packit 0848f5
# clean up after the test programs
Packit 0848f5
clean-local:
Packit 0848f5
	-rm -f .iotest.txt.*
Packit 0848f5
Packit 0848f5
DISTCLEANFILES = $(generated_io_sources)
Packit 0848f5
Packit 0848f5
Packit 0848f5
if MAINTAINER_MODE
Packit 0848f5
Packit 0848f5
# f77tof90 only replaces output files if the contents differ, so we must use a
Packit 0848f5
# separate timestamp file in order avoid constantly trying to remake the f90
Packit 0848f5
# copy of the Makefile when the f77 copy is updated in a way that does not
Packit 0848f5
# change its contents
Packit 0848f5
$(srcdir)/Makefile.am: $(srcdir)/Makefile.am-stamp
Packit 0848f5
Packit 0848f5
$(srcdir)/Makefile.am-stamp: $(master_top_srcdir)/test/mpi/f77/io/Makefile.am $(master_top_srcdir)/maint/f77tof90
Packit 0848f5
	( cd $(master_top_srcdir) && ./maint/f77tof90 test/mpi/f77/io test/mpi/f90/io Makefile.am Makefile.ap )
Packit 0848f5
Packit 0848f5
MAINTAINERCLEANFILES = Makefile.am-stamp
Packit 0848f5
EXTRA_DIST += Makefile.am-stamp  Makefile.ap
Packit 0848f5
Packit 0848f5
endif MAINTAINER_MODE
Packit 0848f5
Packit 0848f5
$(srcdir)/ioharness.defn: $(srcdir)/../../f77/io/ioharness.defn
Packit 0848f5
	sed -e 's/filename="\(.*\)f.f\"/filename="\1f90.f90"/g' \
Packit 0848f5
	-e 's/include.*iooffset.*/integer (kind=MPI_OFFSET_KIND)offset/g' \
Packit 0848f5
	$(srcdir)/../../f77/io/ioharness.defn > $(srcdir)/ioharness.defn
Packit 0848f5
$(srcdir)/ioharness.tlt: $(srcdir)/../../f77/io/ioharness.tlt
Packit 0848f5
	sed -e 's/include.*mpif.*/use mpi/g' \
Packit 0848f5
	    -e 's/fheader/f90header/g' \
Packit 0848f5
	    -e 's/^C/!/g' \
Packit 0848f5
	    -e '/implicit *none/d' \
Packit 0848f5
	$(srcdir)/../../f77/io/ioharness.tlt > $(srcdir)/ioharness.tlt
Packit 0848f5
c2f902cio.c: $(srcdir)/../../f90/io/c2f902cio.c
Packit 0848f5
	cp $(srcdir)/../../f90/io/c2f902cio.c c2f902cio.c