summaryrefslogtreecommitdiffstats
path: root/o3d/compiler/glsl_validator/build.xml
blob: ee52a8c19550210c54736929c57ade25def91513 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!--
   - Ant build for the ANTLR GLSL ES grammar and simple test harness.
   - "ant" to compile everything.
   - "ant clean" to clean the build.
   - "ant test" to run tests.
  -->

<project name="GLSL_ES" basedir="." default="all">
  <target name="init">
    <property name="build" value="build" />
    <property name="test" value="test" />
    <path id="antlr.classpath">
      <pathelement location="../../../third_party/antlr3/lib/antlr-3.1.1.jar" />
    </path>
    <path id="antlr.runtime.classpath">
      <pathelement location="../../../third_party/antlr3/lib/antlr-runtime-3.1.1.jar" />
    </path>
    <path id="test.classpath">
      <pathelement location="../../../third_party/antlr3/lib/antlr-runtime-3.1.1.jar" />
      <pathelement location="${build}" />
    </path>
  </target>

  <target name="build" depends="init">
    <mkdir dir="${build}" />
    <mkdir dir="${build}/glsl_es" />
    <!-- Run ANTLR on the grammar -->
    <java classname="org.antlr.Tool" failonerror="true">
      <classpath refid="antlr.classpath" />
      <arg value="glsl_es/GLSL_ES.g" />
      <arg value="-fo" />
      <arg value="${build}/glsl_es" />
    </java>
    <!-- Compile the grammar and test cases -->
    <javac srcdir="${build}:${test}"
           destdir="${build}">
      <classpath refid="antlr.runtime.classpath" />
    </javac>
  </target>

  <target name="test" depends="init">
    <java classname="test.Main">
      <classpath refid="test.classpath" />
      <arg value="shaders/ambient.vert" />
      <arg value="shaders/ambient.frag" />
      <arg value="shaders/diffuse.vert" />
      <arg value="shaders/diffuse.frag" />
      <arg value="shaders/many-planets-deep.vert" />
      <arg value="shaders/many-planets-deep.frag" />
      <arg value="shaders/nvidia-vertex-buffer-object.vert" />
      <arg value="shaders/nvidia-vertex-buffer-object.frag" />
      <arg value="shaders/texture_mapping.vert" />
      <arg value="shaders/texture_mapping.frag" />
      <arg value="shaders/particles-2d.vert" />
      <arg value="shaders/particles-3d.vert" />
      <arg value="shaders/particles.frag" />
      <arg value="shaders/san-angeles-flat.vert" />
      <arg value="shaders/san-angeles-lit.vert" />
      <arg value="shaders/san-angeles-flat.frag" />
      <arg value="shaders/shiny-teapot.vert" />
      <arg value="shaders/shiny-teapot.frag" />
      <arg value="shaders/spirit-box.vert" />
      <arg value="shaders/spirit-box.frag" />
      <arg value="shaders/spore-view.vert" />
      <arg value="shaders/spore-view.frag" />
      <arg value="shaders/teapot-per-pixel.vert" />
      <arg value="shaders/teapot-per-pixel.frag" />
      <arg value="shaders/teapot-per-vertex.vert" />
      <arg value="shaders/teapot-per-vertex.frag" />
    </java>
  </target>

  <target name="testgrammar" depends="init">
    <mkdir dir="${build}" />
    <!-- Run ANTLR on the grammar -->
    <java classname="org.antlr.Tool">
      <classpath refid="antlr.classpath" />
      <arg value="glsl_es/Test.g" />
      <arg value="-fo" />
      <arg value="${build}" />
    </java>
  </target>

  <target name="clean" depends="init">
    <delete dir="${build}" />
  </target>

  <target name="all" depends="build" />
</project>