LLVM, When we recompile, is it possible to "make" only one of the tools, or at least relink only the tools whose object files have changed? Thanks Dave
On Sun, Sep 07, 2003 at 11:45:20PM -0500, David Crowe wrote:> When we recompile, is it possible to "make" only one of the tools, or > at least relink only the tools whose object files have changed?Absolutely: % cd ~/llvm/lib % make # this (re-)compiles all the libraries % cd ~/llvm/tools/lli % make # re-link the tool IF any of its libraries changed In fact, you can go into ANY subdirectory and just re-run make there. Also, you might want to know about this neat `makellvm' script that's in `llvm/utils'. It provides an easy way of doing the above 4 steps in one command. For example, let's say you're working on the Sparc JIT, so you are in the directory llvm/lib/Target/Sparc, where you modified some files. Now you want to recompile the Sparc library, and relink lli. llvm/lib/target/Sparc% ../../../utils/makellvm lli That's it! For more options, run `makellvm -h', and you can also add the directory `llvm/utils' to your path so you can just call: llvm/lib/target/Sparc% makellvm lli Hope that helps. -- Misha Brukman :: http://misha.brukman.net
I should point out something I missed the first time... On Sun, Sep 07, 2003 at 11:45:20PM -0500, David Crowe wrote:> When we recompile, is it possible to "make" only one of the tools,This I answered in the previous email.> or at least relink only the tools whose object files have changed?This is the default behavior: make looks at timestamps of the object files, and if any of them are newer than the tool binary, that means a library changed and the tool needs to be re-linked. In other words, if you *ALWAYS* run a top-level make, you will ONLY relink those tools whose libraries (object files) have changed. However, given that the tools share the common libraries, changing a single file *may* force a re-linking of several tools if you do a top-level make. In this case, please see the previous email about the `makellvm' script. Hope that answers your question. -- Misha Brukman :: http://misha.brukman.net