summaryrefslogtreecommitdiff
path: root/source4/build/scons/proto.py
blob: fc5cc1b7c1532927aa83bd1ecae267ecd0d896c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""SCons.Tool.proto

Tool-specific initialization for mkproto (C Proto File generator)

"""

import SCons.Defaults
import SCons.Util

proto_builder = SCons.Builder.Builder(action='$PROTOCOM',
                                     src_suffix = '.c',
                                     suffix='.h')

def generate(env):
	env['MKPROTO']          = './script/mkproto.sh'
	env['PROTO_DEFINE']		= '_PROTO_H_'
	env['PROTOCOM']       = '$MKPROTO "$PERL" -h $PROTO_DEFINE ${TARGETS[0]} $SOURCES'
	env['BUILDERS']['CProtoHeader'] = proto_builder

def exists(env):
	return env.Detect('./script/mkproto.sh')