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 # -----------------------------------------------------------------------------
54 # Build sorted and filtered lists of the included build module data
55 SORTED_LUFA_BUILD_MODULES = $(sort $(LUFA_BUILD_MODULES))
56 SORTED_LUFA_BUILD_TARGETS = $(sort $(LUFA_BUILD_TARGETS))
57 SORTED_LUFA_MANDATORY_VARS = $(sort $(LUFA_BUILD_MANDATORY_VARS))
58 SORTED_LUFA_OPTIONAL_VARS = $(filter-out $(SORTED_LUFA_MANDATORY_VARS), $(sort $(LUFA_BUILD_OPTIONAL_VARS)))
59 SORTED_LUFA_PROVIDED_VARS = $(sort $(LUFA_BUILD_PROVIDED_VARS))
60 SORTED_LUFA_PROVIDED_MACROS = $(sort $(LUFA_BUILD_PROVIDED_MACROS))
62 # Create printable versions of the sorted build module data (use "(None)" when no data is available)
63 PRINTABLE_LUFA_BUILD_MODULES = $(if $(strip $(SORTED_LUFA_BUILD_MODULES)), $(SORTED_LUFA_BUILD_MODULES), (None))
64 PRINTABLE_LUFA_BUILD_TARGETS = $(if $(strip $(SORTED_LUFA_BUILD_TARGETS)), $(SORTED_LUFA_BUILD_TARGETS), (None))
65 PRINTABLE_LUFA_MANDATORY_VARS = $(if $(strip $(SORTED_LUFA_MANDATORY_VARS)), $(SORTED_LUFA_MANDATORY_VARS), (None))
66 PRINTABLE_LUFA_OPTIONAL_VARS = $(if $(strip $(SORTED_LUFA_OPTIONAL_VARS)), $(SORTED_LUFA_OPTIONAL_VARS), (None))
67 PRINTABLE_LUFA_PROVIDED_VARS = $(if $(strip $(SORTED_LUFA_PROVIDED_VARS)), $(SORTED_LUFA_PROVIDED_VARS), (None))
68 PRINTABLE_LUFA_PROVIDED_MACROS = $(if $(strip $(SORTED_LUFA_PROVIDED_MACROS)), $(SORTED_LUFA_PROVIDED_MACROS), (None))
71 @echo "==================================================================="
72 @echo " LUFA Build System 2.0 "
73 @echo " (C) Dean Camera, 2012 { dean @ fourwalledcubicle . com } "
74 @echo "==================================================================="
76 @echo " This build system is a set of makefile modules for (GNU) Make, to "
77 @echo " provide a simple system for building LUFA powered applications. "
78 @echo " Each makefile module can be included from within a user makefile, "
79 @echo " to expose the build rules documented in the comments at the top of"
80 @echo " each build module. "
83 @echo " To execute a rule, define all variables indicated in the desired "
84 @echo " module as a required parameter before including the build module "
85 @echo " in your project makefile. Parameters marked as optional will "
86 @echo " assume a default value in the modules if not user-assigned. "
88 @echo " By default the target output shows both a friendly summary, as "
89 @echo " well as the actual invoked command. To suppress the output of the "
90 @echo " invoked commands and show only the friendly command output, run "
91 @echo " make with the \"-s\" switch added before the target(s). "
92 @echo "==================================================================="
93 @echo " Currently used build system modules in this application: "
95 @printf " %b" "$(PRINTABLE_LUFA_BUILD_MODULES:%= - %\n)"
98 @echo " Currently available build targets in this application: "
100 @printf " %b" "$(PRINTABLE_LUFA_BUILD_TARGETS:%= - %\n)"
103 @echo " Mandatory variables required by the selected build Modules: "
105 @printf " %b" "$(PRINTABLE_LUFA_MANDATORY_VARS:%= - %\n)"
108 @echo " Optional variables required by the selected build Modules: "
110 @printf " %b" "$(PRINTABLE_LUFA_OPTIONAL_VARS:%= - %\n)"
113 @echo " Variables provided by the selected build Modules: "
115 @printf " %b" "$(PRINTABLE_LUFA_PROVIDED_VARS:%= - %\n)"
118 @echo " Macros provided by the selected build Modules: "
120 @printf " %b" "$(PRINTABLE_LUFA_PROVIDED_MACROS:%= - %\n)"
122 @echo "==================================================================="
123 @echo " The LUFA BuildSystem 2.0 - Powered By Unicorns (tm) "
124 @echo "==================================================================="
127 @echo Currently Used Build System Modules: $(PRINTABLE_LUFA_BUILD_MODULES)
130 @echo Currently Available Build Targets: $(PRINTABLE_LUFA_BUILD_TARGETS)
133 @echo Mandatory Variables for Included Modules: $(PRINTABLE_LUFA_MANDATORY_VARS)
136 @echo Optional Variables for Included Modules: $(PRINTABLE_LUFA_OPTIONAL_VARS)
139 @echo Variables Provided by the Included Modules: $(PRINTABLE_LUFA_PROVIDED_VARS)
142 @echo Macros Provided by the Included Modules: $(PRINTABLE_LUFA_PROVIDED_MACROS)
144 # Disable default in-built make rules (those that are needed are explicitly
145 # defined, and doing so has performance benefits when recursively building)
148 # Phony build targets for this module
149 .PHONY: help list_modules list_targets list_mandatory list_optional list_provided list_macros