1Import('*')
2
3from sys import executable as python_cmd
4
5
6# Be conservative and depend on all XML files here.  Missing dependencies means
7# broken builds, whereas extraneous dependencies merely means regenerate the
8# .[ch] files -- scons should not recompile them though.
9sources = ['gl_and_es_API.xml'] + env.Glob('*.xml')
10
11
12# Generate the GL API headers that are used by various parts of the
13# Mesa and GLX tree.  Other .c and .h files are generated elsewhere
14# if they're only used in one place.
15
16env.CodeGenerate(
17    target = '../../../mesa/main/dispatch.h',
18    script = 'gl_table.py',
19    source = sources,
20    command = python_cmd + ' $SCRIPT -m remap_table -f $SOURCE > $TARGET',
21    )
22
23env.CodeGenerate(
24    target = '../../../mapi/glapi/glapitable.h',
25    script = 'gl_table.py',
26    source = sources,
27    command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
28    )
29
30env.CodeGenerate(
31    target = '../../../mapi/glapi/gen/glapitemp.h',
32    script = 'gl_apitemp.py',
33    source = sources,
34    command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
35    )
36
37env.CodeGenerate(
38    target = '../../../mapi/glapi/glprocs.h',
39    script = 'gl_procs.py',
40    source = sources,
41    command = python_cmd + ' $SCRIPT -c -f $SOURCE > $TARGET'
42    )
43
44env.CodeGenerate(
45    target = '../../../mesa/main/remap_helper.h',
46    script = 'remap_helper.py',
47    source = sources,
48    command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
49    )
50
51env.CodeGenerate(
52    target = '../../../mesa/main/enums.c',
53    script = 'gl_enums.py',
54    source = '../registry/gl.xml',
55    command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
56    )
57
58env.CodeGenerate(
59    target = '../../../mesa/main/api_exec.c',
60    script = 'gl_genexec.py',
61    source = sources,
62    command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
63    )
64