scons: add code to generate the various GL API files
[mesa.git] / src / mapi / glapi / gen / SConscript
1 Import('*')
2
3 from sys import executable as python_cmd
4
5
6 # Generate the GL API headers that are used by various parts of the
7 # Mesa and GLX tree. Other .c and .h files are generated elsewhere
8 # if they're only used in one place.
9
10 GLAPI = '#src/mapi/glapi/'
11
12 glapi_headers = []
13
14 glapi_headers += env.CodeGenerate(
15 target = '#src/mesa/main/dispatch.h',
16 script = GLAPI + 'gen/gl_table.py',
17 source = GLAPI + 'gen/gl_API.xml',
18 command = python_cmd + ' $SCRIPT -m remap_table -f $SOURCE > $TARGET',
19 )
20
21 glapi_headers += env.CodeGenerate(
22 target = '#src/mapi/glapi/glapitemp.h',
23 script = GLAPI + 'gen/gl_apitemp.py',
24 source = GLAPI + 'gen/gl_API.xml',
25 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
26 )
27
28 glapi_headers += env.CodeGenerate(
29 target = '#src/mapi/glapi/glprocs.h',
30 script = GLAPI + 'gen/gl_procs.py',
31 source = GLAPI + 'gen/gl_API.xml',
32 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
33 )
34
35 glapi_headers += env.CodeGenerate(
36 target = '#src/mesa/main/remap_helper.h',
37 script = GLAPI + 'gen/remap_helper.py',
38 source = GLAPI + 'gen/gl_API.xml',
39 command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
40 )
41
42 env.Export('glapi_headers')