diff options
author | Philip Chimento <philip@endlessm.com> | 2015-08-27 15:11:18 -0700 |
---|---|---|
committer | Philip Chimento <philip@endlessm.com> | 2015-08-27 15:42:14 -0700 |
commit | 9fa3cbe4ccfbdb8b7ed530a391f13cfe80591e2e (patch) | |
tree | 8b0fa4a49b09b24de9d07b82c40292a2e56ee17d | |
parent | a2e4acd229ff4c23adc522e9dff3b7a807ba080a (diff) |
Use AM_CONDITIONAL in eos-coverage.m4
Using an Automake conditional makes the mess of AS_IFs slightly simpler
and will allow us to access the value of EOS_ENABLE_COVERAGE in our
Makefile.am.
[endlessm/eos-sdk#3303]
-rw-r--r-- | m4/eos-coverage.m4 | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/m4/eos-coverage.m4 b/m4/eos-coverage.m4 index cf92afc..ad69689 100644 --- a/m4/eos-coverage.m4 +++ b/m4/eos-coverage.m4 @@ -193,8 +193,7 @@ AC_DEFUN_ONCE([EOS_COVERAGE_REPORT], [ ]) # Now that we've figured out if we have coverage reports, build the rules - AS_IF([test "x$EOS_ENABLE_COVERAGE" = "xyes"], [ - EOS_COVERAGE_RULES_HEADER=' + EOS_COVERAGE_RULES_HEADER=' # This file was generated by eos-coverage.m4 # # Internal variable to track the coverage accumulated counter files. @@ -210,7 +209,7 @@ _eos_coverage_trace_path := $(EOS_COVERAGE_DIR)/output ' - EOS_COVERAGE_RULES_TARGETS=' + EOS_COVERAGE_RULES_TARGETS=' # First check that all the required variables have been set. This includes: # - LCOV @@ -245,8 +244,8 @@ eos-collect-coverage: $(_eos_collect_coverage_targets) clean-coverage: $(_eos_clean_coverage_targets) rm -rf $(EOS_DEFAULT_COVERAGE_DIR) ' - ], [ - EOS_COVERAGE_RULES_TARGETS=' + + EOS_COVERAGE_RULES_TARGETS_DISABLED=' # Define the targets just to print an error if coverage reports are not enabled eos-collect-coverage: @echo "--enable-coverage must be passed to ./configure" @@ -254,7 +253,7 @@ eos-collect-coverage: clean-coverage: @echo "no coverage data generated, so none to clean" - ']) +' AS_IF([test "x$EOS_HAVE_GENHTML" = "xyes"], [ EOS_GENHTML_COVERAGE_RULES=' @@ -425,13 +424,17 @@ CLEANFILES += run_coverage.coverage ' EOS_COVERAGE_RULES="$EOS_COVERAGE_RULES_HEADER $EOS_GENHTML_COVERAGE_RULES $EOS_COBERTURA_COVERAGE_RULES $EOS_C_COVERAGE_RULES $EOS_JS_COVERAGE_RULES $EOS_COVERAGE_RULES_TARGETS $EOS_COVERAGE_AUTORUN_GENERATED_TARGET $EOS_COVERAGE_RULES_FOOTER" + EOS_COVERAGE_RULES_DISABLED="$EOS_COVERAGE_RULES_TARGETS_DISABLED $EOS_COVERAGE_AUTORUN_GENERATED_TARGET $EOS_COVERAGE_RULES_FOOTER" + + AM_CONDITIONAL([EOS_ENABLE_COVERAGE], [test "x$EOS_ENABLE_COVERAGE" = "xyes"]) # Substitute at the top first AC_SUBST([EOS_COVERAGE_DIR]) AC_SUBST([EOS_DEFAULT_COVERAGE_DIR]) + AM_COND_IF([EOS_ENABLE_COVERAGE], [AC_SUBST([EOS_COVERAGE_RULES])], + [AC_SUBST([EOS_COVERAGE_RULES], [$EOS_COVERAGE_RULES_DISABLED])]) # We only want to define this to use it for full substitution, not as a variable - AC_SUBST([EOS_COVERAGE_RULES]) AM_SUBST_NOTMAKE([EOS_COVERAGE_RULES]) AC_SUBST([EOS_COVERAGE_CLEAN_RULES]) |