]> git.gir.st - tmk_keyboard.git/blob - tmk_core/protocol/lufa/LUFA-120730/LUFA/Build/lufa_core.mk
Merge commit 'a074364c3731d66b56d988c8a6c960a83ea0e0a1' as 'tmk_core'
[tmk_keyboard.git] / tmk_core / protocol / lufa / LUFA-120730 / LUFA / Build / lufa_core.mk
1 #
2 # LUFA Library
3 # Copyright (C) Dean Camera, 2012.
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 # Build sorted and filtered lists of the included build module data
57 SORTED_LUFA_BUILD_MODULES = $(sort $(LUFA_BUILD_MODULES))
58 SORTED_LUFA_BUILD_TARGETS = $(sort $(LUFA_BUILD_TARGETS))
59 SORTED_LUFA_MANDATORY_VARS = $(sort $(LUFA_BUILD_MANDATORY_VARS))
60 SORTED_LUFA_OPTIONAL_VARS = $(filter-out $(SORTED_LUFA_MANDATORY_VARS), $(sort $(LUFA_BUILD_OPTIONAL_VARS)))
61 SORTED_LUFA_PROVIDED_VARS = $(sort $(LUFA_BUILD_PROVIDED_VARS))
62 SORTED_LUFA_PROVIDED_MACROS = $(sort $(LUFA_BUILD_PROVIDED_MACROS))
63
64 # Create printable versions of the sorted build module data (use "(None)" when no data is available)
65 PRINTABLE_LUFA_BUILD_MODULES = $(if $(strip $(SORTED_LUFA_BUILD_MODULES)), $(SORTED_LUFA_BUILD_MODULES), (None))
66 PRINTABLE_LUFA_BUILD_TARGETS = $(if $(strip $(SORTED_LUFA_BUILD_TARGETS)), $(SORTED_LUFA_BUILD_TARGETS), (None))
67 PRINTABLE_LUFA_MANDATORY_VARS = $(if $(strip $(SORTED_LUFA_MANDATORY_VARS)), $(SORTED_LUFA_MANDATORY_VARS), (None))
68 PRINTABLE_LUFA_OPTIONAL_VARS = $(if $(strip $(SORTED_LUFA_OPTIONAL_VARS)), $(SORTED_LUFA_OPTIONAL_VARS), (None))
69 PRINTABLE_LUFA_PROVIDED_VARS = $(if $(strip $(SORTED_LUFA_PROVIDED_VARS)), $(SORTED_LUFA_PROVIDED_VARS), (None))
70 PRINTABLE_LUFA_PROVIDED_MACROS = $(if $(strip $(SORTED_LUFA_PROVIDED_MACROS)), $(SORTED_LUFA_PROVIDED_MACROS), (None))
71
72 help:
73 @echo "==================================================================="
74 @echo " LUFA Build System 2.0 "
75 @echo " (C) Dean Camera, 2012 { dean @ fourwalledcubicle . com } "
76 @echo "==================================================================="
77 @echo "DESCRIPTION: "
78 @echo " This build system is a set of makefile modules for (GNU) Make, to "
79 @echo " provide a simple system for building LUFA powered applications. "
80 @echo " Each makefile module can be included from within a user makefile, "
81 @echo " to expose the build rules documented in the comments at the top of"
82 @echo " each build module. "
83 @echo " "
84 @echo "USAGE: "
85 @echo " To execute a rule, define all variables indicated in the desired "
86 @echo " module as a required parameter before including the build module "
87 @echo " in your project makefile. Parameters marked as optional will "
88 @echo " assume a default value in the modules if not user-assigned. "
89 @echo " "
90 @echo " By default the target output shows both a friendly summary, as "
91 @echo " well as the actual invoked command. To suppress the output of the "
92 @echo " invoked commands and show only the friendly command output, run "
93 @echo " make with the \"-s\" switch added before the target(s). "
94 @echo "==================================================================="
95 @echo " "
96 @echo " Currently used build system modules in this application: "
97 @echo " "
98 @printf " %b" "$(PRINTABLE_LUFA_BUILD_MODULES:%= - %\n)"
99 @echo " "
100 @echo " "
101 @echo " Currently available build targets in this application: "
102 @echo " "
103 @printf " %b" "$(PRINTABLE_LUFA_BUILD_TARGETS:%= - %\n)"
104 @echo " "
105 @echo " "
106 @echo " Mandatory variables required by the selected build Modules: "
107 @echo " "
108 @printf " %b" "$(PRINTABLE_LUFA_MANDATORY_VARS:%= - %\n)"
109 @echo " "
110 @echo " "
111 @echo " Optional variables required by the selected build Modules: "
112 @echo " "
113 @printf " %b" "$(PRINTABLE_LUFA_OPTIONAL_VARS:%= - %\n)"
114 @echo " "
115 @echo " "
116 @echo " Variables provided by the selected build Modules: "
117 @echo " "
118 @printf " %b" "$(PRINTABLE_LUFA_PROVIDED_VARS:%= - %\n)"
119 @echo " "
120 @echo " "
121 @echo " Macros provided by the selected build Modules: "
122 @echo " "
123 @printf " %b" "$(PRINTABLE_LUFA_PROVIDED_MACROS:%= - %\n)"
124 @echo " "
125 @echo "==================================================================="
126 @echo " The LUFA BuildSystem 2.0 - Powered By Unicorns (tm) "
127 @echo "==================================================================="
128
129 list_modules:
130 @echo Currently Used Build System Modules: $(PRINTABLE_LUFA_BUILD_MODULES)
131
132 list_targets:
133 @echo Currently Available Build Targets: $(PRINTABLE_LUFA_BUILD_TARGETS)
134
135 list_mandatory:
136 @echo Mandatory Variables for Included Modules: $(PRINTABLE_LUFA_MANDATORY_VARS)
137
138 list_optional:
139 @echo Optional Variables for Included Modules: $(PRINTABLE_LUFA_OPTIONAL_VARS)
140
141 list_provided:
142 @echo Variables Provided by the Included Modules: $(PRINTABLE_LUFA_PROVIDED_VARS)
143
144 list_macros:
145 @echo Macros Provided by the Included Modules: $(PRINTABLE_LUFA_PROVIDED_MACROS)
146
147 # Disable default in-built make rules (those that are needed are explicitly
148 # defined, and doing so has performance benefits when recursively building)
149 .SUFFIXES:
150
151 # Phony build targets for this module
152 .PHONY: help list_modules list_targets list_mandatory list_optional list_provided list_macros
Imprint / Impressum