1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Makefile: better solution for MODULE_MODULENAME_BUILTIN name conversion

Now it does not depend on board-specific part and uses module canonical name.

+review OPReview-422
This commit is contained in:
Oleg Semyonov 2013-03-25 17:07:04 +02:00
parent 9424be584c
commit 5d760d20fa

View File

@ -106,8 +106,10 @@ SRC += $(foreach mod, $(OPTMODULES), $(wildcard $(OPMODULEDIR)/$(mod)/*.c))
# Declare all non-optional modules as built-in to force inclusion.
# Built-in modules are always enabled and cannot be disabled.
MODNAMES := $(notdir $(subst /revolution,,$(MODULES)))
MODULES_BUILTIN := $(foreach mod, $(MODNAMES), -DMODULE_$(shell $(ECHO) $(mod) | tr '[:lower:]' '[:upper:]')_BUILTIN)
# Module name 'ModuleName' or board-specific 'ModuleName/revolution' will be
# normalized to 'ModuleName' and defined as '-DMODULE_MODULENAME_BUILTIN'
MODNAMES := $(foreach mod,$(MODULES),$(firstword $(subst /, ,$(mod))))
MODULES_BUILTIN := $(foreach mod,$(MODNAMES),-DMODULE_$(shell $(ECHO) $(mod) | tr '[:lower:]' '[:upper:]')_BUILTIN)
CDEFS += $(MODULES_BUILTIN)
# List C source files here which must be compiled in ARM-Mode (no -mthumb).