-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.sh
executable file
·56 lines (51 loc) · 985 Bytes
/
make.sh
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
#!/bin/sh
# This script builds GRASS GIS, addons, or gdal-grass.
set -e
. ${GRASSMINGWRC-~/.grassmingwrc}
case "$1" in
-h|--help)
cat<<'EOT'
Usage: make.sh [OPTIONS] [TARGETS]
-h, --help display this help message
-a, --addons make addons (default: GRASS)
-A, --addon make an addon
-g, --gdal make gdal-grass
EOT
exit
;;
-a|-A|-g|--addons|--addon|--gdal)
opt=$1
shift
;;
-*)
echo "$1: Unknown option"
exit 1
;;
*)
opt=""
;;
esac
# use OSGeo4W Python
export PATH="$OSGEO4W_ROOT/bin:$PATH"
export PYTHONHOME="$OSGEO4W_ROOT/apps/python312"
case "$opt" in
"")
cd $GRASS_SRC
make "$@"
;;
-a|-A|--addons|--addon)
[ "$opt" = "--addons" ] && cd $GRASS_ADDONS_SRC/src
# CFLAGS for v.feature.algebra
# https://stackoverflow.com/a/28566889/16079666
make \
CFLAGS="-Dsrandom=srand -Drandom=rand" \
MODULE_TOPDIR=$GRASS_SRC \
LIBREDWGLIBPATH=-L$LIBREDWG_LIB \
LIBREDWGINCPATH=-I$LIBREDWG_INC \
"$@"
;;
-g|--gdal)
cd $GDAL_GRASS_SRC
make "$@"
;;
esac