From 9270cb437703860b9b2804f36923b90ef45b5ba8 Mon Sep 17 00:00:00 2001 From: rongli Date: Sat, 2 Dec 2017 09:59:26 +0800 Subject: [PATCH] [build] config LOG_OUTPUT_APP when CERT_LOG is enabled (#2315) --- examples/Makefile-emsk | 20 +------------ examples/Makefile-nrf52840 | 4 +-- examples/Makefile-posix | 58 ++++++++++++++++++------------------- examples/common-switches.mk | 1 + 4 files changed, 32 insertions(+), 51 deletions(-) diff --git a/examples/Makefile-emsk b/examples/Makefile-emsk index b284111c3..3395a4f64 100644 --- a/examples/Makefile-emsk +++ b/examples/Makefile-emsk @@ -49,25 +49,7 @@ configure_OPTIONS = \ --enable-linker-map \ $(NULL) -ifeq ($(CERT_LOG),1) -configure_OPTIONS += --enable-cert-log -endif - -ifeq ($(COMMISSIONER),1) -configure_OPTIONS += --enable-commissioner -endif - -ifeq ($(JOINER),1) -configure_OPTIONS += --enable-joiner -endif - -ifeq ($(DHCP6_SERVER),1) -configure_OPTIONS += --enable-dhcp6-server -endif - -ifeq ($(DHCP6_CLIENT),1) -configure_OPTIONS += --enable-dhcp6-client -endif +include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST)))).. AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))).. diff --git a/examples/Makefile-nrf52840 b/examples/Makefile-nrf52840 index 0f173c063..db4ae2ae6 100644 --- a/examples/Makefile-nrf52840 +++ b/examples/Makefile-nrf52840 @@ -79,9 +79,7 @@ COMMONCFLAGS := \ -I$(CONFIG_FILE_PATH) \ $(NULL) -ifeq ($(CERT_LOG),1) -COMMONCFLAGS += -DOPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_APP -else +ifneq ($(CERT_LOG),1) COMMONCFLAGS += -DOPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED endif diff --git a/examples/Makefile-posix b/examples/Makefile-posix index e0dda1a65..2cc371a98 100644 --- a/examples/Makefile-posix +++ b/examples/Makefile-posix @@ -41,6 +41,35 @@ RM_F := rm -f BuildJobs ?= 10 +# If the user has asserted COVERAGE, alter the configuration options +# accordingly. + +configure_OPTIONS = \ + --enable-application-coap \ + --enable-border-router \ + --enable-cert-log \ + --enable-child-supervision \ + --enable-cli-app=all \ + --enable-commissioner \ + --enable-dhcp6-client \ + --enable-dhcp6-server \ + --enable-diag \ + --enable-dns-client \ + --enable-jam-detection \ + --enable-joiner \ + --enable-legacy \ + --enable-mac-filter \ + --enable-mtd-network-diagnostic \ + --enable-ncp-app=all \ + --enable-raw-link-api \ + --enable-service \ + --enable-tmf-proxy \ + --with-examples=posix \ + --with-ncp-bus=uart \ + $(NULL) + +include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk + TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST)))).. AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))).. @@ -86,35 +115,6 @@ AbsTopResultDir = $(PWD)/$(TopResultDir) TargetTuple = $(shell ${AbsTopSourceDir}/third_party/nlbuild-autotools/repo/autoconf/config.guess | sed -e 's/[[:digit:].]*$$//g') -# If the user has asserted COVERAGE, alter the configuration options -# accordingly. - -configure_OPTIONS = \ - --enable-application-coap \ - --enable-border-router \ - --enable-cert-log \ - --enable-child-supervision \ - --enable-cli-app=all \ - --enable-commissioner \ - --enable-dhcp6-client \ - --enable-dhcp6-server \ - --enable-diag \ - --enable-dns-client \ - --enable-jam-detection \ - --enable-joiner \ - --enable-legacy \ - --enable-mac-filter \ - --enable-mtd-network-diagnostic \ - --enable-ncp-app=all \ - --enable-raw-link-api \ - --enable-service \ - --enable-tmf-proxy \ - --with-examples=posix \ - --with-ncp-bus=uart \ - $(NULL) - -include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk - ifndef BuildJobs BuildJobs := $(shell getconf _NPROCESSORS_ONLN) endif diff --git a/examples/common-switches.mk b/examples/common-switches.mk index c97841f34..ba199c831 100644 --- a/examples/common-switches.mk +++ b/examples/common-switches.mk @@ -31,6 +31,7 @@ configure_OPTIONS += --enable-border-router endif ifeq ($(CERT_LOG),1) +COMMONCFLAGS += -DOPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_APP configure_OPTIONS += --enable-cert-log endif