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

# Build XSD examples for MinGW.
#
# -rebuild
# -test
#
trap 'exit 1' ERR

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

# Xerces-C++ installation directory (not build directory).
#
XERCESROOT=/c/projects/xerces-mingw32

CPPFLAGS="-I$XERCESROOT/include"
CXXFLAGS="-W -Wall"
LDFLAGS="-L$XERCESROOT/lib -Wl,--enable-auto-import"
PATH="$XERCESROOT/lib:$PATH"

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

cd xsd-i686-windows/examples

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

# Build.
#
make CPPFLAGS="$CPPFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS"

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

cd ../..