File: Allwmake

package info (click to toggle)
openfoam 4.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 163,028 kB
  • ctags: 58,990
  • sloc: cpp: 830,760; sh: 10,227; ansic: 8,215; xml: 745; lex: 437; awk: 194; sed: 91; makefile: 77; python: 18
file content (84 lines) | stat: -rwxr-xr-x 1,799 bytes parent folder | download
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/sh
cd ${0%/*} || exit 1    # Run from this directory

[ -d "$WM_PROJECT_DIR" ] || {
    echo "Error: WM_PROJECT_DIR directory does not exist"
    echo "    Check the OpenFOAM entries in your dot-files and source them."
    echo "    WM_PROJECT_DIR=$WM_PROJECT_DIR"
    exit 1
}

usage() {
    exec 1>&2
    while [ "$#" -ge 1 ]; do echo "$1"; shift; done
    cat<<USAGE

usage: ${0##*/} [OPTION]
options:
  -online    use the links to the Github repositories instead of the local source code
  -help

USAGE
    exit 1
}

defineURL() {

  case "$WM_PROJECT_VERSION" in
  [0-9].x)
    FOAM_BRANCH_NAME="master"
    FOAM_REPO_VERSION="$WM_PROJECT-$WM_PROJECT_VERSION"
    ;;
  [0-9].[0-9])
    FOAM_BRANCH_NAME="version-$WM_PROJECT_VERSION"
    FOAM_REPO_VERSION="$WM_PROJECT-${WM_PROJECT_VERSION%.*}.x"
    ;;
  *)
    FOAM_BRANCH_NAME="master"
    FOAM_REPO_VERSION="$WM_PROJECT-$WM_PROJECT_VERSION"
    ;;
  esac

  export FOAM_BASE_REPO="https://github.com/$WM_PROJECT/$FOAM_REPO_VERSION"
  export FOAM_ONLINE_REPO="$FOAM_BASE_REPO/tree/$FOAM_BRANCH_NAME"
}

# Parse options
while [ "$#" -gt 0 ]
do
    case "$1" in
    -h | -help)
        usage
        ;;
    -online)
        defineURL
        shift
        ;;
    *)
        usage "unknown option/argument: '$*'"
        ;;
    esac
done

#------------------------------------------------------------------------------

set -x

rm -rf latex man

# Remove html directory in background
mv html html-stagedRemove$$ 2> /dev/null
rm -rf html-stagedRemove$$ >/dev/null 2>&1 &

# Ensure that created files are readable by everyone
umask 22
doxygen

# Fix permissions (NB: '+X' and not '+x'!)
chmod -R a+rX html latex man 2>/dev/null

echo
echo "Done doxygen"
echo

#------------------------------------------------------------------------------