File: build_function

package info (click to toggle)
gerris 20131206+dfsg-17
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,720 kB
  • ctags: 6,768
  • sloc: ansic: 66,593; sh: 15,922; f90: 1,513; makefile: 1,149; fortran: 696; python: 484; awk: 104; lisp: 89; xml: 27
file content (36 lines) | stat: -rw-r--r-- 855 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
# file generated automatically by configure from 'build_function_gcc'

DIMENSION=$1  # gerris2D or gerris3D
WDIR=$2       # simulation directory

CC=mpicc
LD=mpicc
CFLAGS="-O -fpic -Wall -Wno-unused -Werror"
LDFLAGS="-O -fpic -shared"

touch links
if sed 's/@/#/g' < function.c | awk '{
      if ($1 == "#" && $2 == "link") {
        for (i = 3; i <= NF; i++)
          printf ("%s ", $i) >> "links";
        print "";
      } else if ($1 == "#link") {
        for (i = 2; i <= NF; i++)
          printf ("%s ", $i) >> "links";
        print "";
      } else print $0;
    }' > module.c; then :
else
    exit 1
fi

if $CC `pkg-config $DIMENSION --cflags` $CFLAGS -I"$WDIR" \
    -c -o module.o module.c; then
    if $LD `pkg-config $DIMENSION --libs` $LDFLAGS -o module.so `cat links` module.o; then :
    else
	exit 1
    fi
else
    exit 1
fi