Skip to content

Makefile under An introduction to make not rebuilding when included files are changed #416

Closed
fortran-lang/webpage
#25
@p-costa

Description

@p-costa

I hope this is worth opening an issue here.

In addition to fpm, I actually use the nice Makefile and dependencies generator under An introduction to make in some projects. The Makefile has a dependencies generator which parses Fortran sources to search for dependencies, also for included files, but does not re-build when these include files are changed.

See this example project:

$> tree
.
├── gen-deps.awk
├── Makefile
└── src
    ├── bla.f90
    ├── bla-inc.f90


$> cat src/bla.f90
module bla
  implicit none
  private

  public :: say_hello
contains
  subroutine say_hello
    include "bla-inc.f90"
    print *, "Hello, bla!"
  end subroutine say_hello
end module bla


$> cat src/bla-inc.f90
print*,'Hey!'

$> cat Makefile
(...)
# List of all source files
SRCS := src/bla.f90
TEST_SRCS :=
(...)

When I touch src/bla.f90, the project is correctly rebuilt, but not when I touch src/bla-inc.f90. Unfortunately, I'm not proficient enough with GNU make to fix this, but maybe someone can!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions