makefiles: add common makefile for auto_init modules
This commit is contained in:
parent
d69ef1367b
commit
b82c1e8707
16
makefiles/auto_init.inc.mk
Normal file
16
makefiles/auto_init.inc.mk
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Determine the list of modules that provide auto_init from the list of all
|
||||||
|
# auto_init_xx.c files available in the current directory.
|
||||||
|
# The rule is to have the file name matching the pattern: auto_init_<module name>.c
|
||||||
|
AUTO_INIT_PREFIX = auto_init_
|
||||||
|
AUTO_INIT_SRCS = $(wildcard $(AUTO_INIT_PREFIX)*.c)
|
||||||
|
AUTO_INIT_MODULES_AVAILABLE = $(subst $(AUTO_INIT_PREFIX),,$(subst .c,,$(AUTO_INIT_SRCS)))
|
||||||
|
|
||||||
|
# Compare this list against the modules used in the current build to determine
|
||||||
|
# which auto_init_xx.c file should be added to the build
|
||||||
|
AUTO_INIT_MODULES_USED = $(filter $(AUTO_INIT_MODULES_AVAILABLE),$(USEMODULE))
|
||||||
|
AUTO_INIT_MODULES_USED_SRCS = $(addprefix $(AUTO_INIT_PREFIX),$(addsuffix .c,$(AUTO_INIT_MODULES_USED)))
|
||||||
|
|
||||||
|
# Set the list of files to build in the auto_init module
|
||||||
|
SRC = init.c $(AUTO_INIT_MODULES_USED_SRCS)
|
||||||
|
|
||||||
|
include $(RIOTBASE)/Makefile.base
|
||||||
Loading…
x
Reference in New Issue
Block a user