You do not have to keep it under llvm src tree. <div><a href="http://llvm.org/docs/Projects.html">http://llvm.org/docs/Projects.html</a> shows how to setup a project outside the src root</div><div>and it applies for writing a Pass. But as first step of practicing, staying inside the src</div>
<div>root will save some efforts.</div><div><br>Not sure about your errors. But one mistake I made is that configure was invokded using </div><div>../llvm-src/configure from llvm-build, and then I put pass in llvm-src. make failed because</div>
<div>the top level is in llvm-build(if I understand it correctly). So I reinvoke ./configure in llvm-src </div><div>to let it re-generate Makefiles. And then it's ok. Hope it helps.</div><div><br></div><div>--</div><div>
Best regards,</div><div>Ryan</div><div><div class="gmail_quote">On Wed, Jul 4, 2012 at 2:27 PM, Arnamoy Bhattacharyya <span dir="ltr"><<a href="mailto:arnamoy@ualberta.ca" target="_blank">arnamoy@ualberta.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi;<div><br></div><div>I wrote an LLVM transformation pass and I put my code inside the llvm-src/lib/Transforms/my-pass directory.  I want to know what is the correct method for compiling it and building my plugin for the pass.  After reading the <a href="http://llvm.org/docs/WritingAnLLVMPass.html" target="_blank">http://llvm.org/docs/WritingAnLLVMPass.html</a> page, I felt that I have to keep my pass inside the above said directory.  But when I run make from inside my-pass directory but I am getting the errors -</div>

<div><br></div><div><div>../../../Makefile.common:60: ../../../Makefile.config: No such file or directory</div><div>../../../Makefile.common:68: /Makefile.rules: No such file or directory</div><div>make: *** No rule to make target `/Makefile.rules'.  Stop.</div>

<div><br></div><div>Which kinds of makes sense as there is no Makefile.config in the llvm-src directory.</div><div><br></div><div>So I tried to place my-pass directory inside the llvm-build/lib/Transforms directory and run make from there.  But got the following error - </div>

<div><br></div><div><div>make: *** No rule to make target `/home/arnie/llvm-development/llvm/lib/Transforms/LoopMem/Makefile', needed by `Makefile'.  Stop.</div></div><div><br></div><div>However, if I configure and build the whole LLVM again (with my pass), it is able to produce the shared library.  Is it the only way to integrate my pass into LLVM?  Because, every time I modify my pass, I have to rebuilt LLVM which takes close to half-an-hour to build?</div>

<div><br></div><div>Thank you;</div><span class="HOEnZb"><font color="#888888">-- <br>Arnamoy Bhattacharyya<br>Athabasca Hall 143<br>Department of Computing Science - University of Alberta<br>Edmonton, Alberta, Canada, T6G 2E8<br>
<a href="tel:587-710-7073" value="+15877107073" target="_blank">587-710-7073</a><br>
</font></span></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>