Skip to content

Commit 5740ed2

Browse files
committed
Simplified SConscript files
SConscript files are now mostly universal for C programs. Additionally, the build hierarchy is now flattened (executables under the language folder)
1 parent 37226ce commit 5740ed2

File tree

18 files changed

+89
-22
lines changed

18 files changed

+89
-22
lines changed

contents/IFS/code/c/SConscript

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/IFS/IFS', 'IFS.c')
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'))

contents/barnsley/code/c/SConscript

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/bransley/barnsley', 'barnsley.c')
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'))

contents/computus/code/c/SConscript

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/computus/gauss_easter', 'gauss_easter.c')
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'))
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/cooley_tukey/cooley_tukey', 'fft.c',
3-
LIBS=['-lm', '-lfftw3'])
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'), LIBS=['m', 'fftw3'])
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/euclidean_algorithm/euclidean_algorithm',
3-
'euclidean_example.c', LIBS='-lm')
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'))

contents/flood_fill/code/c/SConscript

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/flood_fill/flood_fill', 'flood_fill.c')
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'))
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/forward_euler_method/forward_euler', 'euler.c', LIBS='-lm')
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'), LIBS='m')
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/gaussian_elimination/gaussian_elimination',
3-
'gaussian_elimination.c')
2+
from pathlib import Path
43

4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'))
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/graham_scan/graham_scan', 'graham.c', LIBS='-lm')
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'), LIBS='m')
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/huffman_encoding/huffman', 'huffman.c')
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'))
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/jarvis_march/jarvis_march', 'jarvis_march.c')
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'))
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/monte_carlo_integration/monte_carlo', 'monte_carlo.c')
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'))
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/quantum_systems/energy', 'energy.c', LIBS=['-lm', '-lfftw3'])
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'), LIBS=['m', 'fftw3'])
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/split-op_method/split_op', 'split_op.c',
3-
LIBS=['-lm', '-lfftw3'])
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'), LIBS=['m', 'fftw3'])
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/stable_marriage/stable_marriage', 'stable_marriage.c')
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'))
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/thomas_algorithm/thomas', 'thomas.c')
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'))
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/tree_traversal/tree_traversal', 'tree_traversal.c')
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'))
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Import('*')
2-
env.C('#/build/c/verlet_integration/verlet', 'verlet.c')
2+
from pathlib import Path
3+
4+
dirname = Path.cwd().parents[1].stem
5+
6+
env.C(f'#/build/c/{dirname}', Glob('*.c'))

0 commit comments

Comments
 (0)