Add Build System documentation to the library manual. Update CPPCHECK build system...
[pub/USBasp.git] / LUFA / Build / BuildSystem.txt
1 /** \file
2 *
3 * This file contains special DoxyGen information for the generation of the main page and other special
4 * documentation pages. It is not a project source file.
5 */
6
7 /** \page Page_BuildSystem The LUFA Build System
8 *
9 * \section Sec_BuildSystemOverview Overview of the LUFA Build System
10 * The LUFA build system is an attempt at making a set of re-usable, modular build make files which
11 * can be referenced in a LUFA powered project, to minimise the amount of code required in an
12 * application makefile. The system is written in GNU Make, and each module is independant of
13 * one-another.
14 *
15 * To use a LUFA build system module, simply add an include to your project makefile:
16 * \code
17 * include $(LUFA_PATH)/Build/lufa.core.in
18 * \endcode
19 *
20 * And the associated build module targets will be added to your project's build makefile automatically.
21 * To call a build target, run <tt>make {TARGET_NAME}</tt> from the command line, substituting in
22 * the appropriate target name.
23 *
24 * \see \ref Sec_AppConfigParams for a copy of the sample LUFA project makefile.
25 *
26 * Each build module may have one or more mandatory parameters (GNU Make variables) which <i>must</i>
27 * be supplied in the project makefile for the module to work, and one or more optional parameters which
28 * may be defined and which will assume a sensible default if not.
29 *
30 * \section SSec_BuildSystemModules Available Modules
31 *
32 * The following modules are included in this LUFA release:
33 *
34 * \li \subpage Page_BuildModule_ATPROGRAM - Device Programming
35 * \li \subpage Page_BuildModule_AVRDUDE - Device Programming
36 * \li \subpage Page_BuildModule_BUILD - Compiling/Assembling/Linking
37 * \li \subpage Page_BuildModule_CORE - Core Build System Functions
38 * \li \subpage Page_BuildModule_CPPCHECK - Static Code Analysis
39 * \li \subpage Page_BuildModule_DFU - Device Programming
40 * \li \subpage Page_BuildModule_DOXYGEN - Automated Source Code Documentation
41 * \li \subpage Page_BuildModule_SOURCES - LUFA Module Source Code Variables
42 */
43
44 /** \page Page_BuildModule_BUILD The BUILD build module
45 *
46 * The BUILD LUFA build system module, providing targets for the compilation,
47 * assembling and linking of an application from source code into binary files
48 * suitable for programming into a target device.
49 *
50 * To use this module in your application makefile, add the following code:
51 * \code
52 * include $(LUFA_PATH)/Build/lufa.build.in
53 * \endcode
54 *
55 * \section SSec_BuildModule_BUILD_Requirements Requirements
56 * This module requires the the architecture appropriate binaries of the GCC compiler are available in your
57 * system's <b>PATH</b> variable. The GCC compiler and associated toolchain is distributed in Atmel AVR Studio
58 * 5.x and Atmel Studio 6.x installation directories, as well as in many third party distribution packages.
59 *
60 * \section SSec_BuildModule_BUILD_Targets Targets
61 *
62 * <table>
63 * <tr>
64 * <td><tt>size</tt></td>
65 * <td>Display size of the compiled application FLASH and SRAM segments.</td>
66 * </tr>
67 * <tr>
68 * <td><tt>symbol-sizes</tt></td>
69 * <td>Display a size-sorted list of symbols from the compiled application, in decimal bytes.</td>
70 * </tr>
71 * <tr>
72 * <td><tt>all</tt></td>
73 * <td>Build and link the application into ELF debug and HEX binary files.</td>
74 * </tr>
75 * <tr>
76 * <td><tt>elf</tt></td>
77 * <td>Build and link the application into an ELF debug file.</td>
78 * </tr>
79 * <tr>
80 * <td><tt>hex</tt></td>
81 * <td>Build and link the application and produce HEX and EEP binary files.</td>
82 * </tr>
83 * <tr>
84 * <td><tt>lss</tt></td>
85 * <td>Build and link the application and produce a LSS source code/assembly code mixed listing file.</td>
86 * </tr>
87 * <tr>
88 * <td><tt>clean</tt></td>
89 * <td>Remove all intermediatary files and binary output files.</td>
90 * </tr>
91 * </table>
92 *
93 * \section SSec_BuildModule_BUILD_MandatoryParams Mandatory Parameters
94 *
95 * <table>
96 * <tr>
97 * <td><tt>TARGET</tt></td>
98 * <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
99 * </tr>
100 * <tr>
101 * <td><tt>ARCH</tt></td>
102 * <td>Architecture of the target processor (see \ref Page_DeviceSupport).</td>
103 * </tr>
104 * <tr>
105 * <td><tt>MCU</tt></td>
106 * <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
107 * </tr>
108 * <tr>
109 * <td><tt>SRC</tt></td>
110 * <td>List of relative or absolute paths to the application C (.c), C++ (.cpp) and Assembly (.S) source files.</td>
111 * </tr>
112 * <tr>
113 * <td><tt>F_USB</tt></td>
114 * <td>Speed in Hz of the input clock frequency to the target's USB controller.</td>
115 * </tr>
116 * <tr>
117 * <td><tt>LUFA_PATH</tt></td>
118 * <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>
119 * </tr>
120 * </table>
121 *
122 * \section SSec_BuildModule_BUILD_OptionalParams Optional Parameters
123 *
124 * <table>
125 * <tr>
126 * <td><tt>BOARD</tt></td>
127 * <td>LUFA board hardware drivers to use (see \ref Page_DeviceSupport).</td>
128 * </tr>
129 * <tr>
130 * <td><tt>OPTIMIZATION</tt></td>
131 * <td>Optimization level to use when compiling source files (see GCC manual).</td>
132 * </tr>
133 * <tr>
134 * <td><tt>C_STANDARD</tt></td>
135 * <td>Version of the C standard to apply when compiling C++ source files (see GCC manual).</td>
136 * </tr>
137 * <tr>
138 * <td><tt>CPP_STANDARD</tt></td>
139 * <td>Version of the C++ standard to apply when compiling C++ source files (see GCC manual).</td>
140 * </tr>
141 * <tr>
142 * <td><tt>F_CPU</tt></td>
143 * <td>Speed of the processor CPU clock, in Hz.</td>
144 * </tr>
145 * <tr>
146 * <td><tt>C_FLAGS</tt></td>
147 * <td>Flags to pass to the C compiler only, after the automatically generated flags.</td>
148 * </tr>
149 * <tr>
150 * <td><tt>CPP_FLAGS</tt></td>
151 * <td>Flags to pass to the C++ compiler only, after the automatically generated flags.</td>
152 * </tr>
153 * <tr>
154 * <td><tt>ASM_FLAGS</tt></td>
155 * <td>Flags to pass to the assembler only, after the automatically generated flags.</td>
156 * </tr>
157 * <tr>
158 * <td><tt>CC_FLAGS</tt></td>
159 * <td>Common flags to pass to the compiler, assembler and linker, after the automatically generated flags.</td>
160 * </tr>
161 * <tr>
162 * <td><tt>LD_FLAGS</tt></td>
163 * <td>Flags to pass to the linker, after the automatically generated flags.</td>
164 * </tr>
165 * </table>
166 */
167
168 /** \page Page_BuildModule_CORE The CORE build module
169 *
170 * The core LUFA build system module, providing common build system help and information targets.
171 *
172 * To use this module in your application makefile, add the following code:
173 * \code
174 * include $(LUFA_PATH)/Build/lufa.core.in
175 * \endcode
176 *
177 * \section SSec_BuildModule_CORE_Requirements Requirements
178 * This module has no requirements outside a standard *nix shell like environment; the <tt>sh</tt>
179 * shell, GNU <tt>make</tt> and *nix CoreUtils (<tt>echo</tt>, <tt>printf</tt>, etc.).
180 *
181 * \section SSec_BuildModule_CORE_Targets Targets
182 *
183 * <table>
184 * <tr>
185 * <td><tt>help</tt></td>
186 * <td>Display build system help and configuration information.</td>
187 * </tr>
188 * <tr>
189 * <td><tt>list_targets</tt></td>
190 * <td>List all available build targets from the build system.</td>
191 * </tr>
192 * <tr>
193 * <td><tt>list_modules</tt></td>
194 * <td>List all available build modules from the build system.</td>
195 * </tr>
196 * <tr>
197 * <td><tt>list_mandatory</tt></td>
198 * <td>List all mandatory parameters required by the included modules.</td>
199 * </tr>
200 * <tr>
201 * <td><tt>list_optional</tt></td>
202 * <td>List all optional parameters required by the included modules.</td>
203 * </tr>
204 * </table>
205 *
206 * \section SSec_BuildModule_CORE_MandatoryParams Mandatory Parameters
207 *
208 * <table>
209 * <tr>
210 * <td><i>None</i></td>
211 * </tr>
212 * </table>
213 *
214 * \section SSec_BuildModule_CORE_OptionalParams Optional Parameters
215 *
216 * <table>
217 * <tr>
218 * <td><i>None</i></td>
219 * </tr>
220 * </table>
221 */
222
223 /** \page Page_BuildModule_ATPROGRAM The ATPROGRAM build module
224 *
225 * The ATPROGRAM programming utility LUFA build system module, providing targets to reprogram an
226 * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.
227 *
228 * To use this module in your application makefile, add the following code:
229 * \code
230 * include $(LUFA_PATH)/Build/lufa.atprogram.in
231 * \endcode
232 *
233 * \section SSec_BuildModule_ATPROGRAM_Requirements Requirements
234 * This module requires the <tt>atprogram.exe</tt> utility to be available in your system's <b>PATH</b>
235 * variable. The <tt>atprogram.exe</tt> utility is distributed in Atmel AVR Studio 5.x and Atmel Studio 6.x
236 * inside the application install folder's "\avrdbg" subdirectory.
237 *
238 * \section SSec_BuildModule_ATPROGRAM_Targets Targets
239 *
240 * <table>
241 * <tr>
242 * <td><tt>atprogram</tt></td>
243 * <td>Program the device FLASH memory with the application's executable data.</td>
244 * </tr>
245 * <tr>
246 * <td><tt>atprogram-ee</tt></td>
247 * <td>Program the device EEPROM memory with the application's EEPROM data.</td>
248 * </tr>
249 * </table>
250 *
251 * \section SSec_BuildModule_ATPROGRAM_MandatoryParams Mandatory Parameters
252 *
253 * <table>
254 * <tr>
255 * <td><tt>MCU</tt></td>
256 * <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
257 * </tr>
258 * <tr>
259 * <td><tt>TARGET</tt></td>
260 * <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
261 * </tr>
262 * </table>
263 *
264 * \section SSec_BuildModule_ATPROGRAM_OptionalParams Optional Parameters
265 *
266 * <table>
267 * <tr>
268 * <td><tt>ATPROGRAM_PROGRAMMER</tt></td>
269 * <td>Name of the Atmel programmer or debugger tool to communicate with (e.g. <tt>jtagice3</tt>).</td>
270 * </tr>
271 * <tr>
272 * <td><tt>ATPROGRAM_INTERFACE</tt></td>
273 * <td>Name of the programming interface to use when programming the target (e.g. <tt>spi</tt>).</td>
274 * </tr>
275 * <tr>
276 * <td><tt>ATPROGRAM_PORT</tt></td>
277 * <td>Name of the communication port to use when when programming with a serially connected tool (e.g. <tt>COM2</tt>).</td>
278 * </tr>
279 * </table>
280 */
281
282 /** \page Page_BuildModule_AVRDUDE The AVRDUDE build module
283 *
284 * The AVRDUDE programming utility LUFA build system module, providing targets to reprogram an
285 * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.
286 *
287 * To use this module in your application makefile, add the following code:
288 * \code
289 * include $(LUFA_PATH)/Build/lufa.avrdude.in
290 * \endcode
291 *
292 * \section SSec_BuildModule_AVRDUDE_Requirements Requirements
293 * This module requires the <tt>avrdude</tt> utility to be available in your system's <b>PATH</b>
294 * variable. The <tt>avrdude</tt> utility is distributed in the old WinAVR project releases for
295 * Windows (<a>winavr.sourceforge.net</a>) or can be installed on *nix systems via the project's
296 * source code (<a>https://savannah.nongnu.org/projects/avrdude</a>) or through the package manager.
297 *
298 * \section SSec_BuildModule_AVRDUDE_Targets Targets
299 *
300 * <table>
301 * <tr>
302 * <td><tt>avrdude</tt></td>
303 * <td>Program the device FLASH memory with the application's executable data.</td>
304 * </tr>
305 * <tr>
306 * <td><tt>avrdude</tt></td>
307 * <td>Program the device EEPROM memory with the application's EEPROM data.</td>
308 * </tr>
309 * </table>
310 *
311 * \section SSec_BuildModule_AVRDUDE_MandatoryParams Mandatory Parameters
312 *
313 * <table>
314 * <tr>
315 * <td><tt>MCU</tt></td>
316 * <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
317 * </tr>
318 * <tr>
319 * <td><tt>TARGET</tt></td>
320 * <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
321 * </tr>
322 * </table>
323 *
324 * \section SSec_BuildModule_AVRDUDE_OptionalParams Optional Parameters
325 *
326 * <table>
327 * <tr>
328 * <td><tt>AVRDUDE_PROGRAMMER</tt></td>
329 * <td>Name of the programmer or debugger tool to communicate with (e.g. <tt>jtagicemkii</tt>).</td>
330 * </tr>
331 * <tr>
332 * <td><tt>ATPROGRAM_PORT</tt></td>
333 * <td>Name of the communication port to use when when programming with the connected tool (e.g. <tt>COM2</tt>, <tt>/dev/ttyUSB0</tt> or <tt>usb</tt>).</td>
334 * </tr>
335 * <tr>
336 * <td><tt>ATPROGRAM_FLAGS</tt></td>
337 * <td>Additional flags to pass to avrdude when programming, applied after the automatically generated flags.</td>
338 * </tr>
339 * </table>
340 */
341
342 /** \page Page_BuildModule_CPPCHECK The CPPCHECK build module
343 *
344 * The CPPCHECK programming utility LUFA build system module, providing targets to statically
345 * analyze C and C++ source code for errors and performance/style issues.
346 *
347 * To use this module in your application makefile, add the following code:
348 * \code
349 * include $(LUFA_PATH)/Build/lufa.cppcheck.in
350 * \endcode
351 *
352 * \section SSec_BuildModule_CPPCHECK_Requirements Requirements
353 * This module requires the <tt>cppcheck</tt> utility to be available in your system's <b>PATH</b>
354 * variable. The <tt>cppcheck</tt> utility is distributed through the project's home page
355 * (<a>http://cppcheck.sourceforge.net</a>) for Windows, and can be installed on *nix systems via
356 * the project's source code or through the package manager.
357 *
358 * \section SSec_BuildModule_CPPCHECK_Targets Targets
359 *
360 * <table>
361 * <tr>
362 * <td><tt>cppcheck</tt></td>
363 * <td>Statically analyze the project source code for issues.</td>
364 * </tr>
365 * <tr>
366 * <td><tt>cppcheck-config</tt></td>
367 * <td>Check the <tt>cppcheck</tt> configuration - scan source code and warn about missing header files and other issues.</td>
368 * </tr>
369 * </table>
370 *
371 * \section SSec_BuildModule_CPPCHECK_MandatoryParams Mandatory Parameters
372 *
373 * <table>
374 * <tr>
375 * <td><tt>SRC</tt></td>
376 * <td>List of source files to statically analyze.</td>
377 * </tr>
378 * </table>
379 *
380 * \section SSec_BuildModule_CPPCHECK_OptionalParams Optional Parameters
381 *
382 * <table>
383 * <tr>
384 * <td><tt>CPPCHECK_INCLUDES</tt></td>
385 * <td>Path of extra directories to check when attemting to resolve C/C++ header file includes.</td>
386 * </tr>
387 * <tr>
388 * <td><tt>CPPCHECK_EXCLUDES</tt></td>
389 * <td>Paths or path fragments to exclude when analyzing.</td>
390 * </tr>
391 * <tr>
392 * <td><tt>CPPCHECK_MSG_TEMPLATE</tt></td>
393 * <td>Output message template to use when printing errors, warnings and information (see <tt>cppcheck</tt> documentation).</td>
394 * </tr>
395 * <tr>
396 * <td><tt>CPPCHECK_ENABLE</tt></td>
397 * <td>Analysis rule categories to enable (see <tt>cppcheck</tt> documentation).</td>
398 * </tr>
399 * <tr>
400 * <td><tt>CPPCHECK_SUPPRESS</tt></td>
401 * <td>Specific analysis rules to suppress (see <tt>cppcheck</tt> documentation).</td>
402 * </tr>
403 * <tr>
404 * <td><tt>CPPCHECK_FAIL_ON_WARNING</tt></td>
405 * <td>Set to <b>Y</b> to fail the analysis job with an error exit code if warnings are found, <b>N</b> to continue without failing.</td>
406 * </tr>
407 * <tr>
408 * <td><tt>CPPCHECK_QUIET</tt></td>
409 * <td>Set to <b>Y</b> to suppress all output except warnings and errors, <b>N</b> to show verbose output information.</td>
410 * </tr>
411 * <tr>
412 * <td><tt>CPPCHECK_FLAGS</tt></td>
413 * <td>Extra flags to pass to <tt>cppcheck</tt>, after the automatically generated flags.</td>
414 * </tr>
415 * </table>
416 */
417
418 /** \page Page_BuildModule_DFU The DFU build module
419 *
420 * The DFU programming utility LUFA build system module, providing targets to reprogram an
421 * Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.
422 * This module requires a DFU class bootloader to be running in the target.
423 *
424 * To use this module in your application makefile, add the following code:
425 * \code
426 * include $(LUFA_PATH)/Build/lufa.dfu.in
427 * \endcode
428 *
429 * \section SSec_BuildModule_DFU_Requirements Requirements
430 * This module requires either the <tt>batchisp</tt> utility from Atmel's FLIP utility, or the open
431 * source <tt>dfu-programmer</tt> utility (<a>http://dfu-programmer.sourceforge.net/</a>) to be
432 * available in your system's <b>PATH</b> variable. On *nix systems the <tt>dfu-programmer</tt> utility
433 * can be installed via the project's source code or through the package manager.
434 *
435 * \section SSec_BuildModule_DFU_Targets Targets
436 *
437 * <table>
438 * <tr>
439 * <td><tt>dfu</tt></td>
440 * <td>Program the device FLASH memory with the application's executable data using <tt>dfu-programmer</tt>.</td>
441 * </tr>
442 * <tr>
443 * <td><tt>dfu-ee</tt></td>
444 * <td>Program the device EEPROM memory with the application's EEPROM data using <tt>dfu-programmer</tt>.</td>
445 * </tr>
446 * <tr>
447 * <td><tt>flip</tt></td>
448 * <td>Program the device FLASH memory with the application's executable data using <tt>batchisp</tt>.</td>
449 * </tr>
450 * <tr>
451 * <td><tt>flip-ee</tt></td>
452 * <td>Program the device EEPROM memory with the application's EEPROM data using <tt>batchisp</tt>.</td>
453 * </tr>
454 * </table>
455 *
456 * \section SSec_BuildModule_DFU_MandatoryParams Mandatory Parameters
457 *
458 * <table>
459 * <tr>
460 * <td><tt>MCU</tt></td>
461 * <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
462 * </tr>
463 * <tr>
464 * <td><tt>TARGET</tt></td>
465 * <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
466 * </tr>
467 * </table>
468 *
469 * \section SSec_BuildModule_DFU_OptionalParams Optional Parameters
470 *
471 * <table>
472 * <tr>
473 * <td><i>None</i></td>
474 * </tr>
475 * </table>
476 */
477
478 /** \page Page_BuildModule_DOXYGEN The DOXYGEN build module
479 *
480 * The DOXYGEN code documentation utility LUFA build system module, providing targets to generate
481 * project HTML and other format documentation from a set of source files that include special
482 * Doxygen comments.
483 *
484 * To use this module in your application makefile, add the following code:
485 * \code
486 * include $(LUFA_PATH)/Build/lufa.doxygen.in
487 * \endcode
488 *
489 * \section SSec_BuildModule_DOXYGEN_Requirements Requirements
490 * This module requires the <tt>doxygen</tt> utility from the Doxygen website
491 * (<a>http://www.stack.nl/~dimitri/doxygen/</a>) to be available in your system's <b>PATH</b>
492 * variable. On *nix systems the <tt>doxygen</tt> utility can be installed via the project's source
493 * code or through the package manager.
494 *
495 * \section SSec_BuildModule_DOXYGEN_Targets Targets
496 *
497 * <table>
498 * <tr>
499 * <td><tt>doxygen</tt></td>
500 * <td>Generate project documentation.</td>
501 * </tr>
502 * </table>
503 *
504 * \section SSec_BuildModule_DOXYGEN_MandatoryParams Mandatory Parameters
505 *
506 * <table>
507 * <tr>
508 * <td><tt>LUFA_PATH</tt></td>
509 * <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>
510 * </tr>
511 * </table>
512 *
513 * \section SSec_BuildModule_DOXYGEN_OptionalParams Optional Parameters
514 *
515 * <table>
516 * <tr>
517 * <td><tt>DOXYGEN_CONF</tt></td>
518 * <td>Name and path of the base Doxygen configuration file for the project.</td>
519 * </tr>
520 * <tr>
521 * <td><tt>DOXYGEN_FAIL_ON_WARNING</tt></td>
522 * <td>Set to <b>Y</b> to fail the generation with an error exit code if warnings are found other than unsupported configuration parameters, <b>N</b> to continue without failing.</td>
523 * </tr>
524 * <tr>
525 * <td><tt>DOXYGEN_OVERRIDE_PARAMS</tt></td>
526 * <td>Extra Doxygen configuration parameters to apply, overriding the corresponding config entry in the project's configuration file (e.g. <tt>QUIET=YES</tt>).</td>
527 * </tr>
528 * </table>
529 */
530
531 /** \page Page_BuildModule_SOURCES The SOURCES build module
532 *
533 * The SOURCES LUFA build system module, providing variables listing the various LUFA source files
534 * required to be build by a project for a given LUFA module. This module gives a way to reference
535 * LUFA source files symbollically, so that changes to the library structure do not break the library
536 * makefile.
537 *
538 * To use this module in your application makefile, add the following code:
539 * \code
540 * include $(LUFA_PATH)/Build/lufa.sources.in
541 * \endcode
542 *
543 * \section SSec_BuildModule_SOURCES_Requirements Requirements
544 * None.
545 *
546 * \section SSec_BuildModule_SOURCES_Targets Targets
547 *
548 * <table>
549 * <tr>
550 * <td><i>None</i></td>
551 * </tr>
552 * </table>
553 *
554 * \section SSec_BuildModule_SOURCES_MandatoryParams Mandatory Parameters
555 *
556 * <table>
557 * <tr>
558 * <td><tt>LUFA_PATH</tt></td>
559 * <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>
560 * </tr>
561 * <tr>
562 * <td><tt>ARCH</tt></td>
563 * <td>Architecture of the target processor (see \ref Page_DeviceSupport).</td>
564 * </tr>
565 * </table>
566 *
567 * \section SSec_BuildModule_SOURCES_OptionalParams Optional Parameters
568 *
569 * <table>
570 * <tr>
571 * <td><i>None</i></td>
572 * </tr>
573 * </table>
574 */