[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:
Abtin Keshavarzian
2019-07-09 13:24:41 -07:00
committed by Jonathan Hui
parent 21221d9903
commit d92733661c
5 changed files with 10 additions and 18 deletions
+3 -3
View File
@@ -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);
}
+4
View File
@@ -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)
+1 -13
View File
@@ -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 \
+1 -1
View File
@@ -36,7 +36,7 @@
#include "platform-config.h"
#include "hdlc.hpp"
#include "ncp/hdlc.hpp"
namespace ot {
namespace PosixApp {
+1 -1
View File
@@ -37,7 +37,7 @@
#include <openthread/platform/radio.h>
#include "hdlc_interface.hpp"
#include "spinel.h"
#include "ncp/spinel.h"
namespace ot {
namespace PosixApp {