[LLVMdev] Makefile help needed

Cook, Stephen W. scook at swri.org
Fri Nov 20 16:10:54 PST 2009


Hi all,

I am an LLVM newbie and I am having trouble understanding LLVM's makefile
system for building projects.

I would like to create a customized loadable module to be used as an
optimization pass with LLVM's "opt" program.  My problem is that I would
like to incorporate a parser (built with flex and bison) within the same
loadable module that performs the optimization/transformation pass, and I
need to define (somewhere) typical makefile rules (i.e. target, prereqs,
command) to build the scanner and parser.  The parser's function is to parse
a simple language to guide the transformations.

It seems that the LLVM makefiles (as described in the documentation) simply
find all the (.c, .cpp) files in the current directory in order to create
one library.  The parser cannot be built this way.  How can I define the
makefile rules to build the scanner/parser and the transformation source
(transform.cpp) so that one loadable module will be built?

I have already successfully created a loadable module to perform a
transformation pass using only the transformation source (transform.cpp)
with LLVM's makefile, and it works just fine.  But this is without the
parser.  I have my own customized makefile that creates one object file for
the parser, but I am at a loss as to how to get the parser's object file
incorporated with the transformation object file, and ultimately as one
loadable module.

Any help here would be greatly appreciated. 


Steve Cook
Senior Research Analyst
Communications and Embedded Systems Department
Southwest Research Institute
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4229 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091120/a0a78ceb/attachment.bin>


More information about the llvm-dev mailing list