mirror of
https://github.com/espressif/openthread.git
synced 2026-08-04 09:57:47 +00:00
[posix-app] simplify makefiles (#3975)
* [cli] ensure legacy callback APIs are defined as `OT_TOOL_WEAK` * [posix-app] simplify the makefile (link in ncp lib). This commit simplifies the posix-app makefiles by removing the `inc_<module>` source files (which included certain modules from the `ncp` folder). Instead the library `libopenthread-ncp-ftd.a` is included when linking thethe final posix-app executables `ot-ncp`, `ot-cli` and/or, `o-daemon`. * [posix-app] ensure header files from ncp folder have "ncp/" prefix This commit changes the posix-app platform makefile such that the header files from `src/ncp` folder require "ncp/" prefix.
This commit is contained in:
committed by
Jonathan Hui
parent
21221d9903
commit
d92733661c
+3
-3
@@ -3611,17 +3611,17 @@ exit:
|
||||
} // namespace ot
|
||||
|
||||
#if OPENTHREAD_ENABLE_LEGACY
|
||||
extern "C" void otNcpRegisterLegacyHandlers(const otNcpLegacyHandlers *aHandlers)
|
||||
OT_TOOL_WEAK void otNcpRegisterLegacyHandlers(const otNcpLegacyHandlers *aHandlers)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aHandlers);
|
||||
}
|
||||
|
||||
extern "C" void otNcpHandleDidReceiveNewLegacyUlaPrefix(const uint8_t *aUlaPrefix)
|
||||
OT_TOOL_WEAK void otNcpHandleDidReceiveNewLegacyUlaPrefix(const uint8_t *aUlaPrefix)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aUlaPrefix);
|
||||
}
|
||||
|
||||
extern "C" void otNcpHandleLegacyNodeDidJoin(const otExtAddress *aExtAddr)
|
||||
OT_TOOL_WEAK void otNcpHandleLegacyNodeDidJoin(const otExtAddress *aExtAddr)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aExtAddr);
|
||||
}
|
||||
|
||||
@@ -140,9 +140,11 @@ ot_daemon_SOURCES = \
|
||||
|
||||
ot_daemon_LDADD = \
|
||||
$(top_builddir)/src/cli/libopenthread-cli-ftd.a \
|
||||
$(top_builddir)/src/ncp/libopenthread-ncp-ftd.a \
|
||||
$(top_builddir)/src/core/libopenthread-ftd.a \
|
||||
$(LDADD_COMMON) \
|
||||
$(top_builddir)/src/cli/libopenthread-cli-ftd.a \
|
||||
$(top_builddir)/src/ncp/libopenthread-ncp-ftd.a \
|
||||
$(top_builddir)/src/core/libopenthread-ftd.a \
|
||||
$(LDADD_COMMON) \
|
||||
$(NULL)
|
||||
@@ -167,9 +169,11 @@ ot_cli_SOURCES = \
|
||||
|
||||
ot_cli_LDADD = \
|
||||
$(top_builddir)/src/cli/libopenthread-cli-ftd.a \
|
||||
$(top_builddir)/src/ncp/libopenthread-ncp-ftd.a \
|
||||
$(top_builddir)/src/core/libopenthread-ftd.a \
|
||||
$(LDADD_COMMON) \
|
||||
$(top_builddir)/src/cli/libopenthread-cli-ftd.a \
|
||||
$(top_builddir)/src/ncp/libopenthread-ncp-ftd.a \
|
||||
$(top_builddir)/src/core/libopenthread-ftd.a \
|
||||
$(LDADD_COMMON) \
|
||||
$(NULL)
|
||||
|
||||
@@ -32,8 +32,8 @@ lib_LIBRARIES = libopenthread-posix.a
|
||||
|
||||
libopenthread_posix_a_CPPFLAGS = \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_srcdir)/src/core \
|
||||
-I$(top_srcdir)/src/ncp \
|
||||
-I$(top_srcdir)/src/posix/platform \
|
||||
-D_GNU_SOURCE \
|
||||
$(OPENTHREAD_TARGET_DEFINES) \
|
||||
@@ -53,18 +53,6 @@ libopenthread_posix_a_SOURCES = \
|
||||
uart.c \
|
||||
$(NULL)
|
||||
|
||||
INC_NCP_SOURCES = \
|
||||
inc_spinel.c \
|
||||
inc_hdlc.cpp \
|
||||
$(NULL)
|
||||
|
||||
nodist_libopenthread_posix_a_SOURCES = \
|
||||
$(INC_NCP_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
inc_%: ../../ncp/%
|
||||
echo '#include "$<"' > $@
|
||||
|
||||
if OPENTHREAD_ENABLE_PLATFORM_UDP
|
||||
libopenthread_posix_a_SOURCES += \
|
||||
udp.cpp \
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
#include "platform-config.h"
|
||||
|
||||
#include "hdlc.hpp"
|
||||
#include "ncp/hdlc.hpp"
|
||||
|
||||
namespace ot {
|
||||
namespace PosixApp {
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <openthread/platform/radio.h>
|
||||
|
||||
#include "hdlc_interface.hpp"
|
||||
#include "spinel.h"
|
||||
#include "ncp/spinel.h"
|
||||
|
||||
namespace ot {
|
||||
namespace PosixApp {
|
||||
|
||||
Reference in New Issue
Block a user