waf

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

wscript (773B)


      1 #! /usr/bin/env python
      2 # encoding: utf-8
      3 # Thomas Nagy, 2009 (ita)
      4 
      5 VERSION='0.0.1'
      6 APPNAME='cc_test'
      7 
      8 top = '.'
      9 out = 'build'
     10 
     11 def configure(conf):
     12 	conf.load('gcc')
     13 
     14 def build(bld):
     15 
     16 	bld.program(
     17 		source    = 'main.c',
     18 		target    = 'test',
     19 		ldscript  = 'myscript.ld',
     20 		linkflags = ['-nostdlib'],
     21 		)
     22 
     23 from waflib import Utils
     24 from waflib.TaskGen import after, feature
     25 
     26 @after('apply_link')
     27 @feature('cprogram', 'cshlib')
     28 def process_ldscript(self):
     29 	if not getattr(self, 'ldscript', None) or self.env.CC_NAME != 'gcc':
     30 		return
     31 
     32 	node = self.path.find_resource(self.ldscript)
     33 	if not node:
     34 		raise Utils.WafError('could not find %r' % self.ldscript)
     35 	self.link_task.env.append_value('LINKFLAGS', '-Wl,-T,%s' % node.abspath())
     36 	self.link_task.dep_nodes.append(node)
     37