71274ead75e899728cf8a375580a7ab5f00611fd
[samba.git] / buildtools / wafsamba / samba_autoproto.py
1 # waf build tool for building automatic prototypes from C source
2
3 from TaskGen import taskgen, before
4 import Build, os, string, Utils
5 from samba_utils import *
6
7 # rule for heimdal prototype generation
8 def HEIMDAL_AUTOPROTO(bld, header, source, options=None, group='main'):
9     bld.SET_BUILD_GROUP(group)
10     if options is None:
11         options='-q -P comment -o'
12     t = bld(rule='${PERL} -W ../heimdal/cf/make-proto.pl ${OPTIONS} ${TGT[0].abspath(env)} ${SRC}',
13             source=source,
14             target=header,
15             ext_out='.c',
16             before='cc')
17     t.env.OPTIONS = options
18 Build.BuildContext.HEIMDAL_AUTOPROTO = HEIMDAL_AUTOPROTO
19
20 # rule for private heimdal prototype generation
21 def HEIMDAL_AUTOPROTO_PRIVATE(bld, header, source):
22     bld.HEIMDAL_AUTOPROTO(header, source, options='-q -P comment -p')
23 Build.BuildContext.HEIMDAL_AUTOPROTO_PRIVATE = HEIMDAL_AUTOPROTO_PRIVATE
24
25 # rule for samba prototype generation
26 def SAMBA_AUTOPROTO(bld, header, source):
27     bld.SET_BUILD_GROUP('prototypes')
28     bld(
29         source = source,
30         target = header,
31         ext_out='.c',
32         before ='cc',
33         rule = '../script/mkproto.pl --srcdir=.. --builddir=. --public=/dev/null --private=${TGT} ${SRC}'
34         )
35 Build.BuildContext.SAMBA_AUTOPROTO = SAMBA_AUTOPROTO
36