3 # Copyright (C) Dean Camera, 2012.
5 # dean [at] fourwalledcubicle [dot] com
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 +=
16 # -----------------------------------------------------------------------------
17 # LUFA Core Build System Makefile Module.
18 # -----------------------------------------------------------------------------
20 # Provides a set of core build targets for the LUFA build system
21 # -----------------------------------------------------------------------------
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
36 # MANDATORY PARAMETERS:
40 # OPTIONAL PARAMETERS:
52 # -----------------------------------------------------------------------------
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))
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))
73 @echo "==================================================================="
74 @echo " LUFA Build System 2.0 "
75 @echo " (C) Dean Camera, 2012 { dean @ fourwalledcubicle . com } "
76 @echo "==================================================================="
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. "
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. "
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 "==================================================================="
96 @echo " Currently used build system modules in this application: "
98 @printf " %b" "$(PRINTABLE_LUFA_BUILD_MODULES:%= - %\n)"
101 @echo " Currently available build targets in this application: "
103 @printf " %b" "$(PRINTABLE_LUFA_BUILD_TARGETS:%= - %\n)"
106 @echo " Mandatory variables required by the selected build Modules: "
108 @printf " %b" "$(PRINTABLE_LUFA_MANDATORY_VARS:%= - %\n)"
111 @echo " Optional variables required by the selected build Modules: "
113 @printf " %b" "$(PRINTABLE_LUFA_OPTIONAL_VARS:%= - %\n)"
116 @echo " Variables provided by the selected build Modules: "
118 @printf " %b" "$(PRINTABLE_LUFA_PROVIDED_VARS:%= - %\n)"
121 @echo " Macros provided by the selected build Modules: "
123 @printf " %b" "$(PRINTABLE_LUFA_PROVIDED_MACROS:%= - %\n)"
125 @echo "==================================================================="
126 @echo " The LUFA BuildSystem 2.0 - Powered By Unicorns (tm) "
127 @echo "==================================================================="
130 @echo Currently Used Build System Modules: $(PRINTABLE_LUFA_BUILD_MODULES)
133 @echo Currently Available Build Targets: $(PRINTABLE_LUFA_BUILD_TARGETS)
136 @echo Mandatory Variables for Included Modules: $(PRINTABLE_LUFA_MANDATORY_VARS)
139 @echo Optional Variables for Included Modules: $(PRINTABLE_LUFA_OPTIONAL_VARS)
142 @echo Variables Provided by the Included Modules: $(PRINTABLE_LUFA_PROVIDED_VARS)
145 @echo Macros Provided by the Included Modules: $(PRINTABLE_LUFA_PROVIDED_MACROS)
147 # Disable default in-built make rules (those that are needed are explicitly
148 # defined, and doing so has performance benefits when recursively building)
151 # Phony build targets for this module
152 .PHONY: help list_modules list_targets list_mandatory list_optional list_provided list_macros