build: added generation of version.h
[samba.git] / buildtools / wafsamba / samba_patterns.py
1 # a waf tool to add extension based build patterns for Samba
2
3 import os, sys, Options
4 import string, Task, Utils, optparse
5 from Configure import conf
6 from Logs import debug
7 from TaskGen import extension
8 from samba_utils import *
9
10 ################################################################################
11 # a et task which calls out to compile_et to do the work
12 Task.simple_task_type('et',
13                       '../heimdal_build/et_compile_wrapper.sh . ${TGT[0].bld_dir(env)} default/source4/heimdal_build/compile_et ${SRC[0].abspath(env)} ${TGT[0].bldpath(env)}',
14                       color='BLUE', ext_out='.c',
15                       shell = False)
16
17 @extension('.et')
18 def process_et(self, node):
19     c_node = node.change_ext('.c')
20     h_node  = node.change_ext('.h')
21     self.create_task('et', node, [c_node, h_node])
22     self.allnodes.append(c_node)
23
24
25
26 def SAMBA_MKVERSION(bld, target):
27     '''generate the version.h header for Samba'''
28     bld.SET_BUILD_GROUP('setup')
29     t = bld(rule="${SRC} ${TGT}",
30             source= [ "script/mkversion.sh", 'VERSION' ],
31             target=target,
32             before="cc")
33     # force this rule to be constructed now
34     t.post()
35 Build.BuildContext.SAMBA_MKVERSION = SAMBA_MKVERSION
36