# www.lufa-lib.org\r
#\r
\r
-LUFA_BUILD_MODULES += CORE\r
-LUFA_BUILD_TARGETS += list_targets list_modules help\r
+LUFA_BUILD_MODULES += CORE\r
+LUFA_BUILD_TARGETS += help list_targets list_modules list_mandatory list_optional \r
+LUFA_BUILD_MANDATORY_VARS += \r
+LUFA_BUILD_OPTIONAL_VARS += \r
\r
# -----------------------------------------------------------------------------\r
# LUFA Core Buildsystem Makefile Module.\r
# -----------------------------------------------------------------------------\r
# TARGETS:\r
#\r
-# info - Build system information\r
# help - Build system help\r
# list_targets - List all build targets\r
# list_modules - List all build modules\r
+# list_mandatory - List all mandatory make variables required by\r
+# the included build modules of the application\r
+# list_optional - List all optional make variables required by\r
+# the included build modules of the application\r
#\r
# MANDATORY PARAMETERS:\r
#\r
#\r
# -----------------------------------------------------------------------------\r
\r
-info:\r
+# Build sorted and filtered lists of the included build module data\r
+SORTED_LUFA_BUILD_MODULES = $(sort $(LUFA_BUILD_MODULES))\r
+SORTED_LUFA_BUILD_TARGETS = $(sort $(LUFA_BUILD_TARGETS))\r
+SORTED_LUFA_MANDATORY_VARS = $(sort $(LUFA_BUILD_MANDATORY_VARS))\r
+SORTED_LUFA_OPTIONAL_VARS = $(filter-out $(SORTED_LUFA_MANDATORY_VARS), $(sort $(LUFA_BUILD_OPTIONAL_VARS)))\r
+\r
+help:\r
@echo "==================================================================="\r
- @echo " LUFA Build System 2.0 "\r
- @echo " (C) Dean Camera { dean @ fourwalledcubicle . com } "\r
+ @echo " LUFA Build System 2.0 "\r
+ @echo " (C) Dean Camera, 2012 { dean @ fourwalledcubicle . com } "\r
@echo "==================================================================="\r
-\r
-.PHONY: info\r
-help: info\r
@echo "DESCRIPTION: "\r
@echo " This build system is a set of makefile modules for (GNU) Make, to "\r
@echo " provide a simple system for building LUFA powered applications. "\r
@echo " module as a required parameter before including the build module "\r
@echo " in your project makefile. Parameters marked as optional will "\r
@echo " assume a default value in the module if not user-assigned. "\r
+ @echo " "\r
+ @echo " By default the target output shows both a friendly summary, as "\r
+ @echo " well as the actual invoked command. To suppress the output of the "\r
+ @echo " invoked commands and show only the friendly command output, run "\r
+ @echo " make with the \"-s\" switch added before the target(s). " \r
@echo "==================================================================="\r
- @echo " Currently Used Modules in this application: "\r
+ @echo " Currently used modules in this application: "\r
+ @echo " "\r
+ @printf " %b" "$(SORTED_LUFA_BUILD_MODULES:%= - %\n)"\r
+ @echo " "\r
+ @echo " "\r
+ @echo " Currently available build targets in this application: "\r
+ @echo " "\r
+ @printf " %b" "$(SORTED_LUFA_BUILD_TARGETS:%= - %\n)"\r
+ @echo " "\r
@echo " "\r
- @echo " [" $(sort $(LUFA_BUILD_MODULES)) "]"\r
+ @echo " Mandatory variables required by the selected build Modules: "\r
@echo " "\r
+ @printf " %b" "$(SORTED_LUFA_MANDATORY_VARS:%= - %\n)"\r
@echo " "\r
- @echo " Currently Available Build Targets in this application: "\r
@echo " "\r
- @echo " [" $(sort $(LUFA_BUILD_TARGETS)) "]"\r
+ @echo " Optional variables required by the selected build Modules: "\r
+ @echo " "\r
+ @printf " %b" "$(SORTED_LUFA_OPTIONAL_VARS:%= - %\n)"\r
+ @echo " "\r
@echo "==================================================================="\r
@echo " The LUFA BuildSystem 2.0 - Powered By Unicorns (tm) "\r
@echo "==================================================================="\r
\r
+list_modules:\r
+ @echo Currently Build Modules: $(SORTED_LUFA_BUILD_MODULES)\r
+\r
list_targets:\r
- @echo Currently Available Build Targets: $(sort $(LUFA_BUILD_TARGETS))\r
+ @echo Currently Available Build Targets: $(SORTED_LUFA_BUILD_TARGETS) \r
+\r
+list_mandatory:\r
+ @echo Mandatory Variables for Included Modules: $(SORTED_LUFA_MANDATORY_VARS)\r
\r
-list_modules:\r
- @echo Currently Build Modules: $(sort $(LUFA_BUILD_MODULES))\r
+list_optional:\r
+ @echo Optional Variables for Included Modules: $(SORTED_LUFA_OPTIONAL_VARS)\r
+\r
+# Phony build targets for this module\r
+.PHONY: help list_modules list_targets list_mandatory list_optional\r
\r
+# Disable default in-built make rules (those that are needed are explicitly\r
+# defined, and doing so has performance benefits when recursively building)\r
+.SUFFIXES:\r