Merge pull request #6780 from kaspar030/add_submodules
make: add submodule support
This commit is contained in:
commit
3711a6d406
@ -22,16 +22,33 @@ ${DIRS:%=ALL--%}:
|
|||||||
${DIRS:%=CLEAN--%}:
|
${DIRS:%=CLEAN--%}:
|
||||||
$(QQ)"$(MAKE)" -C ${@:CLEAN--%=%} clean
|
$(QQ)"$(MAKE)" -C ${@:CLEAN--%=%} clean
|
||||||
|
|
||||||
ifeq ($(strip $(SRC)),)
|
## submodules
|
||||||
|
ifeq (1, $(SUBMODULES))
|
||||||
|
# don't use *.c as SRC if SRC is empty (e.g., no module selected)
|
||||||
|
NO_AUTO_SRC := 1
|
||||||
|
|
||||||
|
# allow different submodule basename (e.g., MODULE=cpu_periph_common, but match just periph_%)
|
||||||
|
BASE_MODULE ?= $(MODULE)
|
||||||
|
|
||||||
|
# for each $(BASE_MODULE)_<name> in USEMODULE, add <name>.c to SRC
|
||||||
|
SRC += $(patsubst $(BASE_MODULE)_%,%.c,$(filter $(BASE_MODULE)_%,$(USEMODULE)))
|
||||||
|
|
||||||
|
# don't fail if a selected *.c file does not exist
|
||||||
|
ifeq (1, $(SUBMODULES_NOFORCE))
|
||||||
|
SRC := $(filter $(SRC), $(wildcard *.c))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(SRC))$(NO_AUTO_SRC),)
|
||||||
SRC := $(filter-out $(SRC_NOLTO), $(wildcard *.c))
|
SRC := $(filter-out $(SRC_NOLTO), $(wildcard *.c))
|
||||||
endif
|
endif
|
||||||
ifeq ($(strip $(SRCXX)),)
|
ifeq ($(strip $(SRCXX))$(NO_AUTO_SRC),)
|
||||||
SRCXX := $(wildcard *.cpp)
|
SRCXX := $(wildcard *.cpp)
|
||||||
endif
|
endif
|
||||||
ifeq ($(strip $(ASMSRC)),)
|
ifeq ($(strip $(ASMSRC))$(NO_AUTO_SRC),)
|
||||||
ASMSRC := $(wildcard *.s)
|
ASMSRC := $(wildcard *.s)
|
||||||
endif
|
endif
|
||||||
ifeq ($(strip $(ASSMSRC)),)
|
ifeq ($(strip $(ASSMSRC))$(NO_AUTO_SRC),)
|
||||||
ASSMSRC := $(wildcard *.S)
|
ASSMSRC := $(wildcard *.S)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@ -3,9 +3,7 @@ PSEUDOMODULES += conn
|
|||||||
PSEUDOMODULES += conn_ip
|
PSEUDOMODULES += conn_ip
|
||||||
PSEUDOMODULES += conn_tcp
|
PSEUDOMODULES += conn_tcp
|
||||||
PSEUDOMODULES += conn_udp
|
PSEUDOMODULES += conn_udp
|
||||||
PSEUDOMODULES += core_msg
|
PSEUDOMODULES += core_%
|
||||||
PSEUDOMODULES += core_mbox
|
|
||||||
PSEUDOMODULES += core_thread_flags
|
|
||||||
PSEUDOMODULES += emb6_router
|
PSEUDOMODULES += emb6_router
|
||||||
PSEUDOMODULES += gnrc_ipv6_default
|
PSEUDOMODULES += gnrc_ipv6_default
|
||||||
PSEUDOMODULES += gnrc_ipv6_router
|
PSEUDOMODULES += gnrc_ipv6_router
|
||||||
|
|||||||
@ -1 +1,7 @@
|
|||||||
|
# exclude submodule sources from *.c wildcard source selection
|
||||||
|
SRC := $(filter-out mbox.c msg.c thread_flags.c,$(wildcard *.c))
|
||||||
|
|
||||||
|
# enable submodules
|
||||||
|
SUBMODULES := 1
|
||||||
|
|
||||||
include $(RIOTBASE)/Makefile.base
|
include $(RIOTBASE)/Makefile.base
|
||||||
|
|||||||
@ -28,8 +28,6 @@
|
|||||||
#define ENABLE_DEBUG (0)
|
#define ENABLE_DEBUG (0)
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
#ifdef MODULE_CORE_MBOX
|
|
||||||
|
|
||||||
static void _wake_waiter(thread_t *thread, unsigned irqstate)
|
static void _wake_waiter(thread_t *thread, unsigned irqstate)
|
||||||
{
|
{
|
||||||
sched_set_status(thread, STATUS_PENDING);
|
sched_set_status(thread, STATUS_PENDING);
|
||||||
@ -122,5 +120,3 @@ int _mbox_get(mbox_t *mbox, msg_t *msg, int blocking)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MODULE_CORE_MBOX */
|
|
||||||
|
|||||||
@ -34,8 +34,6 @@
|
|||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
|
|
||||||
#ifdef MODULE_CORE_MSG
|
|
||||||
|
|
||||||
static int _msg_receive(msg_t *m, int block);
|
static int _msg_receive(msg_t *m, int block);
|
||||||
static int _msg_send(msg_t *m, kernel_pid_t target_pid, bool block, unsigned state);
|
static int _msg_send(msg_t *m, kernel_pid_t target_pid, bool block, unsigned state);
|
||||||
|
|
||||||
@ -409,5 +407,3 @@ void msg_queue_print(void)
|
|||||||
|
|
||||||
irq_restore(state);
|
irq_restore(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MODULE_CORE_MSG */
|
|
||||||
|
|||||||
@ -26,7 +26,6 @@
|
|||||||
#define ENABLE_DEBUG (0)
|
#define ENABLE_DEBUG (0)
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
#ifdef MODULE_CORE_THREAD_FLAGS
|
|
||||||
static thread_flags_t _thread_flags_clear_atomic(thread_t *thread, thread_flags_t mask)
|
static thread_flags_t _thread_flags_clear_atomic(thread_t *thread, thread_flags_t mask)
|
||||||
{
|
{
|
||||||
unsigned state = irq_disable();
|
unsigned state = irq_disable();
|
||||||
@ -133,4 +132,3 @@ void thread_flags_set(thread_t *thread, thread_flags_t mask)
|
|||||||
irq_restore(state);
|
irq_restore(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* MODULE_CORE_THREAD_FLAGS */
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user