]> git.donarmstrong.com Git - qmk_firmware.git/blob - LUFA/DoxygenPages/BuildSystem.txt
ef57fcf0c752d9cf39a8764e8346fb822119ae22
[qmk_firmware.git] / LUFA / DoxygenPages / BuildSystem.txt
1 /** \file\r
2  *\r
3  *  This file contains special DoxyGen information for the generation of the main page and other special\r
4  *  documentation pages. It is not a project source file.\r
5  */\r
6 \r
7 /** \page Page_BuildSystem The LUFA Build System\r
8  *\r
9  *  \section Sec_BuildSystem_Overview Overview of the LUFA Build System\r
10  *  The LUFA build system was originally an attempt at making a set of\r
11  *  re-usable, modular build make files which could be referenced in a LUFA\r
12  *  powered project, to minimize the amount of code required in an\r
13  *  application makefile.\r
14  *\r
15  *  As it turned out to be fairly generic in nature, it was split out into its\r
16  *  own separate project, called DMBS (<i>Dean's Makefile Build System</i>)\r
17  *  which is released into the public domain. LUFA-specific portions of the\r
18  *  LUFA build system extend DMBS, and provide a universal build system for all\r
19  *  LUFA projects.\r
20  *\r
21  *  The latest DMBS project information and documentation can be found at:\r
22  *  https://github.com/abcminiuser/dmbs\r
23  *\r
24  *  DMBS is written in GNU Make, and each module is independent of one-another.\r
25  *\r
26  *  LUFA now uses DMBS for its build system, with some LUFA specific extension\r
27  *  modules.\r
28  *\r
29  *  If you have problems building using LUFA, see \subpage Page_BuildTroubleshooting for resolution steps.\r
30  *\r
31  *  \li \subpage Page_BuildModule_LUFA_SOURCES - The LUFA SOURCES extension module for DMBS\r
32  *  \li \subpage Page_BuildModule_LUFA_GCC - The LUFA GCC extension module for DMBS\r
33  */\r
34 \r
35 /** \page Page_BuildModule_LUFA_SOURCES LUFA SOURCES extension module for DMBS\r
36  *\r
37  *  The LUFA SOURCES extension more for DMBS provides LUFA specific variables\r
38  *  listing the various LUFA source files required to be build by a project for\r
39  *  a given LUFA module. This module gives a way to reference LUFA source files\r
40  *  symbolically, so that changes to the library structure do not break the\r
41  *  library makefile.\r
42  *\r
43  *  To use this module in your application makefile, add the following code:\r
44  *  \code\r
45  *  include $(LUFA_PATH)/Build/LUFA/lufa-sources.mk\r
46  *  \endcode\r
47  *\r
48  *  \section SSec_BuildModule_LUFA_SOURCES_Requirements Requirements\r
49  *  None.\r
50  *\r
51  *  \section SSec_BuildModule_LUFA_SOURCES_Targets Targets\r
52  *\r
53  *  <table>\r
54  *   <tr>\r
55  *    <td><i>None</i></td>\r
56  *   </tr>\r
57  *  </table>\r
58  *\r
59  *  \section SSec_BuildModule_LUFA_SOURCES_MandatoryParams Mandatory Parameters\r
60  *\r
61  *  <table>\r
62  *   <tr>\r
63  *    <td><tt>LUFA_PATH</tt></td>\r
64  *    <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>\r
65  *   </tr>\r
66  *   <tr>\r
67  *    <td><tt>ARCH</tt></td>\r
68  *    <td>Architecture of the target processor (see \ref Page_DeviceSupport).</td>\r
69  *   </tr>\r
70  *  </table>\r
71  *\r
72  *  \section SSec_BuildModule_LUFA_SOURCES_OptionalParams Optional Parameters\r
73  *\r
74  *  <table>\r
75  *   <tr>\r
76  *    <td><i>None</i></td>\r
77  *   </tr>\r
78  *  </table>\r
79  *\r
80  *  \section SSec_BuildModule_LUFA_SOURCES_ProvidedVariables Module Provided Variables\r
81  *\r
82  *  <table>\r
83  *   <tr>\r
84  *    <td><tt>LUFA_SRC_USB</tt></td>\r
85  *    <td>List of LUFA USB driver source files.</td>\r
86  *   </tr>\r
87  *   <tr>\r
88  *    <td><tt>LUFA_SRC_USBCLASS</tt></td>\r
89  *    <td>List of LUFA USB Class driver source files.</td>\r
90  *   </tr>\r
91  *   <tr>\r
92  *    <td><tt>LUFA_SRC_TEMPERATURE</tt></td>\r
93  *    <td>List of LUFA temperature sensor driver source files.</td>\r
94  *   </tr>\r
95  *   <tr>\r
96  *    <td><tt>LUFA_SRC_SERIAL</tt></td>\r
97  *    <td>List of LUFA Serial U(S)ART driver source files.</td>\r
98  *   </tr>\r
99  *   <tr>\r
100  *    <td><tt>LUFA_SRC_TWI</tt></td>\r
101  *    <td>List of LUFA TWI driver source files.</td>\r
102  *   </tr>\r
103  *   <tr>\r
104  *    <td><tt>LUFA_SRC_PLATFORM</tt></td>\r
105  *    <td>List of LUFA architecture specific platform management source files.</td>\r
106  *   </tr>\r
107  *  </table>\r
108  *\r
109  *  \section SSec_BuildModule_LUFA_SOURCES_ProvidedMacros Module Provided Macros\r
110  *\r
111  *  <table>\r
112  *   <tr>\r
113  *    <td><i>None</i></td>\r
114  *   </tr>\r
115  *  </table>\r
116  */\r
117 \r
118 /** \page Page_BuildModule_LUFA_GCC LUFA GCC extension module for DMBS\r
119  *\r
120  *  The LUFA GCC extension module for the standard DMBS GCC module extends the\r
121  *  latter to support the compilation of LUFA powered projects. It should be\r
122  *  imported into your LUFA powered project makefiles to ensure that the correct\r
123  *  build settings are used for the project's configuration.\r
124  *\r
125  *  To use this module in your application makefile, add the following code:\r
126  *  \code\r
127  *  include $(LUFA_PATH)/Build/LUFA/lufa-gcc.mk\r
128  *  \endcode\r
129  *\r
130  *  \section SSec_BuildModule_LUFA_GCC_Requirements Requirements\r
131  *  This module should be included in your makefile *after* the DMBS GCC module.\r
132  *\r
133  *  \section SSec_BuildModule_LUFA_GCC_Targets Targets\r
134  *\r
135  *  <table>\r
136  *   <tr>\r
137  *    <td><i>None</i></td>\r
138  *   </tr>\r
139  *  </table>\r
140  *\r
141  *  \section SSec_BuildModule_LUFA_GCC_MandatoryParams Mandatory Parameters\r
142  *\r
143  *  <table>\r
144  *   <tr>\r
145  *    <td><tt>LUFA_PATH</tt></td>\r
146  *    <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>\r
147  *   </tr>\r
148  *  </table>\r
149  *\r
150  *  \section SSec_BuildModule_LUFA_GCC_OptionalParams Optional Parameters\r
151  *\r
152  *  <table>\r
153  *   <tr>\r
154  *    <td><tt>BOARD</tt></td>\r
155  *    <td>LUFA board hardware drivers to use (see \ref Page_DeviceSupport).</td>\r
156  *   </tr>\r
157  *  </table>\r
158  *\r
159  *  \section SSec_BuildModule_LUFA_GCC_ProvidedVariables Module Provided Variables\r
160  *\r
161  *  <table>\r
162  *   <tr>\r
163  *    <td><i>None</i></td>\r
164  *   </tr>\r
165  *  </table>\r
166  *\r
167  *  \section SSec_BuildModule_LUFA_GCC_ProvidedMacros Module Provided Macros\r
168  *\r
169  *  <table>\r
170  *   <tr>\r
171  *    <td><i>None</i></td>\r
172  *   </tr>\r
173  *  </table>\r
174  */\r
175 \r
176 /** \page Page_BuildTroubleshooting Troubleshooting Information\r
177  *\r
178  *  LUFA uses a lot of advanced features of the AVR-GCC compiler, linker, and\r
179  *  surrounding binaries. This can sometimes lead to problems compiling\r
180  *  applications if one of these features is buggy in the version of the tools\r
181  *  used in a build environment. Missing utilities and incorrectly set makefile\r
182  *  configuration options can also result in different errors being produced\r
183  *  when compilation or other operations are attempted. The table below lists a\r
184  *  set of commonly encountered errors and their resolutions.\r
185  *\r
186  *  <table>\r
187  *    <tr>\r
188  *    <th>Problem</th>\r
189  *    <th>Resolution</th>\r
190  *   </tr>\r
191  *   <tr>\r
192  *    <td>Error &quot;<b><tt>relocation truncated to fit: R_AVR_13_PCREL against symbol <i>{X}</i></tt></b>&quot; shown when compiling.</td>\r
193  *    <td>Try compiling with the setting <tt>LINKER_RELAXATIONS=N</tt> in your LUFA Build System 2.0 makefile, or remove the line <tt>-Wl,--relax</tt>\r
194  *        from other makefiles. Alternatively, make sure you have the latest version of the Atmel Toolchain installed for your system.</td>\r
195  *   </tr>\r
196  *   <tr>\r
197  *    <td>Error &quot;<b><tt>error: ld terminated with signal 11 [Segmentation fault]</tt></b>&quot; shown when compiling.</td>\r
198  *    <td>Try compiling with the setting <tt>DEBUG_LEVEL=2</tt> in your LUFA Build System 2.0 makefile, or make sure you are using <tt>binutils</tt> version 2.22 or later.</td>\r
199  *   </tr>\r
200  *   <tr>\r
201  *    <td>Error &quot;<b><tt>EMERGENCY ABORT: INFINITE RECURSION DETECTED</tt></b>&quot; shown when compiling.</td>\r
202  *    <td>Make sure you are using an up to date version of GNU Make when compiling. This error is a safety system added to the mid-level makefiles, to prevent an issue with\r
203  *        GNU make or other variants of Make causing an infinitely recursive build.</td>\r
204  *   </tr>\r
205  *   <tr>\r
206  *    <td>Error &quot;<b><tt>Unsupported architecture &quot;<i>{X}</i>&quot;</tt></b>&quot; shown when compiling.</td>\r
207  *    <td>Ensure your makefile's <tt>ARCH</tt> setting is set to one of the architecture names (case-sensitive) supported by the version of LUFA you are compiling against.</td>\r
208  *   </tr>\r
209  *   <tr>\r
210  *    <td>Error &quot;<b><tt>Makefile <i>{X}</i> value not set</tt></b>&quot; shown when compiling.</td>\r
211  *    <td>The specified Makefile value was not configured in your project's makefile or on the command line, and the nominated setting is required by one or more LUFA\r
212  *        build system modules. Define the value in your project makefile and try again.</td>\r
213  *   </tr>\r
214  *   <tr>\r
215  *    <td>Error &quot;<b><tt>Makefile <i>{X}</i> option cannot be blank</tt></b>&quot; shown when compiling.</td>\r
216  *    <td>The specified Makefile value was configured in your project's makefile or on the command line, but was set to an empty value. For the nominated configuration\r
217  *        option, an empty value is not allowed. Define the nominated setting to a correct non-blank value and try again.</td>\r
218  *   </tr>\r
219  *   <tr>\r
220  *    <td>Error &quot;<b><tt>Makefile <i>{X}</i> option must be Y or N</tt></b>&quot; shown when compiling.</td>\r
221  *    <td>The specified Makefile value was configured in your project's makefile or on the command line, but was set to a value other than a Y (for "Yes") or "N" (for "No").\r
222  *        This configuration option is required to be one of the aforementioned boolean values, and other values are invalid. Set this option to either Y or N and try again.</td>\r
223  *   </tr>\r
224  *   <tr>\r
225  *    <td>Error &quot;<b><tt>Unknown input source file formats: <i>{X}</i></tt></b>&quot; shown when compiling.</td>\r
226  *    <td>The nominated source files, specified in your project's makefile in the <tt>SRC</tt> configuration option, has an extension that the LUFA build system does not\r
227  *        recognise. The file extensions are case sensitive, and must be one of the supported formats (<tt>*.c</tt>, <tt>*.cpp</tt> or <tt>*.S</tt>).</td>\r
228  *   </tr>\r
229  *   <tr>\r
230  *    <td>Error &quot;<b><tt>Cannot build with OBJDIR parameter set - one or more object file name is not unique</tt></b>&quot; shown when compiling.</td>\r
231  *    <td>When a project is built with a non-empty <tt>OBJDIR</tt> object directory name set, all input source files must have unique names, excluding extension and path.\r
232  *        This means that input files that are named identically and differ only by their path or extension are invalid when this mode is used.</td>\r
233  *   </tr>\r
234  *   <tr>\r
235  *    <td>Error &quot;<b><tt>Source file does not exist: <i>{X}</i></tt></b>&quot; shown when compiling.</td>\r
236  *    <td>The nominated input source file, specified in the user project's <tt>SRC</tt> parameter, could not be found. Ensure the source file exists and the absolute or\r
237  *        relative path given in the user project makefile is correct and try again.</td>\r
238  *   </tr>\r
239  *   <tr>\r
240  *    <td>Error &quot;<b><tt>Doxygen configuration file <i>{X}</i> does not exist</tt></b>&quot; shown when upgrading a Doxygen configuration file.</td>\r
241  *    <td>The nominated Doxygen configuration file, specified in the user project's <tt>DOXYGEN_CONF</tt> parameter, could not be found. Ensure the configuration file exists\r
242  *        and the absolute or relative path given in the user project makefile is correct and try again, or run the appropriate makefile target to generate a new configuration\r
243  *        file.</td>\r
244  *   </tr>\r
245  *   <tr>\r
246  *    <td>Error &quot;<b><tt>avr-gcc: error: unrecognized option '<i>{X}</i>'</tt></b>&quot; shown when compiling.</td>\r
247  *    <td>An unrecognised option was supplied to the compiler, usually in the <tt>C_FLAGS</tt>, <tt>CPP_FLAGS</tt>, <tt>ASM_FLAGS</tt> or <tt>CC_FLAGS</tt> configuration\r
248  *        options. The nominated compiler switch may be invalid, or unsupported by the version of AVR-GCC on the host system. Remove the unrecognised flag if invalid, or\r
249  *        upgrade to the latest AVR-GCC. If the option is a valid linker option, use the prefix "-Wl," to ensure it is passed to the linker correctly.</td>\r
250  *   </tr>\r
251  *   <tr>\r
252  *    <td>Error &quot;<b><tt>makefile:{X}: {Y}.mk: No such file or directory</tt></b>&quot; shown when make is invoked.</td>\r
253  *    <td>The path to the nominated makefile module was incorrect. This usually indicates that the makefile <tt>LUFA_PATH</tt> option is not set to a valid relative or\r
254  *        absolute path to the LUFA library core.</td>\r
255  *   </tr>\r
256  *   <tr>\r
257  *    <td>Error &quot;<b><tt>fatal error: LUFAConfig.h: No such file or directory</tt></b>&quot; shown when compiling.</td>\r
258  *    <td>The <tt>USE_LUFA_CONFIG_HEADER</tt> compile time option was set in the user project makefile, but the user supplied <tt>LUFAConfig.h</tt> header could not be\r
259  *        found. Ensure that the directory that contains this configuration file is correctly passed to the compiler via the -I switch in the makefile <tt>CC_FLAGS</tt>\r
260  *        parameter.</td>\r
261  *   </tr>\r
262  *   <tr>\r
263  *    <td>Error &quot;<b><tt>ld.exe: section .apitable_trampolines loaded at <i>{X}</i> overlaps section .text</tt></b>&quot; shown when compiling a bootloader.</td>\r
264  *    <td>The bootloader is compiling too large for the given <tt>FLASH_SIZE_KB</tt> and <tt>BOOT_SECTION_SIZE_KB</tt> parameters set in the bootloader makefile. This\r
265  *        usually indicates that these values are incorrect for the specified device the bootloader is targeting. If these values are correct, a newer version of the\r
266  *        compiler may need to be used to ensure that the bootloader is built within the section size constraints of the target device.</td>\r
267  *   </tr>\r
268  *   <tr>\r
269  *    <td>Error &quot;<b><tt>unknown MCU '<i>{X}</i>' specified</tt></b>&quot; shown when compiling.</td>\r
270  *    <td>The specified microcontroller device model name set in the user application's makefile as the <tt>MCU</tt> parameter is incorrect, or unsupported by the\r
271  *        version of the compiler being used. Make sure the model name is correct, or upgrade to the latest Atmel Toolchain to obtain newer device support.</td>\r
272  *   </tr>\r
273  *   <tr>\r
274  *    <td>Error &quot;<b><tt>undefined reference to `<i>{X}</i>'</tt></b>&quot; shown when compiling.</td>\r
275  *    <td>This is usually caused by a missing source file in the user application's <tt>SRC</tt> configuration parameter. If the indicated symbol is one from the LUFA\r
276  *        library, you may be missing a LUFA source makefile module (see \ref Page_BuildModule_LUFA_SOURCES).</td>\r
277  *   </tr>\r
278  *  </table>\r
279  *\r
280  *  For troubleshooting other errors you encounter, please see \ref Sec_ProjectHelp.\r
281  */\r