-# Forcing some make variables to be actual absolute paths to fix Coverage
+# if coverage is enabled:
+# COVERAGE_ON = yes from configure.ac
+# Using an inline conditional function to choose between absolute and
+# relative paths for options files
# lcov does not support relative paths and src/options and src/expr
# in particular were breaking it
-# Note: variable declarations may be moved in generated Makefile
-# see src/expr/Makefile.am
-
-VPATH = $(realpath @srcdir@)
-srcdir = $(realpath @srcdir@)
-abs_srcdir = $(realpath @abs_srcdir@)
-abs_top_srcdir = $(realpath @abs_top_srcdir@)
-top_srcdir = $(realpath @top_srcdir@)
-
+# Building with coverage will cause portability issues in some cases
AM_CPPFLAGS = \
-D__BUILDING_CVC4LIB \
- -I$(realpath @builddir@/..) -I$(realpath @srcdir@/../include) -I$(realpath @srcdir@/..)
+ $(if $(COVERAGE_ON), -I@abs_builddir@/.. -I@abs_srcdir@/../include -I@abs_srcdir@/.., \
+ -I@builddir@/.. -I@srcdir@/../include -I@srcdir@/..)
AM_CXXFLAGS = -Wall -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN)
noinst_LTLIBRARIES = libexpr.la
$(top_builddir)/src/expr/.subdirs: $(top_srcdir)/src/Makefile.theories @top_srcdir@/src/mksubdirs
$(AM_V_at)test -d $(top_builddir)/src/expr || mkdir $(top_builddir)/src/expr
$(AM_V_at)chmod +x @top_srcdir@/src/mksubdirs
- $(AM_V_at)( @top_srcdir@/src/mksubdirs "$(top_srcdir)" ) > $(top_builddir)/src/expr/.subdirs.tmp
+ $(AM_V_at)( @top_srcdir@/src/mksubdirs $(if $(COVERAGE_ON), "$(abs_top_srcdir)", "$(top_srcdir)")) > $(top_builddir)/src/expr/.subdirs.tmp
@if ! diff -q $(top_builddir)/src/expr/.subdirs $(top_builddir)/src/expr/.subdirs.tmp &>/dev/null; then \
echo " GEN " $@; \
$(am__mv) $(top_builddir)/src/expr/.subdirs.tmp $(top_builddir)/src/expr/.subdirs; \
fi
-kind.h: kind_template.h mkkind @top_builddir@/src/expr/.subdirs @top_srcdir@/src/theory/*/kinds
+kind.h: kind_template.h mkkind @top_builddir@/src/expr/.subdirs $(if $(COVERAGE_ON), @abs_top_srcdir@, @top_srcdir@)/src/theory/*/kinds
$(AM_V_at)chmod +x @srcdir@/mkkind
$(AM_V_at)$(am__mv) $@ $@~ 2>/dev/null || true
$(AM_V_GEN)(@srcdir@/mkkind \
`cat @top_builddir@/src/expr/.subdirs` \
> $@) || (rm -f $@ && exit 1)
-metakind.h: metakind_template.h mkmetakind @top_builddir@/src/expr/.subdirs @top_srcdir@/src/theory/*/kinds
+metakind.h: metakind_template.h mkmetakind @top_builddir@/src/expr/.subdirs $(if $(COVERAGE_ON), @abs_top_srcdir@, @top_srcdir@)/src/theory/*/kinds
$(AM_V_at)chmod +x @srcdir@/mkmetakind
$(AM_V_at)$(am__mv) $@ $@~ 2>/dev/null || true
$(AM_V_GEN)(@srcdir@/mkmetakind \
`cat @top_builddir@/src/expr/.subdirs` \
> $@) || (rm -f $@ && exit 1)
-type_properties.h: type_properties_template.h mkkind @top_builddir@/src/expr/.subdirs @top_srcdir@/src/theory/*/kinds
+type_properties.h: type_properties_template.h mkkind @top_builddir@/src/expr/.subdirs $(if $(COVERAGE_ON), @abs_top_srcdir@, @top_srcdir@)/src/theory/*/kinds
$(AM_V_at)chmod +x @srcdir@/mkkind
$(AM_V_at)$(am__mv) $@ $@~ 2>/dev/null || true
$(AM_V_GEN)(@srcdir@/mkkind \
`cat @top_builddir@/src/expr/.subdirs` \
> $@) || (rm -f $@ && exit 1)
-expr.h: expr_template.h mkexpr @top_builddir@/src/expr/.subdirs @top_srcdir@/src/theory/*/kinds
+expr.h: expr_template.h mkexpr @top_builddir@/src/expr/.subdirs $(if $(COVERAGE_ON), @abs_top_srcdir@, @top_srcdir@)/src/theory/*/kinds
$(AM_V_at)chmod +x @srcdir@/mkexpr
$(AM_V_at)$(am__mv) $@ $@~ 2>/dev/null || true
$(AM_V_GEN)(@srcdir@/mkexpr \
`cat @top_builddir@/src/expr/.subdirs` \
> $@) || (rm -f $@ && exit 1)
-expr.cpp: expr_template.cpp mkexpr @top_builddir@/src/expr/.subdirs @top_srcdir@/src/theory/*/kinds
+expr.cpp: expr_template.cpp mkexpr @top_builddir@/src/expr/.subdirs $(if $(COVERAGE_ON), @abs_top_srcdir@, @top_srcdir@)/src/theory/*/kinds
$(AM_V_at)chmod +x @srcdir@/mkexpr
$(AM_V_at)$(am__mv) $@ $@~ 2>/dev/null || true
$(AM_V_GEN)(@srcdir@/mkexpr \
`cat @top_builddir@/src/expr/.subdirs` \
> $@) || (rm -f $@ && exit 1)
-expr_manager.h: expr_manager_template.h mkexpr @top_builddir@/src/expr/.subdirs @top_srcdir@/src/theory/*/kinds
+expr_manager.h: expr_manager_template.h mkexpr @top_builddir@/src/expr/.subdirs $(if $(COVERAGE_ON), @abs_top_srcdir@, @top_srcdir@)/src/theory/*/kinds
$(AM_V_at)chmod +x @srcdir@/mkexpr
$(AM_V_at)$(am__mv) $@ $@~ 2>/dev/null || true
$(AM_V_GEN)(@srcdir@/mkexpr \
`cat @top_builddir@/src/expr/.subdirs` \
> $@) || (rm -f $@ && exit 1)
-expr_manager.cpp: expr_manager_template.cpp mkexpr @top_builddir@/src/expr/.subdirs @top_srcdir@/src/theory/*/kinds
+expr_manager.cpp: expr_manager_template.cpp mkexpr @top_builddir@/src/expr/.subdirs $(if $(COVERAGE_ON), @abs_top_srcdir@, @top_srcdir@)/src/theory/*/kinds
$(AM_V_at)chmod +x @srcdir@/mkexpr
$(AM_V_at)$(am__mv) $@ $@~ 2>/dev/null || true
$(AM_V_GEN)(@srcdir@/mkexpr \
`cat @top_builddir@/src/expr/.subdirs` \
> $@) || (rm -f $@ && exit 1)
-type_checker.cpp: type_checker_template.cpp mkexpr @top_builddir@/src/expr/.subdirs @top_srcdir@/src/theory/*/kinds
+type_checker.cpp: type_checker_template.cpp mkexpr @top_builddir@/src/expr/.subdirs $(if $(COVERAGE_ON), @abs_top_srcdir@, @top_srcdir@)/src/theory/*/kinds
$(AM_V_at)chmod +x @srcdir@/mkexpr
$(AM_V_at)$(am__mv) $@ $@~ 2>/dev/null || true
$(AM_V_GEN)(@srcdir@/mkexpr \
# This stage also waits for X_options.h as otherwise it cannot compile.
#
-# Forcing some make variables to be actual absolute paths to fix Coverage
+# if coverage is enabled:
+# COVERAGE_ON = yes from configure.ac
+# Using an inline conditional function to choose between absolute and
+# relative paths for options files
# lcov does not support relative paths and src/options and src/expr
# in particular were breaking it
-# Note: variable declarations may be moved in generated Makefile
-# see src/options/Makefile.am
+# Building with coverage will cause portability issues in some cases
-VPATH = $(realpath @srcdir@)
-srcdir = $(realpath @srcdir@)
-abs_srcdir = $(realpath @abs_srcdir@)
-abs_top_srcdir = $(realpath @abs_top_srcdir@)
-top_srcdir = $(realpath @top_srcdir@)
OPTIONS_SRC_FILES = \
arith_options \
AM_CPPFLAGS = \
-D__BUILDING_CVC4LIB \
- -I$(realpath @builddir@/..) -I$(realpath @srcdir@/../include) -I$(realpath @srcdir@/..)
+ $(if $(COVERAGE_ON), -I@abs_builddir@/.. -I@abs_srcdir@/../include -I@abs_srcdir@/.., \
+ -I@builddir@/.. -I@srcdir@/../include -I@srcdir@/..)
AM_CXXFLAGS = -Wall $(FLAG_VISIBILITY_HIDDEN)
noinst_LTLIBRARIES = liboptions.la
# Make is happier being listed explictly. Not sure why.
arith_options.tmp arrays_options.tmp base_options.tmp booleans_options.tmp builtin_options.tmp bv_options.tmp datatypes_options.tmp decision_options.tmp expr_options.tmp fp_options.tmp idl_options.tmp main_options.tmp parser_options.tmp printer_options.tmp proof_options.tmp prop_options.tmp quantifiers_options.tmp sep_options.tmp sets_options.tmp smt_options.tmp strings_options.tmp theory_options.tmp uf_options.tmp:
echo "$@" "$(@:.tmp=)"
- $(AM_V_GEN)(cp "$(realpath @srcdir@/$(@:.tmp=))" "$@" || true)
+ $(AM_V_GEN)(cp $(if $(COVERAGE_ON), "@abs_srcdir@/$(@:.tmp=)", "@srcdir@/$(@:.tmp=)") "$@" || true)
#TIM:
#The (... || true) here is to make distcheck not fail.
# We use the updating of %_options.options to signal that the options file updated.
# However, we use the original file in src to generate the file.
%_options.sed: %_options.options mkoptions
- $(AM_V_at)chmod +x $(realpath @srcdir@/mkoptions)
- $(AM_V_GEN)($(realpath @srcdir@/mkoptions) module-sed "$(realpath @srcdir@/$(@:.sed=))" ) > "$@"
+ $(AM_V_at)chmod +x @srcdir@/mkoptions
+ $(AM_V_GEN)(@srcdir@/mkoptions module-sed $(if $(COVERAGE_ON), "@abs_srcdir@/$(@:.sed=)", "@srcdir@/$(@:.sed=)")) > "$@"
$(CPP_TEMPLATE_SEDS): %.sed : % mkoptions
# echo "template seds"
# echo "$@"
# echo $(TEMPLATE_SEDS)
- $(AM_V_at)chmod +x $(realpath @srcdir@/mkoptions)
- $(AM_V_GEN)($(realpath @srcdir@/mkoptions) template-sed "$<" ) > "$@"
+ $(AM_V_at)chmod +x @srcdir@/mkoptions
+ $(AM_V_GEN)(@srcdir@/mkoptions template-sed "$<" ) > "$@"
$(DOCUMENTATION_TEMPLATE_SEDS): %.sed : % mkoptions
# echo "template seds"
# echo "$@"
# echo $(TEMPLATE_SEDS)
- $(AM_V_at)chmod +x $(realpath @srcdir@/mkoptions)
- $(AM_V_GEN)($(realpath @srcdir@/mkoptions) template-sed "$<" ) > "$@"
+ $(AM_V_at)chmod +x @srcdir@/mkoptions
+ $(AM_V_GEN)(@srcdir@/mkoptions template-sed "$<" ) > "$@"
%_options.h : %_options.sed mkoptions base_options_template.h base_options_template.h.sed
# echo heads
# echo "$@"
# echo $(OPTIONS_HEADS)
- $(AM_V_at)chmod +x $(realpath @srcdir@/mkoptions)
- $(AM_V_GEN)($(realpath @srcdir@/mkoptions) apply-sed-files-to-template \
- $(realpath @srcdir@/base_options_template.h) \
+ $(AM_V_at)chmod +x @srcdir@/mkoptions
+ $(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
+ $(if $(COVERAGE_ON), @abs_srcdir@, @srcdir@)/base_options_template.h \
base_options_template.h.sed \
"$<" \
) > "$@"
summary.sed : mkoptions $(OPTIONS_OPTIONS_FILES)
- $(AM_V_at)chmod +x $(realpath @srcdir@/mkoptions)
- $(AM_V_GEN)($(realpath @srcdir@/mkoptions) summary-sed \
+ $(AM_V_at)chmod +x @srcdir@/mkoptions
+ $(AM_V_GEN)(@srcdir@/mkoptions summary-sed \
$(OPTIONS_OPTIONS_FILES) \
) > summary.sed
# mkoptions apply-sed-to-template sed-file template-file
options_holder.h : options_holder_template.h options_holder_template.h.sed summary.sed mkoptions $(OPTIONS_HEADS)
- $(AM_V_at)chmod +x $(realpath @srcdir@/mkoptions)
- $(AM_V_GEN)($(realpath @srcdir@/mkoptions) apply-sed-files-to-template \
- $(realpath @srcdir@/options_holder_template.h) \
+ $(AM_V_at)chmod +x @srcdir@/mkoptions
+ $(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
+ $(if $(COVERAGE_ON), @abs_srcdir@, @srcdir@)/options_holder_template.h \
@builddir@/options_holder_template.h.sed \
summary.sed \
) > "$@"
# Make sure not to match with "options.cpp" too.
%_options.cpp: %_options.sed %_options.h mkoptions options_holder.h base_options_template.cpp base_options_template.cpp.sed
- $(AM_V_at)chmod +x $(realpath @srcdir@/mkoptions)
- $(AM_V_GEN)($(realpath @srcdir@/mkoptions) apply-sed-files-to-template \
- $(realpath @srcdir@/base_options_template.cpp) \
+ $(AM_V_at)chmod +x @srcdir@/mkoptions
+ $(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
+ $(if $(COVERAGE_ON), @abs_srcdir@, @srcdir@)/base_options_template.cpp \
base_options_template.cpp.sed \
"$<" \
) > "$@"
# mkoptions apply-sed-to-template sed-file template-file
options.cpp : options_template.cpp options_template.cpp.sed mkoptions summary.sed $(OPTIONS_HEADS) options_holder.h
- $(AM_V_at)chmod +x $(realpath @srcdir@/mkoptions)
- $(AM_V_GEN)($(realpath @srcdir@/mkoptions) apply-sed-files-to-template \
- $(realpath @srcdir@/options_template.cpp) \
+ $(AM_V_at)chmod +x @srcdir@/mkoptions
+ $(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
+ $(if $(COVERAGE_ON), @abs_srcdir@, @srcdir@)/options_template.cpp \
@builddir@/options_template.cpp.sed \
summary.sed \
) > "$@"
# mkoptions apply-sed-to-template sed-file template-file
options_get_option.cpp : options_get_option_template.cpp options_get_option_template.cpp.sed mkoptions summary.sed $(OPTIONS_HEADS)
- $(AM_V_at)chmod +x $(realpath @srcdir@/mkoptions)
- $(AM_V_GEN)($(realpath @srcdir@/mkoptions) apply-sed-files-to-template \
- $(realpath @srcdir@/options_get_option_template.cpp) \
+ $(AM_V_at)chmod +x @srcdir@/mkoptions
+ $(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
+ $(if $(COVERAGE_ON), @abs_srcdir@, @srcdir@)/options_get_option_template.cpp \
@builddir@/options_get_option_template.cpp.sed \
summary.sed \
) > "$@"
options_set_option.cpp : options_set_option_template.cpp options_set_option_template.cpp.sed mkoptions summary.sed $(OPTIONS_HEADS)
- $(AM_V_at)chmod +x $(realpath @srcdir@/mkoptions)
- $(AM_V_GEN)($(realpath @srcdir@/mkoptions) apply-sed-files-to-template \
- $(realpath @srcdir@/options_set_option_template.cpp) \
+ $(AM_V_at)chmod +x @srcdir@/mkoptions
+ $(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
+ $(if $(COVERAGE_ON), @abs_srcdir@, @srcdir@)/options_set_option_template.cpp \
@builddir@/options_set_option_template.cpp.sed \
summary.sed \
) > "$@"
$(DOCUMENTATION_FILES) : % : %_template %_template.sed mkoptions summary.sed
# echo "$<"
# echo "$@"
- $(AM_V_at)chmod +x $(realpath @srcdir@/mkoptions)
- $(AM_V_GEN)($(realpath @srcdir@/mkoptions) apply-sed-files-to-template \
+ $(AM_V_at)chmod +x @srcdir@/mkoptions
+ $(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
"$<" \
"$<".sed \
@builddir@/summary.sed \