X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FProjects.html;h=cb7a7c1bcfaa72df570532d54f6321760f9f9378;hb=ebb5a971d903aa4479bb2a21472597319a9b0086;hp=2debb6f7be1bec0fd827e948d248a7bf6c6202cd;hpb=f2413aedb6aca58dc690d81095193307a8df46ff;p=oota-llvm.git diff --git a/docs/Projects.html b/docs/Projects.html index 2debb6f7be1..cb7a7c1bcfa 100644 --- a/docs/Projects.html +++ b/docs/Projects.html @@ -1,221 +1,460 @@ - + -
-- -
- - For example, if the LLVM source tree is in - /usr/home/joe/src/llvm, and you configured it with - --with-objroot=/tmp when his home directory is - /usr/home/joe, then - LLVM_SRC_ROOT=/usr/home/joe/src/llvm and - LLVM_OBJ_ROOT=/tmp/src/llvm. -
- -
- -
- Libraries can be object files, archives, or dynamic libraries. - The lib directory is just a good place for these as it - places them all in a directory from which they can be linked - later on. - -
- By placing your header files in include, they will be - found automatically by the LLVM build system. For example, if - you have a file include/jazz/note.h, then your source - files can include it simply with #include "jazz/note.h". - -
- -
- -
- -
- -
- -
-
- -
- It is highly suggested that you append to these variable as - opposed to overwriting them. The master Makefiles may already - have useful options in them that you may not want to overwrite. -
-
The LLVM build system is designed to facilitate the building of third party +projects that use LLVM header files, libraries, and tools. In order to use +these facilities, a Makefile from a project must do the following things:
+ +There are two ways that you can set all of these variables:
+This document assumes that you will base your project on the LLVM sample +project found in llvm/projects/sample. If you want to devise your own +build system, studying the sample project and LLVM Makefiles will probably +provide enough information on how to write your own Makefiles.
+ +Follow these simple steps to start your project:
+ +% cd autoconf
+ % AutoRegen.sh
You must be using Autoconf version 2.59 or later and your aclocal version +should 1.9 or later.
That's it! Now all you have to do is type gmake (or make +if your on a GNU/Linux system) in the root of your object directory, and your +project should build.
+ +In order to use the LLVM build system, you will want to organize your +source code so that it can benefit from the build system's features. +Mainly, you want your source tree layout to look similar to the LLVM +source tree layout. The best way to do this is to just copy the +project tree from llvm/projects/sample and modify it to meet +your needs, but you can certainly add to it if you want.
+ +Underneath your top level directory, you should have the following +directories:
+ ++ Libraries can be object files, archives, or dynamic libraries. + The lib directory is just a convenient place for libraries + as it places them all in a directory from which they can be linked + later. + +
+ By placing your header files in include, they will be + found automatically by the LLVM build system. For example, if + you have a file include/jazz/note.h, then your source + files can include it simply with #include "jazz/note.h". + +
+ +
+ Currently, the LLVM build system provides basic support for tests. + The LLVM system provides the following: +
Typically, you will want to build your lib directory first followed by +your tools directory.
+ +The LLVM build system provides a convenient way to build libraries and +executables. Most of your project Makefiles will only need to define a few +variables. Below is a list of the variables one can set and what they can +do:
+ ++ +
+ +
+ +
+ +
+ +
+ Note that this works only for statically linked libraries. +
+ +
+ For example, to link libsample.so, you would have the + following line in your Makefile: +
+ + LIBS += -lsample + +
+ +
+ It is highly suggested that you append to CFLAGS and CPPFLAGS as + opposed to overwriting them. The master Makefiles may already + have useful options in them that you may not want to overwrite. +
+
The final location of built libraries and executables will depend upon +whether you do a Debug, Release, or Profile build.
+ ++ +
If you have any questions or need any help creating an LLVM project, +the LLVM team would be more than happy to help. You can always post your +questions to the LLVM Developers +Mailing List.
+ +