Skip to content
Snippets Groups Projects
Commit d724e71a authored by Gaëtan Harter's avatar Gaëtan Harter
Browse files

makefiles: Add an APPLICATION_MODULE variable

Set the application module name with APPLICATION_MODULE.
The default module name is "application_$(APPLICATION)".

This should fix name conflicts where an application/test has the same name as
an existing module and so both write to the same archive.
parent f1f079fb
No related branches found
No related tags found
No related merge requests found
......@@ -292,8 +292,12 @@ ifeq ($(origin RIOT_VERSION), undefined)
endif
endif
# Set module by prepending APPLICATION name with 'application_'.
# It prevents conflict with application and modules with the same name.
APPLICATION_MODULE ?= application_$(APPLICATION)
# the binaries to link
BASELIBS += $(BINDIR)/${APPLICATION}.a
BASELIBS += $(BINDIR)/$(APPLICATION_MODULE).a
BASELIBS += $(APPDEPS)
.PHONY: all link clean flash term doc debug debug-server reset objdump help info-modules
......
......@@ -22,8 +22,8 @@ QUIET ?= 1
# to flag that the directory should only be included when doing a normal build,
# and that the resulting .a should be saved when doing "make bindist"
BIN_DIRS += abc
BIN_USEMODULE += abc # include "abc" module
BIN_USEMODULE += bindist # include application module (named $APPLICATION)
BIN_USEMODULE += abc # include "abc" module
BIN_USEMODULE += $(APPLICATION_MODULE) # include application module
# list of extra files to include in binary distribution
DIST_FILES += Makefile
......
MODULE = $(APPLICATION)
MODULE = $(APPLICATION_MODULE)
DIRS += $(RIOTCPU)/$(CPU) $(RIOTBOARD)/$(BOARD)
DIRS += $(RIOTBASE)/core $(RIOTBASE)/drivers $(RIOTBASE)/sys
......
......@@ -6,6 +6,7 @@ export QQ # as Q, but be more quiet
export QUIET # The parameter to use whether to show verbose makefile commands or not.
export APPLICATION # The application, set in the Makefile which is run by the user.
export APPLICATION_MODULE # The application module name.
export BOARD # The board to compile the application for.
export CPU # The CPU, set by the board's Makefile.include.
export CPU_MODEL # The specific identifier of the used CPU, used for some CPU implementations to differentiate between different memory layouts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment