diff options
author | Josh Blum <josh@joshknows.com> | 2011-04-26 21:55:48 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-04-26 21:55:48 -0700 |
commit | a5e2d9e5baf869ae961fbb5820447290d6d9c7c8 (patch) | |
tree | 41ced4de13a41dd7b05a4e08d1a730cf0f079f7c /volk/gen/make_h.py | |
parent | d941ba31677804fe382d76fca17fc044d12777f5 (diff) |
volk: reorganization of generation sources and generated files
All generation sources have been moved to the gen/ subdirectory.
Bootstrap and volk_register.py generate the files into to gen/ subdirectory
in an effort to cleanly separate the static/generated parts of the build tree.
Define top_gendir in Makefile.common, all generated sources listed in Makefile.ams
are prefixed with $(top_gendir) to differentiate them from static in-tree sources.
Diffstat (limited to 'volk/gen/make_h.py')
-rw-r--r-- | volk/gen/make_h.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/volk/gen/make_h.py b/volk/gen/make_h.py new file mode 100644 index 0000000000..07e62939bd --- /dev/null +++ b/volk/gen/make_h.py @@ -0,0 +1,39 @@ +from xml.dom import minidom +from emit_omnilog import * +from volk_regexp import * + +# http://gcc.gnu.org/wiki/Visibility +volk_api_defines = """ +#ifdef volk_EXPORTS +# define VOLK_API __VOLK_ATTR_EXPORT +#else +# define VOLK_API __VOLK_ATTR_IMPORT +#endif +""" + +def make_h(funclist, arched_arglist) : + tempstring = ""; + tempstring = tempstring + '/*this file is auto generated by make_h.py*/\n'; + + tempstring = tempstring + '\n#ifndef INCLUDED_VOLK_RUNTIME'; + tempstring = tempstring + '\n#define INCLUDED_VOLK_RUNTIME'; + tempstring = tempstring + '\n\n#include<volk/volk_typedefs.h>\n'; + tempstring = tempstring + '#include<volk/volk_config_fixed.h>\n'; + tempstring = tempstring + '#include<volk/volk_attributes.h>\n'; + tempstring = tempstring + '#include<volk/volk_complex.h>\n'; + tempstring = tempstring + volk_api_defines + tempstring = tempstring + emit_prolog(); + + tempstring = tempstring + '\n'; + + for i in range(len(funclist)): + tempstring += "extern " + replace_volk.sub("p", funclist[i]) + " " + funclist[i] + ";\n" + tempstring += "extern VOLK_API void %s_manual%s;\n" % (funclist[i], arched_arglist[i]) + tempstring = strip_trailing(tempstring, " {") + tempstring += "extern VOLK_API struct volk_func_desc %s_get_func_desc(void);\n" % (funclist[i]) + + tempstring = tempstring + emit_epilog(); + tempstring = tempstring + "#endif /*INCLUDED_VOLK_RUNTIME*/\n"; + + return tempstring; + |