X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=docs%2FProjects.html;h=cb7a7c1bcfaa72df570532d54f6321760f9f9378;hb=ebb5a971d903aa4479bb2a21472597319a9b0086;hp=a6527b0402f6b87fe8f32426599e15580688c3fe;hpb=733adcbaa93ca3cfb5e6e885be923a3df36f3e18;p=oota-llvm.git diff --git a/docs/Projects.html b/docs/Projects.html index a6527b0402f..cb7a7c1bcfa 100644 --- a/docs/Projects.html +++ b/docs/Projects.html @@ -1,391 +1,460 @@ - + -
-- There are several environment variables that a Makefile needs to set to - use the LLVM build system: -
- -
- -
- -
- -
- -
- -
-
- -
- - -
- -
- -
- After updating autoconf/configure.ac, regenerate the - configure script with these commands: -
-
- cd autoconf
- autoconf -o ../configure
-
-
-
- - You must be using Autoconf version 2.57 or higher. -
- -
-
- 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 little support for tests, - although some exists. Expanded support for tests will hopefully - occur in the future. In the meantime, the LLVM system does provide the - following: -
- -
- Currently, there is no way to hook your tests directly into the - llvm/test/Programs testing harness. You will simply - need to find a way to use the source provided within that directory - on your own. -
- -
- -
- -
- -
- -
- 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 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.
+ +