]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/protocol/lufa/LUFA-git/LUFA/Build/lufa_core.mk
Merge commit 'f6d56675f9f981c5464f0ca7a1fbb0162154e8c5'
[qmk_firmware.git] / tmk_core / protocol / lufa / LUFA-git / LUFA / Build / lufa_core.mk
1 #
2 #             LUFA Library
3 #     Copyright (C) Dean Camera, 2014.
4 #
5 #  dean [at] fourwalledcubicle [dot] com
6 #           www.lufa-lib.org
7 #
8
9 LUFA_BUILD_MODULES         += CORE
10 LUFA_BUILD_TARGETS         += help list_targets list_modules list_mandatory list_optional list_provided list_macros
11 LUFA_BUILD_MANDATORY_VARS  +=
12 LUFA_BUILD_OPTIONAL_VARS   +=
13 LUFA_BUILD_PROVIDED_VARS   +=
14 LUFA_BUILD_PROVIDED_MACROS +=
15
16 # -----------------------------------------------------------------------------
17 #               LUFA Core Build System Makefile Module.
18 # -----------------------------------------------------------------------------
19 # DESCRIPTION:
20 #   Provides a set of core build targets for the LUFA build system
21 # -----------------------------------------------------------------------------
22 # TARGETS:
23 #
24 #    help                      - Build system help
25 #    list_targets              - List all build targets
26 #    list_modules              - List all build modules
27 #    list_mandatory            - List all mandatory make variables required by
28 #                                the included build modules of the application
29 #    list_optional             - List all optional make variables required by
30 #                                the included build modules of the application
31 #    list_provided             - List all provided make variables from the
32 #                                included build modules of the application
33 #    list_macros               - List all provided make macros from the
34 #                                included build modules of the application
35 #
36 # MANDATORY PARAMETERS:
37 #
38 #    (None)
39 #
40 # OPTIONAL PARAMETERS:
41 #
42 #    (None)
43 #
44 # PROVIDED VARIABLES:
45 #
46 #    (None)
47 #
48 # PROVIDED MACROS:
49 #
50 #    (None)
51 #
52 # -----------------------------------------------------------------------------
53
54 SHELL = /bin/sh
55
56 # Converts a given input to a printable output using "(None)" if no items are in the list
57 CONVERT_TO_PRINTABLE           = $(if $(strip $(1)), $(1), (None))
58
59
60 # Build sorted and filtered lists of the included build module data
61 SORTED_LUFA_BUILD_MODULES      = $(sort $(LUFA_BUILD_MODULES))
62 SORTED_LUFA_BUILD_TARGETS      = $(sort $(LUFA_BUILD_TARGETS))
63 SORTED_LUFA_MANDATORY_VARS     = $(sort $(LUFA_BUILD_MANDATORY_VARS))
64 SORTED_LUFA_OPTIONAL_VARS      = $(filter-out $(SORTED_LUFA_MANDATORY_VARS), $(sort $(LUFA_BUILD_OPTIONAL_VARS)))
65 SORTED_LUFA_PROVIDED_VARS      = $(sort $(LUFA_BUILD_PROVIDED_VARS))
66 SORTED_LUFA_PROVIDED_MACROS    = $(sort $(LUFA_BUILD_PROVIDED_MACROS))
67
68 # Create printable versions of the sorted build module data (use "(None)" when no data is available)
69 PRINTABLE_LUFA_BUILD_MODULES   = $(call CONVERT_TO_PRINTABLE, $(SORTED_LUFA_BUILD_MODULES))
70 PRINTABLE_LUFA_BUILD_TARGETS   = $(call CONVERT_TO_PRINTABLE, $(SORTED_LUFA_BUILD_TARGETS))
71 PRINTABLE_LUFA_MANDATORY_VARS  = $(call CONVERT_TO_PRINTABLE, $(SORTED_LUFA_MANDATORY_VARS))
72 PRINTABLE_LUFA_OPTIONAL_VARS   = $(call CONVERT_TO_PRINTABLE, $(SORTED_LUFA_OPTIONAL_VARS))
73 PRINTABLE_LUFA_PROVIDED_VARS   = $(call CONVERT_TO_PRINTABLE, $(SORTED_LUFA_PROVIDED_VARS))
74 PRINTABLE_LUFA_PROVIDED_MACROS = $(call CONVERT_TO_PRINTABLE, $(SORTED_LUFA_PROVIDED_MACROS))
75
76 help:
77         @echo "==================================================================="
78         @echo "                       LUFA Build System 2.0                       "
79         @echo "      (C) Dean Camera, 2014 { dean @ fourwalledcubicle . com }     "
80         @echo "==================================================================="
81         @echo "DESCRIPTION:                                                       "
82         @echo " This build system is a set of makefile modules for (GNU) Make, to "
83         @echo " provide a simple system for building LUFA powered applications.   "
84         @echo " Each makefile module can be included from within a user makefile, "
85         @echo " to expose the build rules documented in the comments at the top of"
86         @echo " each build module.                                                "
87         @echo "                                                                   "
88         @echo "USAGE:                                                             "
89         @echo " To execute a rule, define all variables indicated in the desired  "
90         @echo " module as a required parameter before including the build module  "
91         @echo " in your project makefile. Parameters marked as optional will      "
92         @echo " assume a default value in the modules if not user-assigned.       "
93         @echo "                                                                   "
94         @echo " By default the target output shows both a friendly summary, as    "
95         @echo " well as the actual invoked command. To suppress the output of the "
96         @echo " invoked commands and show only the friendly command output, run   "
97         @echo " make with the \"-s\" switch added before the target(s).           "
98         @echo "                                                                   "
99         @echo "SEE ALSO:                                                          "
100         @echo " For more information, see the 'Build System' chapter of the LUFA  "
101         @echo " project documentation.                                            "
102         @echo "==================================================================="
103         @echo "                                                                   "
104         @echo "  Currently used build system modules in this application:         "
105         @echo "                                                                   "
106         @printf " %b" "$(PRINTABLE_LUFA_BUILD_MODULES:%=   - %\n)"
107         @echo "                                                                   "
108         @echo "                                                                   "
109         @echo "  Currently available build targets in this application:           "
110         @echo "                                                                   "
111         @printf " %b" "$(PRINTABLE_LUFA_BUILD_TARGETS:%=   - %\n)"
112         @echo "                                                                   "
113         @echo "                                                                   "
114         @echo "  Mandatory variables required by the selected build Modules:      "
115         @echo "                                                                   "
116         @printf " %b" "$(PRINTABLE_LUFA_MANDATORY_VARS:%=   - %\n)"
117         @echo "                                                                   "
118         @echo "                                                                   "
119         @echo "  Optional variables required by the selected build Modules:       "
120         @echo "                                                                   "
121         @printf " %b" "$(PRINTABLE_LUFA_OPTIONAL_VARS:%=   - %\n)"
122         @echo "                                                                   "
123         @echo "                                                                   "
124         @echo "  Variables provided by the selected build Modules:                "
125         @echo "                                                                   "
126         @printf " %b" "$(PRINTABLE_LUFA_PROVIDED_VARS:%=   - %\n)"
127         @echo "                                                                   "
128         @echo "                                                                   "
129         @echo "  Macros provided by the selected build Modules:                   "
130         @echo "                                                                   "
131         @printf " %b" "$(PRINTABLE_LUFA_PROVIDED_MACROS:%=   - %\n)"
132         @echo "                                                                   "
133         @echo "==================================================================="
134         @echo "   The LUFA BuildSystem 2.0 - Powered By Positive Thinking (tm)    "
135         @echo "==================================================================="
136
137 # Lists build modules included by the project makefile, in alphabetical order
138 list_modules:
139         @echo Currently Used Build System Modules:
140         @printf " %b" "$(PRINTABLE_LUFA_BUILD_MODULES:%=   - %\n)"
141
142 # Lists build targets included by the project makefile, in alphabetical order
143 list_targets:
144         @echo Currently Available Build Targets:
145         @printf " %b" "$(PRINTABLE_LUFA_BUILD_TARGETS:%=   - %\n)"
146
147 # Lists mandatory variables that must be set by the project makefile, in alphabetical order
148 list_mandatory:
149         @echo Mandatory Variables for Included Modules:
150         @printf " %b" "$(PRINTABLE_LUFA_MANDATORY_VARS:%=   - %\n)"
151
152 # Lists optional variables that must be set by the project makefile, in alphabetical order
153 list_optional:
154         @echo Optional Variables for Included Modules:
155         @printf " %b" "$(PRINTABLE_LUFA_OPTIONAL_VARS:%=   - %\n)"
156
157 # Lists variables provided by the included build modules, in alphabetical order
158 list_provided:
159         @echo Variables Provided by the Included Modules:
160         @printf " %b" "$(PRINTABLE_LUFA_PROVIDED_VARS:%=   - %\n)"
161
162 # Lists macros provided by the included build modules, in alphabetical order
163 list_macros:
164         @echo Macros Provided by the Included Modules:
165         @printf " %b" "$(PRINTABLE_LUFA_PROVIDED_MACROS:%=   - %\n)"
166
167 # Disable default in-built make rules (those that are needed are explicitly
168 # defined, and doing so has performance benefits when recursively building)
169 ifeq ($(filter -r,$(MAKEFLAGS)),)
170   MAKEFLAGS += -r
171 endif
172 .SUFFIXES:
173
174 # Phony build targets for this module
175 .PHONY: help list_modules list_targets list_mandatory list_optional list_provided list_macros