llvm.org GIT mirror llvm / e2658d6
Fix some Sphinx mistakes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158711 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 7 years ago
1 changed file(s) with 47 addition(s) and 48 deletion(s). Raw diff Collapse all Expand all
1616 * Set ``make`` variables. There are several variables that a ``Makefile`` needs
1717 to set to use the LLVM build system:
1818
19 * ``PROJECT_NAME`` — The name by which your project is known.
20 * ``LLVM_SRC_ROOT`` — The root of the LLVM source tree.
21 * ``LLVM_OBJ_ROOT`` — The root of the LLVM object tree.
22 * ``PROJ_SRC_ROOT`` — The root of the project's source tree.
23 * ``PROJ_OBJ_ROOT`` — The root of the project's object tree.
24 * ``PROJ_INSTALL_ROOT`` — The root installation directory.
25 * ``LEVEL`` — The relative path from the current directory to the
19 * ``PROJECT_NAME`` - The name by which your project is known.
20 * ``LLVM_SRC_ROOT`` - The root of the LLVM source tree.
21 * ``LLVM_OBJ_ROOT`` - The root of the LLVM object tree.
22 * ``PROJ_SRC_ROOT`` - The root of the project's source tree.
23 * ``PROJ_OBJ_ROOT`` - The root of the project's object tree.
24 * ``PROJ_INSTALL_ROOT`` - The root installation directory.
25 * ``LEVEL`` - The relative path from the current directory to the
2626 project's root ``($PROJ_OBJ_ROOT)``.
2727
2828 * Include ``Makefile.config`` from ``$(LLVM_OBJ_ROOT)``.
6262 #. If you want your project to be configured with the ``configure`` script then
6363 you need to edit ``autoconf/configure.ac`` as follows:
6464
65 * **``AC_INIT``** — Place the name of your project, its version number
66 and a contact email address for your project as the arguments to this macro
65 * **AC_INIT** - Place the name of your project, its version number and a
66 contact email address for your project as the arguments to this macro
6767
68 * **``AC_CONFIG_AUX_DIR``** — If your project isn't in the
69 ``llvm/projects`` directory then you might need to adjust this so that it
70 specifies a relative path to the ``llvm/autoconf`` directory.
71
72 * **``LLVM_CONFIG_PROJECT``** — Just leave this alone.
73
74 * **``AC_CONFIG_SRCDIR``** — Specify a path to a file name that
75 identifies your project; or just leave it at ``Makefile.common.in``.
76
77 * **``AC_CONFIG_FILES``** — Do not change.
78
79 * **``AC_CONFIG_MAKEFILE``** — Use one of these macros for each
80 Makefile that your project uses. This macro arranges for your makefiles to
81 be copied from the source directory, unmodified, to the build directory.
68 * **AC_CONFIG_AUX_DIR** - If your project isn't in the ``llvm/projects``
69 directory then you might need to adjust this so that it specifies a
70 relative path to the ``llvm/autoconf`` directory.
71
72 * **LLVM_CONFIG_PROJECT** - Just leave this alone.
73
74 * **AC_CONFIG_SRCDIR** - Specify a path to a file name that identifies your
75 project; or just leave it at ``Makefile.common.in``.
76
77 * **AC_CONFIG_FILES** - Do not change.
78
79 * **AC_CONFIG_MAKEFILE** - Use one of these macros for each Makefile that
80 your project uses. This macro arranges for your makefiles to be copied from
81 the source directory, unmodified, to the build directory.
8282
8383 #. After updating ``autoconf/configure.ac``, regenerate the configure script
84 with these commands:
84 with these commands. (You must be using ``Autoconf`` version 2.59 or later
85 and your ``aclocal`` version should be 1.9 or later.)
8586
8687 .. code-block:: bash
8788
8889 % cd autoconf
8990 % ./AutoRegen.sh
90
91 You must be using Autoconf version 2.59 or later and your ``aclocal`` version
92 should be 1.9 or later.
9391
9492 #. Run ``configure`` in the directory in which you want to place object code.
9593 Use the following options to tell your project where it can find LLVM:
119117
120118 Underneath your top level directory, you should have the following directories:
121119
122 **``lib``**
120 **lib**
123121
124122 This subdirectory should contain all of your library source code. For each
125 library that you build, you will have one directory in **``lib``** that will
123 library that you build, you will have one directory in **lib** that will
126124 contain that library's source code.
127125
128 Libraries can be object files, archives, or dynamic libraries. The
129 **``lib``** directory is just a convenient place for libraries as it places
130 them all in a directory from which they can be linked later.
131
132 **``include``**
126 Libraries can be object files, archives, or dynamic libraries. The **lib**
127 directory is just a convenient place for libraries as it places them all in
128 a directory from which they can be linked later.
129
130 **include**
133131
134132 This subdirectory should contain any header files that are global to your
135133 project. By global, we mean that they are used by more than one library or
136134 executable of your project.
137135
138 By placing your header files in **``include``**, they will be found
136 By placing your header files in **include**, they will be found
139137 automatically by the LLVM build system. For example, if you have a file
140 **``include/jazz/note.h``**, then your source files can include it simply
141 with **``#include "jazz/note.h"``**.
142
143 **``tools``**
138 **include/jazz/note.h**, then your source files can include it simply with
139 **#include "jazz/note.h"**.
140
141 **tools**
144142
145143 This subdirectory should contain all of your source code for executables.
146 For each program that you build, you will have one directory in
147 **``tools``** that will contain that program's source code.
148
149 **``test``**
144 For each program that you build, you will have one directory in **tools**
145 that will contain that program's source code.
146
147 **test**
150148
151149 This subdirectory should contain tests that verify that your code works
152150 correctly. Automated tests are especially useful.
157155 * LLVM provides a ``tcl`` procedure that is used by ``Dejagnu`` to run tests.
158156 It can be found in ``llvm/lib/llvm-dg.exp``. This test procedure uses ``RUN``
159157 lines in the actual test case to determine how to run the test. See the
160 `TestingGuide`_TestingGuide.html for more details. You can easily write
158 `TestingGuide `_ for more details. You can easily write
161159 Makefile support similar to the Makefiles in ``llvm/test`` to use ``Dejagnu``
162160 to run your project's tests.
163161
170168 testing harness. You will simply need to find a way to use the source
171169 provided within that directory on your own.
172170
173 Typically, you will want to build your **``lib``** directory first followed by
174 your **``tools``** directory.
171 Typically, you will want to build your **lib** directory first followed by your
172 **tools** directory.
175173
176174 Writing LLVM Style Makefiles
177175 ============================
243241
244242 This variable holds a space separated list of libraries that should be
245243 linked into the program. These libraries must be libraries that come from
246 your **``lib``** directory. The libraries must be specified without their
244 your **lib** directory. The libraries must be specified without their
247245 ``lib`` prefix. For example, to link ``libsample.a``, you would set
248246 ``USEDLIBS`` to ``sample.a``.
249247
325323
326324 If you have any questions or need any help creating an LLVM project, the LLVM
327325 team would be more than happy to help. You can always post your questions to
328 the `LLVM Developers Mailing List`_http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev.
326 the `LLVM Developers Mailing List
327 `_.