File: make.sh

package info (click to toggle)
hypre 3.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 58,112 kB
  • sloc: ansic: 408,221; cpp: 62,971; sh: 12,091; fortran: 9,433; makefile: 3,327; perl: 2,994; awk: 147; python: 126
file content (55 lines) | stat: -rwxr-xr-x 1,047 bytes parent folder | download | duplicates (5)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
# HYPRE Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

testname=`basename $0 .sh`

# Echo usage information
case $1 in
   -h|-help)
      cat <<EOF

   $0 [-h] {src_dir} [options for make]

   where: {src_dir}     is the hypre source directory
          -spack <dir>  compile and link drivers to spack build
          -h|-help      prints this usage information and exits

   This script runs make clean; make [options] in {src_dir}.

   Example usage: $0 ../src test

EOF
      exit
      ;;
esac

# Setup
src_dir=`cd $1; pwd`
shift

# Parse the rest of the command line
mopts=""
while [ "$*" ]
do
   case $1 in
      -spack)
         shift; spackdir="$1"; shift
         ;;
      *)
         mopts="$mopts $1"; shift
         ;;
   esac
done

# Run make
cd $src_dir
make clean
if [ -n "$spackdir" ]; then
   cd $src_dir/test
   make HYPRE_BUILD_DIR="$spackdir" $mopts
else
   make $mopts
fi