Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,27 @@ env = Environment(ENV=os.environ,
BUILDERS={'rustc': rust_rustc_builder,
'cargo': rust_cargo_builder,
'Go': go_builder},
tools=['gcc', 'gnulink', 'g++', 'gas'])
tools=['gcc', 'gnulink', 'g++', 'gas', 'gfortran'])

env['CCFLAGS'] = ''
env['CXXFLAGS'] = '-std=c++17'
env['ASFLAGS'] = '--64'

# Add other languages here when you want to add language targets
# Put 'name_of_language_directory' : 'file_extension'
languages = {'c': 'c', 'cpp': 'cpp', 'asm-x64': 's', 'rust': 'rs', 'go': 'go'}
languages = {
'c': 'c',
'cpp': 'cpp',
'asm-x64': 's',
'rust': 'rs',
'go': 'go',
'fortran': 'f90',
}

env.C = env.Program
env.CPlusPlus = env.Program
env.X64 = env.Program
env.Fortran = env.Program

Export('env')

Expand Down
6 changes: 6 additions & 0 deletions contents/euclidean_algorithm/code/fortran/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Import('*')
from pathlib import Path

dirname = Path.cwd().parents[1].stem

env.Fortran(f'#/build/fortran/{dirname}', 'euclidean.f90')
6 changes: 6 additions & 0 deletions sconscripts/fortran_SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Import('files_to_compile env')
from pathlib import Path

for file in files_to_compile:
chapter_name = file.parent.parent.parent.stem
env.Fortran(f'#/build/fortran/{chapter_name}', str(file))