File: runexamples

package info (click to toggle)
cfortran 20210827-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 756 kB
  • sloc: ansic: 3,302; fortran: 959; makefile: 113; sh: 14
file content (19 lines) | stat: -rwxr-xr-x 344 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

set -e
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT INT TERM HUP

cp -r /usr/share/doc/cfortran/examples "$tmpdir"

cd "$tmpdir/examples"

for D in `find . -maxdepth 1 -type d`; do
    if test "x$D" = "x."; then continue; fi;
    cd "$D"
    gcc -c *.c
    gfortran -c *.f
    gcc *.o -lgfortran -o test
    ./test
    cd ..
done