From 39cd92c743254c3e4d8233e4ccb5a1623af34e80 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Wed, 12 Sep 2018 20:17:17 -1000 Subject: [PATCH] [build] conditionally build cli and ncp FTD/MTD/radio libs (#3067) --- src/cli/Makefile.am | 13 +++++++++---- src/ncp/Makefile.am | 17 ++++++++++++----- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/cli/Makefile.am b/src/cli/Makefile.am index 09c489ca7..d97a29574 100644 --- a/src/cli/Makefile.am +++ b/src/cli/Makefile.am @@ -108,10 +108,15 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am # Unless and until these libraries do not "accidently" suck in # a "flavored" header file somewhere. -lib_LIBRARIES = \ - libopenthread-cli-mtd.a \ - libopenthread-cli-ftd.a \ - $(NULL) +lib_LIBRARIES = $(NULL) + +if OPENTHREAD_ENABLE_FTD +lib_LIBRARIES += libopenthread-cli-ftd.a +endif + +if OPENTHREAD_ENABLE_MTD +lib_LIBRARIES += libopenthread-cli-mtd.a +endif CPPFLAGS_COMMON = \ -I$(top_srcdir)/include \ diff --git a/src/ncp/Makefile.am b/src/ncp/Makefile.am index f17f9ba6d..f01b41fdd 100644 --- a/src/ncp/Makefile.am +++ b/src/ncp/Makefile.am @@ -34,12 +34,19 @@ EXTRA_DIST = \ # Pull in the sources that comprise the OpenThread NCP library. -lib_LIBRARIES = \ - libopenthread-ncp-mtd.a \ - libopenthread-ncp-ftd.a \ - libopenthread-ncp-radio.a \ - $(NULL) +lib_LIBRARIES = $(NULL) +if OPENTHREAD_ENABLE_FTD +lib_LIBRARIES += libopenthread-ncp-ftd.a +endif + +if OPENTHREAD_ENABLE_MTD +lib_LIBRARIES += libopenthread-ncp-mtd.a +endif + +if OPENTHREAD_ENABLE_RADIO_ONLY +lib_LIBRARIES += libopenthread-ncp-radio.a +endif COMMON_CPPFLAGS = \ -I$(top_srcdir)/include \