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)/: $(BINDIR)/$(MODULE)/:
$(Q)mkdir -p $@ $(Q)mkdir -p $@
# only create the module folder when it's going to hold objects $(MODULE).module $(OBJ): | $(BINDIR)/$(MODULE)/
ifneq (,$(strip $(OBJ)))
$(MODULE).module $(OBJ): | $(BINDIR)/$(MODULE)/
endif
$(MODULE).module: $(OBJ) | $(DIRS:%=ALL--%) $(MODULE).module: $(OBJ) | $(DIRS:%=ALL--%)

View File

@ -556,6 +556,7 @@ DIRS += $(EXTERNAL_MODULE_DIRS)
BUILDDEPS += $(RIOTBUILD_CONFIG_HEADER_C) BUILDDEPS += $(RIOTBUILD_CONFIG_HEADER_C)
BUILDDEPS += pkg-prepare BUILDDEPS += pkg-prepare
BUILDDEPS += $(APPDEPS) BUILDDEPS += $(APPDEPS)
BUILDDEPS += $(MODULE_LIST_DIR)
# Save value to verify it is not modified later # Save value to verify it is not modified later
_BASELIBS_VALUE_BEFORE_USAGE := $(BASELIBS) _BASELIBS_VALUE_BEFORE_USAGE := $(BASELIBS)
@ -575,9 +576,9 @@ ifeq ($(BUILD_IN_DOCKER),1)
link: ..in-docker-container link: ..in-docker-container
else else
ifeq (,$(RIOTNOLINK)) ifeq (,$(RIOTNOLINK))
link: ..compiler-check ..build-message $(BUILD_FILES) print-size link: ..compiler-check ..build-message $(BUILD_FILES) print-size ..module-check
else else
link: ..compiler-check ..build-message $(BASELIBS) $(ARCHIVES) link: ..compiler-check ..build-message $(BASELIBS) $(ARCHIVES) ..module-check
endif # RIOTNOLINK endif # RIOTNOLINK
$(ELFFILE): $(BASELIBS) $(ARCHIVES) $(ELFFILE): $(BASELIBS) $(ARCHIVES)
@ -585,6 +586,10 @@ $(ELFFILE): $(BASELIBS) $(ARCHIVES)
.PHONY: $(APPLICATION_MODULE).module .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) $(APPLICATION_MODULE).module: pkg-build $(BUILDDEPS)
$(Q)DIRS="$(DIRS)" APPLICATION_BLOBS="$(BLOBS)" \ $(Q)DIRS="$(DIRS)" APPLICATION_BLOBS="$(BLOBS)" \
"$(MAKE)" -C $(APPDIR) -f $(RIOTMAKE)/application.inc.mk "$(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-out $(PSEUDOMODULES), $(_ALLMODULES))
REALMODULES += $(filter $(NO_PSEUDOMODULES), $(_ALLMODULES)) REALMODULES += $(filter $(NO_PSEUDOMODULES), $(_ALLMODULES))
BASELIBS += $(REALMODULES:%=%.module) 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))