Skip to content

Commit

Permalink
preprocessing F90 files for doxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed May 21, 2019
1 parent 615e4c8 commit 561eb3d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ if test "x$enable_docs" = xyes; then
AC_SUBST([FORTRAN_SRC_FILES], ["../src/flib"])
else
AC_SUBST([C_SRC_FILES], ["../src/clib/pio_nc.c ../src/clib/pio_nc4.c ../src/clib/pio_darray.c ../src/clib/pio_get_nc.c ../src/clib/pio_put_nc.c ../src/clib/pioc_support.c ../src/clib/pioc.c ../src/clib/pio_file.c ../src/clib/pio.h"])
AC_SUBST([FORTRAN_SRC_FILES], ["../src/flib"])
AC_SUBST([FORTRAN_SRC_FILES], ["../src/flib/piodarray.f90 ../src/flib/pio.F90 ../src/flib/pio_kinds.F90 ../src/flib/piolib_mod.f90 ../src/flib/pionfatt_mod.f90 ../src/flib/pio_nf.F90 ../src/flib/pionfget_mod.f90 ../src/flib/pionfput_mod.f90 ../src/flib/pio_support.F90 ../src/flib/pio_types.F90"])
# AC_SUBST([FORTRAN_SRC_FILES], ["../src/flib/pio_types.F90 ../src/flib/piodarray.F90 ../src/flib/piolib_mod.F90 ../src/flib/pio_nf.F90"])
fi
AC_CONFIG_FILES([doc/Doxyfile])
Expand Down
20 changes: 19 additions & 1 deletion src/flib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,26 @@ piolib_mod.mod pio.mod
BUILT_SOURCES = $(MODFILES)
include_HEADERS = $(MODFILES)

# Doxygen does not cope well with pre-processor use in Fortran. So
# create .f90 files from .F90 files by running the C
# pre-processor. These will only be used by doxygen when --enable-docs
# is used at configure.
if BUILD_DOCS
BUILT_SOURCES += piodarray.f90 piolib_mod.f90 pionfatt_mod.f90 pionfget_mod.f90 pionfput_mod.f90
piodarray.f90: piodarray.F90
$(CC) -E $< > $@
piolib_mod.f90: piolib_mod.F90
$(CC) -E $< > $@
pionfatt_mod.f90: pionfatt_mod.F90
$(CC) -E $< > $@
pionfget_mod.f90: pionfget_mod.F90
$(CC) -E $< > $@
pionfput_mod.f90: pionfput_mod.F90
$(CC) -E $< > $@
endif

CLEANFILES = *.mod piodarray.F90 pionfatt_mod.F90 pionfget_mod.F90 \
pionfput_mod.F90
pionfput_mod.F90 *.f90

EXTRA_DIST = CMakeLists.txt piodarray.F90.in pionfatt_mod.F90.in \
pionfget_mod.F90.in pionfput_mod.F90.in
5 changes: 1 addition & 4 deletions src/flib/piodarray.F90.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#define __PIO_FILE__ 'piodarray'
!>
!! @file
!! @brief Read and write routines for decomposed data.

!> @cond
#define __PIO_FILE__ 'piodarray'
!> @endcond
module piodarray
use pio_types, only : file_desc_t, io_desc_t, var_desc_t
use pio_kinds, only : i4, r4, r8, pio_offset_kind
Expand Down

0 comments on commit 561eb3d

Please sign in to comment.