Debian Codegraph @

doc/samples/cproject.py

raw symbols SCIP
1 DOIT_CONFIG = {'default_tasks': ['link']}
2
3 # map source file to dependencies
4 SOURCE = {
5 'main': ["defs.h"],
6 'kbd': ["defs.h", "command.h"],
7 'command': ["defs.h", "command.h"],
8 }
9
10 def task_link():
11 "create binary program"
12 OBJECTS = ["%s.o" % module for module in SOURCE.keys()]
13 return {'actions': ['cc -o %(targets)s %(dependencies)s'],
14 'file_dep': OBJECTS,
15 'targets': ['edit'],
16 'clean': True
17 }
18
19 def task_compile():
20 "compile C files"
21 for module, dep in SOURCE.items():
22 dependencies = dep + ['%s.c' % module]
23 yield {'name': module,
24 'actions': ["cc -c %s.c" % module],
25 'targets': ["%s.o" % module],
26 'file_dep': dependencies,
27 'clean': True
28 }
29
30 def task_install():
31 "install"
32 return {'actions': ['echo install comes here...'],
33 'task_dep': ['link'],
34 'doc': 'install executable (TODO)'
35 }