aboutsummaryrefslogtreecommitdiffstats
path: root/makewrappers
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2014-04-21 14:58:05 -0500
committerPeter Seebach <peter.seebach@windriver.com>2014-04-21 16:16:23 -0500
commite10d0b6a04e77793bb07541f10ba5b8d82f7221c (patch)
treea434ae374374a73e0e480daa6916d7f865e5f37c /makewrappers
parent0f50814ea2cd21cd5b849dc551e6e39706ff22c0 (diff)
downloadpseudo-e10d0b6a04e77793bb07541f10ba5b8d82f7221c.tar.gz
pseudo-e10d0b6a04e77793bb07541f10ba5b8d82f7221c.tar.bz2
pseudo-e10d0b6a04e77793bb07541f10ba5b8d82f7221c.zip
Automatic dependency checking for wrappers
Ports can provide pseudo_wrappers.c or portdefs.h, and individual functions have implementations. These dependencies aren't known until post-configure. Make the Makefile include two sub-Makefiles which can be updated by makewrappers. Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Diffstat (limited to 'makewrappers')
-rwxr-xr-xmakewrappers17
1 files changed, 16 insertions, 1 deletions
diff --git a/makewrappers b/makewrappers
index e87cc56..992737b 100755
--- a/makewrappers
+++ b/makewrappers
@@ -420,6 +420,9 @@ class Function:
pretty += ' (%s)' % self.comments
return pretty
+ def funcdeps(self):
+ return 'pseudo_wrappers.o: ports/%s/guts/%s.c' % ( self.port, self.name )
+
class Port:
"""
A Port is a set of function declarations and code providing
@@ -497,6 +500,17 @@ additional ports to include.
def define(self):
return '#define PSEUDO_PORT_%s 1' % string.upper(self.name).replace('/', '_')
+ def portdeps(self):
+ deps = []
+ if self.wrappers:
+ deps.append(self.wrappers)
+ if self.portdef_file:
+ deps.append(self.portdef_file)
+ if deps:
+ return 'pseudo_wrappers.o: %s' % ' '.join(deps)
+ else:
+ return '# no extra dependencies for %s.' % self.name
+
def portdefs(self):
if self.portdef_file:
return '#include "%s"' % self.portdef_file
@@ -561,7 +575,8 @@ def main():
for path in glob.glob('templates/*'):
try:
source = TemplateFile(path)
- source.emit('copyright')
+ if source.name.endswith('.c') or source.name.endswith('.h'):
+ source.emit('copyright')
source.emit('header')
sources.append(source)
except IOError: