summaryrefslogtreecommitdiff
path: root/test/windows/mingw/build
blob: f0c09de385171072a6b46745aaccc75200229462 (plain)
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
#! /usr/bin/env bash

# Build libstudxml for MinGW
#
# -rebuild
# -test
#
trap 'exit 1' ERR

function error ()
{
  echo "$*" 1>&2
}

function clean ()
{
  if [ -f $1/Makefile ]; then
    make -C $1 distclean
  fi
}

LDFLAGS="-Wl,--enable-auto-import"

test=n
rebuild=n

while [ $# -gt 0 ]; do
  case $1 in
    -rebuild)
      rebuild=y
      shift
      ;;
    -test)
      test=y
      shift
      ;;
    *)
      error "unknown option: $1"
      exit 1
      ;;
  esac
done

# Clean everything up if we are rebuilding.
#
if [ $rebuild = y ]; then
  clean libstudxml
fi

# Build.
#
cd libstudxml

if [ $rebuild = y -o ! -f Makefile ]; then
  ./configure LDFLAGS="$LDFLAGS" DIFFFLAGS=-ubB
fi

make

# Test.
#
if [ $test = y ]; then
  make check
fi

cd ..