]> git.donarmstrong.com Git - qmk_firmware.git/blob - lib/lufa/LUFA/Build/DMBS/Readme.md
Merge pull request #1554 from qmk/docs
[qmk_firmware.git] / lib / lufa / LUFA / Build / DMBS / Readme.md
1 DMBS - Dean's Makefile Build System
2 ===================================
3
4
5 Project Overview
6 ----------------
7
8 GNU Make is scary, and it's tough to get the rules right sometimes. Many
9 projects get by via simple copy-pasting of old makefiles, resulting in many
10 redundant copies of the same old rules. DMBS aims to solve this by providing a
11 simple modular set of makefiles which can be included by your project to quickly
12 add various build functionality.
13
14 This aims to replace the old WinAVR "mfile" makefile template, giving better
15 functionality and much simpler user makefiles.
16
17
18 Benefits:
19 ----------------
20
21 Apart from much simpler, cleaner makefiles DMBS carries the aim of making the
22 process of troubleshooting build issues a little easier. Lots can go wrong, so
23 DMBS tries to sanity check its inputs wherever possible, and produce
24 human-readable error messages. Forgotten to set a variable? Get a
25 `Makefile {X} value not set.` message, rather than a possibly unrelated message.
26 Have the wrong filename? See `Source file does not exist: {X}` rather than the
27 infamous `No rule to make target {X}` message.
28
29
30 Use:
31 ----------------
32
33 A template user makefile is provided in the `Template` directory. DMBS modules
34 are included via a GNU Make `include` directive. While the DMBS `core` module is
35 always required, you can pick and choose what other modules you wish to add to
36 your user project.
37
38 [See here for the documentation on the individual modules provided by DMBS.](DMBS/ModulesOverview.md)
39 If you're interested in writing your own DMBS module(s), [see here.](DMBS/WritingYourOwnModules.md)
40
41 Here's an example user makefile:
42
43         MCU          = atmega128
44         ARCH         = AVR8
45         F_CPU        = 8000000
46         OPTIMIZATION = s
47         TARGET       = Template
48         SRC          = $(TARGET).c
49         CC_FLAGS     =
50         LD_FLAGS     =
51
52         # Default target
53         all:
54
55         # Include DMBS build script makefiles
56         DMBS_PATH   ?= ../DMBS
57         include $(DMBS_PATH)/core.mk
58         include $(DMBS_PATH)/gcc.mk
59         include $(DMBS_PATH)/cppcheck.mk
60         include $(DMBS_PATH)/doxygen.mk
61         include $(DMBS_PATH)/dfu.mk
62         include $(DMBS_PATH)/hid.mk
63         include $(DMBS_PATH)/avrdude.mk
64         include $(DMBS_PATH)/atprogram.mk
65
66 Each DMBS module can optionally supply one or more Make variables and macros,
67 which you can reference in your user makefile. Additionally, modules can require
68 one or more variables to be set by the user makefile, with (in some cases) sane
69 defaults used if left out.
70
71 As modules are added, you can get a list of available targets by simply typing
72 `make help` from the command line. This will produce a formatted list of targets
73 as well as mandatory and optional variables and exposed variables and macros.
74
75
76 Distribution
77 ----------------
78
79 You can embed DMBS in your project any way you like - some options are:
80 1. A git submodule
81 2. A source tarball
82 3. A manually copied extracted archive
83
84 The intention of DMBS is that users can just import it from whatever source
85 they like. If your project needs to extend the existing modules in an unusual
86 manner, or if you want to provide your own modules, you can include them in
87 your project repository (or submit a patch to DMBS if your module is generic
88 enough to warrant wide use).
89
90
91 License
92 ----------------
93
94 DMBS is released into the public domain, making is suitable for use everywhere,
95 by everyone. Contributions are greatly appreciated however, in order to make
96 DMBS better for everyone.
97
98 The actual license text is as follows:
99
100         This is free and unencumbered software released into the public domain.
101
102         Anyone is free to copy, modify, publish, use, compile, sell, or
103         distribute this software, either in source code form or as a compiled
104         binary, for any purpose, commercial or non-commercial, and by any
105         means.
106
107         In jurisdictions that recognize copyright laws, the author or authors
108         of this software dedicate any and all copyright interest in the
109         software to the public domain. We make this dedication for the benefit
110         of the public at large and to the detriment of our heirs and
111         successors. We intend this dedication to be an overt act of
112         relinquishment in perpetuity of all present and future rights to this
113         software under copyright law.
114
115         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
116         EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
117         MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
118         IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
119         OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
120         ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
121         OTHER DEALINGS IN THE SOFTWARE.
122
123         For more information, please refer to <http://unlicense.org/>