diff options
author | Steven Knight <knight@baldmt.com> | 2002-03-28 06:20:14 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-03-28 06:20:14 (GMT) |
commit | f52c6264753cf84c3f650da057f628c4fd6901cd (patch) | |
tree | bf163ebe1d8aad82b4dfbec279787e63819f1909 /src | |
parent | 2fc00deefae65e7cd54f96518bedc62b763e0dda (diff) | |
download | SCons-f52c6264753cf84c3f650da057f628c4fd6901cd.zip SCons-f52c6264753cf84c3f650da057f628c4fd6901cd.tar.gz SCons-f52c6264753cf84c3f650da057f628c4fd6901cd.tar.bz2 |
Add Fortran support.
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 3 | ||||
-rw-r--r-- | src/engine/SCons/Defaults.py | 18 | ||||
-rw-r--r-- | src/engine/SCons/Scanner/C.py | 6 |
3 files changed, 25 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 5986cf0..b3dc356 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -61,6 +61,9 @@ RELEASE 0.06 - - Add PDF and PostScript document builders. + - Add support for compiling Fortran programs from a variety of + suffixes (a la GNU Make): .f, .F, .for, .FOR, .fpp and .FPP + From Steve Leblanc: - Add support for the -U option. diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py index e0763b2..d14bbc7 100644 --- a/src/engine/SCons/Defaults.py +++ b/src/engine/SCons/Defaults.py @@ -66,6 +66,10 @@ CXXFile = SCons.Builder.Builder(name = 'CXXFile', CPlusPlusAction = SCons.Action.Action('$CXXCOM') +FortranAction = SCons.Action.Action('$F77COM') + +FortranPPAction = SCons.Action.Action('$F77PPCOM') + Object = SCons.Builder.Builder(name = 'Object', action = { '.c' : '$CCCOM', '.C' : CPlusPlusAction, @@ -74,6 +78,12 @@ Object = SCons.Builder.Builder(name = 'Object', '.cxx' : CPlusPlusAction, '.c++' : CPlusPlusAction, '.C++' : CPlusPlusAction, + '.f' : FortranAction, + '.for' : FortranAction, + '.FOR' : FortranAction, + '.F' : FortranPPAction, + '.fpp' : FortranPPAction, + '.FPP' : FortranPPAction, }, prefix = '$OBJPREFIX', suffix = '$OBJSUFFIX', @@ -239,6 +249,10 @@ def make_win32_env_from_paths(include, lib, path): 'CXXFLAGS' : '$CCFLAGS', 'CXXCOM' : '$CXX $CXXFLAGS $_INCFLAGS /c $SOURCES /Fo$TARGET', 'CXXFILESUFFIX' : '.cc', + 'F77' : 'g77', + 'F77FLAGS' : '', + 'F77COM' : '$F77 $F77FLAGS $_INCFLAGS -c -o $TARGET $SOURCES', + 'F77PPCOM' : '$F77 $F77FLAGS $CPPFLAGS $_INCFLAGS -c -o $TARGET $SOURCES', 'LINK' : 'link', 'LINKFLAGS' : '/nologo', 'LINKCOM' : '$LINK $LINKFLAGS /OUT:$TARGET $_LIBDIRFLAGS $_LIBFLAGS $SOURCES', @@ -317,6 +331,10 @@ if os.name == 'posix': 'CXXFLAGS' : '$CCFLAGS', 'CXXCOM' : '$CXX $CXXFLAGS $_INCFLAGS -c -o $TARGET $SOURCES', 'CXXFILESUFFIX' : '.cc', + 'F77' : 'g77', + 'F77FLAGS' : '', + 'F77COM' : '$F77 $F77FLAGS $_INCFLAGS -c -o $TARGET $SOURCES', + 'F77PPCOM' : '$F77 $F77FLAGS $CPPFLAGS $_INCFLAGS -c -o $TARGET $SOURCES', 'LINK' : '$CXX', 'LINKFLAGS' : '', 'LINKCOM' : '$LINK $LINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS', diff --git a/src/engine/SCons/Scanner/C.py b/src/engine/SCons/Scanner/C.py index 8d4497c..0a2654e 100644 --- a/src/engine/SCons/Scanner/C.py +++ b/src/engine/SCons/Scanner/C.py @@ -44,10 +44,12 @@ include_re = re.compile('^[ \t]*#[ \t]*include[ \t]+(<|")([\\w./\\\\]+)(>|")', r include_cache = {} def CScan(fs = SCons.Node.FS.default_fs): - "Return a prototype Scanner instance for scanning C/C++ source files" + """Return a prototype Scanner instance for scanning source files + that use the C pre-processor""" cs = CScanner(scan, "CScan", [fs, ()], [".c", ".C", ".cxx", ".cpp", ".c++", ".cc", - ".h", ".H", ".hxx", ".hpp", ".hh"]) + ".h", ".H", ".hxx", ".hpp", ".hh", + ".F", ".fpp", ".FPP"]) cs.fs = fs return cs |