From e078fe39f0ebdf257ffcf91d4635f351d4037cb8 Mon Sep 17 00:00:00 2001 From: Sammy Plat Date: Wed, 8 Sep 2021 21:19:23 +0200 Subject: [PATCH 1/2] Added barnsley SConstructs + relevant .gitignore clauses --- .gitignore | 7 +++++++ contents/barnsley/code/c++/SConstruct | 3 +++ contents/barnsley/code/c/SConstruct | 3 +++ contents/barnsley/code/java/SConstruct | 3 +++ contents/barnsley/code/julia/SConstruct | 1 + 5 files changed, 17 insertions(+) create mode 100644 contents/barnsley/code/c++/SConstruct create mode 100644 contents/barnsley/code/c/SConstruct create mode 100644 contents/barnsley/code/java/SConstruct create mode 100644 contents/barnsley/code/julia/SConstruct diff --git a/.gitignore b/.gitignore index db26e0ad0..acff56a9d 100644 --- a/.gitignore +++ b/.gitignore @@ -517,3 +517,10 @@ vscode/ # aspell *.bak + +# SCons database files +**/.sconsign.dblite + +# SCons compiled files +*.out +*.o diff --git a/contents/barnsley/code/c++/SConstruct b/contents/barnsley/code/c++/SConstruct new file mode 100644 index 000000000..17e5c3e98 --- /dev/null +++ b/contents/barnsley/code/c++/SConstruct @@ -0,0 +1,3 @@ +executable = Program('barnsley.out', 'barnsley.cpp', CCFLAGS='-std=c++17 -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2') + +Command(target='out.dat', source=executable, action='./$SOURCE') diff --git a/contents/barnsley/code/c/SConstruct b/contents/barnsley/code/c/SConstruct new file mode 100644 index 000000000..56e79bc81 --- /dev/null +++ b/contents/barnsley/code/c/SConstruct @@ -0,0 +1,3 @@ +executable = Program('barnsley.out', 'barnsley.c', CCFLAGS='-Wall -Wextra -Wshadow -Wcast-align -Wunused -Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2') + +data_file = Command(target='barnsley.dat', source=executable, action='./$SOURCE') diff --git a/contents/barnsley/code/java/SConstruct b/contents/barnsley/code/java/SConstruct new file mode 100644 index 000000000..221d865a5 --- /dev/null +++ b/contents/barnsley/code/java/SConstruct @@ -0,0 +1,3 @@ +class_files = Java('.', '.') + +Command(target='barnsley.dat', source=class_files, action='java Barnsley') diff --git a/contents/barnsley/code/julia/SConstruct b/contents/barnsley/code/julia/SConstruct new file mode 100644 index 000000000..d1e055862 --- /dev/null +++ b/contents/barnsley/code/julia/SConstruct @@ -0,0 +1 @@ +Command(target='out.dat', source='barnsley.jl', action='julia $SOURCE') From 597adc86a390deab9e758ff83ad0a23629bc6440 Mon Sep 17 00:00:00 2001 From: Sammy Plat Date: Wed, 8 Sep 2021 22:02:16 +0200 Subject: [PATCH 2/2] forgot to do the coconut implementation --- contents/barnsley/code/coconut/SConstruct | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 contents/barnsley/code/coconut/SConstruct diff --git a/contents/barnsley/code/coconut/SConstruct b/contents/barnsley/code/coconut/SConstruct new file mode 100644 index 000000000..012f4f2f5 --- /dev/null +++ b/contents/barnsley/code/coconut/SConstruct @@ -0,0 +1,7 @@ +import os + +env = Environment(ENV={'PATH': os.environ['PATH']}) + +python_file = env.Command(target='barnsley.py', source='barnsley.coco', action='coconut --strict --target=3.8 $SOURCE') + +env.Command(target='out.dat', source=python_file, action='python3 $SOURCE')