1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

makefile: add a check for real modules

This commit is contained in:
Leandro Lanzieri 2020-09-01 17:09:57 +02:00
parent 16b5fd303b
commit e80bb4b3dc
No known key found for this signature in database
GPG Key ID: 13559905E2EBEAA5
3 changed files with 13 additions and 6 deletions

View File

@ -89,10 +89,7 @@ include $(RIOTMAKE)/tools/fixdep.inc.mk
$(BINDIR)/$(MODULE)/:
$(Q)mkdir -p $@
# only create the module folder when it's going to hold objects
ifneq (,$(strip $(OBJ)))
$(MODULE).module $(OBJ): | $(BINDIR)/$(MODULE)/
endif
$(MODULE).module $(OBJ): | $(BINDIR)/$(MODULE)/
$(MODULE).module: $(OBJ) | $(DIRS:%=ALL--%)

View File

@ -556,6 +556,7 @@ DIRS += $(EXTERNAL_MODULE_DIRS)
BUILDDEPS += $(RIOTBUILD_CONFIG_HEADER_C)
BUILDDEPS += pkg-prepare
BUILDDEPS += $(APPDEPS)
BUILDDEPS += $(MODULE_LIST_DIR)
# Save value to verify it is not modified later
_BASELIBS_VALUE_BEFORE_USAGE := $(BASELIBS)
@ -575,9 +576,9 @@ ifeq ($(BUILD_IN_DOCKER),1)
link: ..in-docker-container
else
ifeq (,$(RIOTNOLINK))
link: ..compiler-check ..build-message $(BUILD_FILES) print-size
link: ..compiler-check ..build-message $(BUILD_FILES) print-size ..module-check
else
link: ..compiler-check ..build-message $(BASELIBS) $(ARCHIVES)
link: ..compiler-check ..build-message $(BASELIBS) $(ARCHIVES) ..module-check
endif # RIOTNOLINK
$(ELFFILE): $(BASELIBS) $(ARCHIVES)
@ -585,6 +586,10 @@ $(ELFFILE): $(BASELIBS) $(ARCHIVES)
.PHONY: $(APPLICATION_MODULE).module
..module-check: $(BASELIBS)
@[ -z "$(strip $(NON_GENERATED_MODULES))" ] || \
($(COLOR_ECHO) "$(COLOR_RED)Error - using unknown modules: $(COLOR_RESET)$(NON_GENERATED_MODULES)" && false)
$(APPLICATION_MODULE).module: pkg-build $(BUILDDEPS)
$(Q)DIRS="$(DIRS)" APPLICATION_BLOBS="$(BLOBS)" \
"$(MAKE)" -C $(APPDIR) -f $(RIOTMAKE)/application.inc.mk

View File

@ -12,3 +12,8 @@ EXTDEFINES = $(addprefix -D,$(call uppercase_and_underscore,$(ED)))
REALMODULES += $(filter-out $(PSEUDOMODULES), $(_ALLMODULES))
REALMODULES += $(filter $(NO_PSEUDOMODULES), $(_ALLMODULES))
BASELIBS += $(REALMODULES:%=%.module)
# Add modules compiled with Makefile.base and extra archives
GENERATED_MODULES = $(notdir $(shell find $(BINDIR) -type d)) $(basename $(notdir $(ARCHIVES)))
NON_GENERATED_MODULES = $(filter-out $(GENERATED_MODULES),$(REALMODULES))