Skip to content

Commit

Permalink
chore(script): write single-file source to build/
Browse files Browse the repository at this point in the history
  • Loading branch information
rouson committed Nov 25, 2024
1 parent 2042b62 commit 97df78b
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions scripts/create-single-source-file-programs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
export assert_dir="../build/dependencies/assert"
export julienne_dir="../build/dependencies/julienne"
export fiats_dir=".."
export destination_dir="../build/single-file-programs"

if [ -d $destination_dir ]; then
echo "Destination directory exists: $destination_dir"
else
echo "Creating destination directory: $destination_dir"
mkdir "$destination_dir"
fi

echo ""
echo "---------------------- create-single-source-file.sh ----------------------------"
Expand All @@ -31,22 +39,22 @@ fi
echo "Concatenating Assert."
assert_modules=$(find "$assert_dir/src" -name '*_m.?90')
assert_submodules=$(find "$assert_dir/src" -name '*_s.?90')
cat ${assert_include:-} $assert_modules $assert_submodules > assert.F90
cat $assert_modules $assert_submodules > "$destination_dir"/assert.F90

echo "Concatenating Julienne."
julienne_modules=$(find "$julienne_dir/src" -name '*_m.?90')
julienne_submodules=$(find "$julienne_dir/src" -name '*_s.?90')
cat $julienne_modules $julienne_submodules > julienne.F90
cat $julienne_modules $julienne_submodules > "$destination_dir"/julienne.F90

echo "Concatenating Fiats."
fiats_modules=$(find "$fiats_dir/src" -name '*_m.?90')
fiats_submodules=$(find "$fiats_dir/src" -name '*_s.?90')
cat $fiats_modules $fiats_submodules > fiats.F90
cat $fiats_modules $fiats_submodules > "$destination_dir"/fiats.F90

echo "Copying include files."
cp "$assert_dir/include/assert_macros.h" .
cat "$julienne_dir/include/language-support.F90" "$fiats_dir/include/language-support.F90" > language-support.F90

cp "$assert_dir/include/assert_macros.h" "$destination_dir"
cat "$julienne_dir/include/language-support.F90" "$fiats_dir/include/language-support.F90" > "$destination_dir"/language-support.F90
cp "$fiats_dir/include/compound_assertions.h" "$destination_dir"

echo "Concatenating Assert, Julienne, Fiats, and example/concurrent-inferences.f90."
cat assert.F90 julienne.F90 fiats.F90 "$fiats_dir/example/concurrent-inferences.f90" > concurrent-inferences-single-file.F90
echo "Concatenating Assert, Julienne, Fiats, and example/concurrent-inferences.f90 into $destination_dir"
cat "$destination_dir"/assert.F90 "$destination_dir"/julienne.F90 "$destination_dir"/fiats.F90 "$fiats_dir/example/concurrent-inferences.f90" > $destination_dir/concurrent-inferences-single-file.F90

0 comments on commit 97df78b

Please sign in to comment.