waf

FORK: waf with some random patches
git clone https://git.neptards.moe/neptards/waf.git
Log | Files | Refs | README

wscript (702B)


      1 #! /usr/bin/env python
      2 # encoding: utf-8
      3 
      4 def options(opt):
      5 	opt.load('compiler_c')
      6 
      7 def configure(conf):
      8 	conf.load('compiler_c')
      9 
     10 def build(bld):
     11 
     12 	# the file precious.c is updated in the source directory
     13 	# the actual application is produced in the build directory
     14 
     15 	node = bld.path.find_resource('precious.c')
     16 
     17 	def fun(task):
     18 		import random
     19 		val = random.randint(0, 222111000)
     20 		task.outputs[0].write('#include <stdio.h>\nint main(){ printf("%%d", %d); return 0;}' % val)
     21 
     22 	bld(
     23 		#rule = '''echo -e "#include <stdio.h>\\nint main(){ printf(\\"%%d\\", $$RANDOM); return 0;}" > ${TGT}''',
     24 		rule = fun,
     25 		target = node,
     26 		always = True)
     27 
     28 	bld.program(
     29 		source = 'precious.c',
     30 		target = 'app')
     31