aboutsummaryrefslogtreecommitdiff
path: root/vrayPlug/mkosx.sh
blob: 95846ed9b5a9e126703eb9ac3dbcfb262b797cc7 (plain) (blame)
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
#!/bin/sh

# Shave and a Haircut
# (c) 2019 Epic Games
# US Patent 6720962

# Build all of the V-Ray plugins and shaders for a given version of Maya.
#
if [ "$1" == "" ]; then
    echo "Usage: $0 mayaVersion"
    exit 1
fi

mayaVersion=$1
makefileRoot=`./getMayaConfig.sh ${mayaVersion} makefileRoot`

# Build a V-Ray plugin and shader for each supported V-Ray version.
#
cd plugin

grep "^${mayaVersion}:" ../supportedVrayVersions.txt | \
while read key startVer endVer buildVer extra; do
    vrayTag=`../getVersionTag.sh ${buildVer}`

    if [ "${vrayTag}" == "" ]; then
        echo "ERROR: unrecognized V-Ray version '${buildVer}'."
        exit 3
    fi

    echo "mkosx:status: building V-Ray ${vrayTag} plugin and shader for Maya ${mayaVersion}"

    if [ ! -r ${makefileRoot}_x64_vray${vrayTag}.mak ]; then
        echo "ERROR: No makefile found for V-Ray ${vrayTag}."
	exit 2
    fi

    make -f ${makefileRoot}_x64_vray${vrayTag}.mak VRAY_VERSION=${buildVer} clean
    make -f ${makefileRoot}_x64_vray${vrayTag}.mak VRAY_VERSION=${buildVer} all
    if [ $? -ne 0 ]; then
        exit 1
    fi

    echo "mkosx:status: building V-Ray ${vrayTag} exporter for Maya ${mayaVersion}"

    pushd ../../mayaPlug

    make -f Makefile-vrayexporter.osx VRAY_VERSION=${buildVer} Clean
    if [ $? -ne 0 ]; then
        exit 1
    fi

    make -f Makefile-vrayexporter.osx VRAY_VERSION=${buildVer}
    if [ $? -ne 0 ]; then
        exit 1
    fi

    popd
done