update nlbuild-autotools (#170)

This commit is contained in:
Marcin K Szczodrak
2016-06-21 11:56:17 -07:00
committed by Jonathan Hui
parent 62fab61417
commit f64dfe31f6
12 changed files with 115 additions and 46 deletions
+6 -6
View File
@@ -268,9 +268,9 @@ AM_CONDITIONAL([OPENTHREAD_BUILD_OPTIMIZED], [test "${nl_cv_build_optimized}" =
# Code style
#
AC_SUBST(ASTYLE, ["\${abs_top_srcdir}/.astyle/astyle-wrap.sh"])
AC_SUBST(ASTYLE_PRETTY_ARGS, ["astyle --options=\${abs_top_builddir}/.astyle/astyle-opts"])
AC_SUBST(ASTYLE_PRETTY_CHECK_ARGS, ["astyle --options=\${abs_top_builddir}/.astyle/astyle-opts --dry-run"])
AC_SUBST(PRETTY, ["\${abs_top_srcdir}/.astyle/astyle-wrap.sh"])
AC_SUBST(PRETTY_ARGS, ["astyle --options=\${abs_top_builddir}/.astyle/astyle-opts"])
AC_SUBST(PRETTY_CHECK_ARGS, ["astyle --options=\${abs_top_builddir}/.astyle/astyle-opts --dry-run"])
#
# Tests
@@ -592,9 +592,9 @@ AC_MSG_NOTICE([
C++ Compile flags : ${CXXFLAGS:--}
Link flags : ${LDFLAGS:--}
Link libraries : ${LIBS}
Astyle : ${ASTYLE}
Astyle pretty args : ${ASTYLE_PRETTY_ARGS}
Astyle pretty check args : ${ASTYLE_PRETTY_CHECK_ARGS}
Astyle : ${PRETTY}
Astyle pretty args : ${PRETTY_ARGS}
Astyle pretty check args : ${PRETTY_CHECK_ARGS}
OpenThread CLI support : ${enable_cli}
OpenThread NCP support : ${enable_ncp}
OpenThread examples : ${OPENTHREAD_EXAMPLES}
@@ -86,6 +86,7 @@ AC_DEFUN([NL_ENABLE_COVERAGE],
])
if test "${nl_cv_build_coverage}" = "yes"; then
AM_EXTRA_RECURSIVE_TARGETS([coverage])
if test "${GCC}" != "yes"; then
AC_MSG_ERROR([GCC or a GCC-compatible toolchain is required for --enable-coverage])
@@ -20,20 +20,13 @@
# targets and rules.
#
# This represents the minimum integration with GNU autotools
# (automake inparticular) such that 'make coverage' may be invoked
# (automake in particular) such that 'make coverage' may be invoked
# at the top of the tree and all the prerequisites occur such
# that it executes successfully with no intervening make target
# invocations. The 'check-am' and '$(BUILT_SOURCES)' are the key
# automake-specific dependencies to ensure that happens.
#
.PHONY: coverage coverage-recursive
coverage-local: check-am
coverage: coverage-recursive
coverage: check-am
coverage: $(BUILT_SOURCES)
coverage-recursive:
$(nl-make-subdirs)
coverage-local: $(BUILT_SOURCES)
@@ -16,40 +16,62 @@
#
# Description:
# This file is the automake footer for code style checking and
# reformatting related targets and rules.
# This file is the automake footer for all coding style-related
# targets and rules.
#
# The recursive target 'pretty', invoked against '$(PRETTY_SUBDIRS)',
# is intended to reformat a collection of source files, defined by
# '$(PRETTY_FILES)' using the program '$(PRETTY)' with the arguments
# '$(PRETTY_ARGS)'.
#
# The recursive target 'pretty-check' (and its alias 'lint'),
# invoked against '$(PRETTY_SUBDIRS)', is intended to only check
# but NOT reformat a collection of source files, defined by
# '$(PRETTY_FILES)' using the program '$(PRETTY_CHECK)' with the
# arguments '$(PRETTY_CHECK_ARGS)'.
#
# This represents the minimum integration with GNU autotools
# (automake inparticular) such that 'make pretty' and 'make
# pretty-check' may be invoked at the top of the tree and all
# the prerequisites occur such that it executes successfully
# with no intervening make target invocations. '$(BUILT_SOURCES)'
# are the key automake-specific dependencies to ensure that happens.
#
# nl-make-pretty <TERSE OUTPUT COMMAND> <COMMAND> <COMMAND ARGUMENTS>
#
# This function iterates over PRETTY_FILES, invoking COMMAND with
# COMMAND ARGUEMENTS on each file. If a non-verbose make has been
# requested TERSE OUTPUT COMMAND is emitted to standard output.
define nl-make-pretty
$(AM_V_at)for file in $(PRETTY_FILES); do \
$(1) \
if test -f $${file}; then d=.; else d=$(srcdir); fi; \
$(2) $(3) $${d}/$${file} \
|| exit 1; \
done
endef
.PHONY: pretty pretty-recursive pretty-check pretty-check-recursive lint
pretty: pretty-recursive
#
# 'pretty' target calls astyle on each file in SOURCES and HEADERS.
# This iteratively calls astyle on each file. astyle seems to retain
# state from processing a previous file, which sometimes causes
# formatting of a subsequent file to fail.
#
pretty:
ifneq ($(SOURCES) $(HEADERS),)
$(AM_V_at) for file in $(SOURCES) $(HEADERS); do $(ASTYLE) $(ASTYLE_PRETTY_ARGS) $$file; done
endif
pretty pretty-check: $(BUILT_SOURCES)
pretty-check: pretty-recursive
lint: pretty-check
#
# 'pretty-check' target calls astyle on each file in SOURCES and HEADERS.
# This iteratively calls astyle on each file. astyle seems to retain
# state from processing a previous file, which sometimes causes
# formatting of a subsequent file to fail.
#
pretty-check:
ifneq ($(SOURCES) $(HEADERS),)
$(AM_V_at)for file in $(SOURCES) $(HEADERS); do \
if [[ -n `$(ASTYLE) $(ASTYLE_PRETTY_CHECK_ARGS) $$file` ]]; then \
echo "Code style error. Run 'make pretty' to reformat."; \
exit 1; \
fi \
done
endif
pretty-check: pretty-check-recursive
pretty-recursive:
pretty-recursive pretty-check-recursive:
$(call nl-make-subdirs-with-dirs,$(PRETTY_SUBDIRS))
pretty:
ifneq ($(PRETTY),)
$(call nl-make-pretty,$(AM_V_PRETTY),$(PRETTY),$(PRETTY_ARGS))
endif
pretty-check:
ifneq ($(PRETTY_CHECK),)
$(call nl-make-pretty,$(AM_V_PRETTY_CHECK),$(PRETTY_CHECK),$(PRETTY_CHECK_ARGS))
endif
@@ -22,6 +22,7 @@
include $(abs_top_nlbuild_autotools_dir)/automake/pre/macros/constants.am
include $(abs_top_nlbuild_autotools_dir)/automake/pre/macros/paths.am
include $(abs_top_nlbuild_autotools_dir)/automake/pre/macros/pretty.am
include $(abs_top_nlbuild_autotools_dir)/automake/pre/macros/verbosity.am
include $(abs_top_nlbuild_autotools_dir)/automake/pre/macros/coverage.am
include $(abs_top_nlbuild_autotools_dir)/automake/pre/macros/subdirs.am
@@ -0,0 +1,52 @@
#
# Copyright 2016 Nest Labs Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Description:
# This file defines automake variables for performing coding
# style formatting and checking.
#
AM_V_PRETTY = $(am__v_PRETTY_$(V))
am__v_PRETTY_ = $(am__v_PRETTY_$(AM_DEFAULT_VERBOSITY))
am__v_PRETTY_0 = echo " PRETTY $${file}";
am__v_PRETTY_1 =
AM_V_PRETTY_CHECK = $(am__v_PRETTY_CHECK_$(V))
am__v_PRETTY_CHECK_ = $(am__v_PRETTY_CHECK_$(AM_DEFAULT_VERBOSITY))
am__v_PRETTY_CHECK_0 = echo " PRETTY $${file}";
am__v_PRETTY_CHECK_1 =
# PRETTY_FILES
#
# This defines the collection of files against which the PRETTY and
# PRETTY_CHECK profiles will be invoked for the 'pretty' and
# 'pretty-check' targets, respectively.
#
# This defaults to SOURCES and HEADERS and may be overriden or
# appended to.
PRETTY_FILES ?= $(SOURCES) $(HEADERS)
# PRETTY_SUBDIRS
#
# This defines the subdirectories for which the recursive 'pretty' and
# 'pretty-check' targets will run against.
#
# This defaults to SUBDIRS and may be overridden or appended to.
PRETTY_SUBDIRS ?= $(SUBDIRS)
@@ -34,7 +34,7 @@
# attempt to make in each specified subdirectory.
#
define nl-make-subdirs-with-dirs-and-goals
$(AM_V_at)for subdir in $(1); do \
+$(AM_V_at)for subdir in $(1); do \
echo "Making $(2) in $${subdir}"; \
$(MAKE) -C "$${subdir}" $(AM_MAKEFLAGS) $(2) \
|| exit 1; \
@@ -0,0 +1 @@
libltdl.so.7.3.0
@@ -0,0 +1 @@
libltdl.so.7.3.0
@@ -0,0 +1 @@
libltdl.7.dylib
@@ -0,0 +1 @@
libltdl.so.7.3.0
@@ -0,0 +1 @@
libltdl.so.7.3.0