You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
790 B
Python
37 lines
790 B
Python
#! /usr/bin/env python
|
|
|
|
"""
|
|
This example demonstrates how to create custom compilation and link tasks
|
|
|
|
NOTE: to avoid redefining the method call_apply_link, you could use this:
|
|
import waflib.TaskGen
|
|
waflib.TaskGen.feats['mylink'] = ['apply_link']
|
|
"""
|
|
|
|
def configure(ctx):
|
|
pass
|
|
|
|
def build(ctx):
|
|
ctx(features='mylink', source='foo.ext faa.ext', target='bingo')
|
|
|
|
from waflib.Task import Task
|
|
from waflib.TaskGen import feature, extension, after_method
|
|
from waflib.Tools import ccroot
|
|
|
|
@after_method('process_source')
|
|
@feature('mylink')
|
|
def call_apply_link(self):
|
|
self.apply_link()
|
|
|
|
class mylink(ccroot.link_task):
|
|
run_str = 'cat ${SRC} > ${TGT}'
|
|
|
|
class ext2o(Task):
|
|
run_str = 'cp ${SRC} ${TGT}'
|
|
|
|
@extension('.ext')
|
|
def process_ext(self, node):
|
|
self.create_compiled_task('ext2o', node)
|
|
|
|
|