Skip to content

A python script to generate dependencies for Fortran projects

License

Notifications You must be signed in to change notification settings

gkenway/fort_depend.py

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

fort_depend.py

A python script to generate Fortran dependencies

Original script by D. Dickinson

Usage

Here's an example of how to use fort_depend.py in your makefiles:

# Script to generate the dependencies
MAKEDEPEND=/path/to/fort_depend.py

# $(DEP_FILE) is a .dep file generated by fort_depend.py
DEP_FILE = my_project.dep

# Source files to compile
OBJECTS = mod_file1.f90 \
          mod_file2.f90

# Make sure everything depends on the .dep file
all: $(actual_executable) $(DEP_FILE)

# Make dependencies
.PHONY: depend
depend: $(DEP_FILE)

# The .dep file depends on the source files, so it automatically gets updated
# when you change your source
$(DEP_FILE): $(OBJECTS)
    @echo "Making dependencies!"
    cd $(SRCPATH) && $(MAKEDEPEND) -w -o /path/to/$(DEP_FILE) -f $(OBJECTS)
    
include $(DEP_FILE)

About

A python script to generate dependencies for Fortran projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%