diff --git a/utils/lib/python/soclib-cc-main.py b/utils/lib/python/soclib-cc-main.py
index 311c133..9d35f35 100644
a
|
b
|
def main(): |
130 | 130 | action='store', nargs = 1, |
131 | 131 | help="Auto report bug. Methods allowed: openbrowser, *none", |
132 | 132 | choices = ("openbrowser", "none")) |
| 133 | parser.add_option('--cflags', dest = 'cflags', |
| 134 | action='store_true', |
| 135 | help="Print software include directories C flags") |
133 | 136 | parser.set_defaults(auto_bug_report = "none", |
134 | 137 | includes = []) |
135 | 138 | opts, args = parser.parse_args() |
… |
… |
todo = Platform( |
275 | 278 | fd.close() |
276 | 279 | elif opts.clean: |
277 | 280 | todo.clean() |
| 281 | elif opts.cflags: |
| 282 | todo.printCflags() |
278 | 283 | else: |
279 | 284 | todo.process() |
280 | 285 | elif opts.compile: |
diff --git a/utils/lib/python/soclib_cc/platform.py b/utils/lib/python/soclib_cc/platform.py
index 4fb6e8a..da4a762 100644
a
|
b
|
class Platform: |
67 | 67 | component = Specialization( |
68 | 68 | Source(mode, source_file, uses, defines, **params), |
69 | 69 | **params) |
| 70 | self.component = component |
70 | 71 | self.todo = ToDo() |
71 | 72 | self.objs = set() |
72 | 73 | # component.printAllUses() |
… |
… |
class Platform: |
87 | 88 | def genMakefile(self): |
88 | 89 | return self.todo.genMakefile() |
89 | 90 | |
| 91 | def printCflags(self): |
| 92 | paths = set([]) |
| 93 | for mod in self.component.getSubTree(): |
| 94 | isAddressable = False |
| 95 | for ext in mod.getExtensions(): |
| 96 | if ext[0:16] == 'dsx:addressable=': |
| 97 | isAddressable = True |
| 98 | break |
| 99 | if isAddressable: |
| 100 | for file in mod.getHeaderFiles(): |
| 101 | paths.add(os.path.realpath(os.path.dirname(file))) |
| 102 | print ' '.join(map(lambda x: '-I'+x, paths)) |
| 103 | |
90 | 104 | def __repr__(self): |
91 | 105 | import pprint |
92 | 106 | return '%s(%r, %r,\n%s, %r, %r)'%( |