Skip to content

Commit

Permalink
Regenerate with recent zproject
Browse files Browse the repository at this point in the history
  • Loading branch information
jimklimov committed Mar 19, 2017
1 parent dcb88e5 commit b8f4712
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 18 deletions.
4 changes: 3 additions & 1 deletion Makefile.am
Expand Up @@ -30,7 +30,7 @@ check_PROGRAMS =
noinst_LTLIBRARIES =
TESTS =
# Prepare variables that can be populated (appended) in generated Makefiles or
# manually maintained src/Makemodules-local.am
# manually maintained src/Makemodule-local.am
EXTRA_DIST =
CLEANFILES =
DISTCLEANFILES =
Expand All @@ -51,6 +51,8 @@ EXTRA_DIST += \
src/mailbox.h \
src/fty_metric_cache_classes.h

# NOTE: this "include" syntax is not a "make" but an "autotools" keyword,
# see https://www.gnu.org/software/automake/manual/html_node/Include.html
include $(srcdir)/src/Makemodule.am
include $(srcdir)/src/Makemodule-local.am # Optional project-local hook

Expand Down
5 changes: 5 additions & 0 deletions autogen.sh
Expand Up @@ -6,6 +6,11 @@

# Script to generate all required files from fresh git checkout.

if [ ! -f src/Makemodule-local.am ] ; then
echo "autogen.sh: generating a dummy src/Makemodule-local.am to fulfill dependencies." 1>&2
touch src/Makemodule-local.am
fi

# Debian and Ubuntu do not shipt libtool anymore, but OSX does not ship libtoolize.
command -v libtoolize >/dev/null 2>&1
if [ $? -ne 0 ]; then
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Expand Up @@ -766,6 +766,7 @@ AM_COND_IF([WITH_SYSTEMD_UNITS],
])],
[])


AC_OUTPUT

# Print configure summary and list make options
Expand Down
14 changes: 13 additions & 1 deletion packaging/debian/rules
Expand Up @@ -25,17 +25,29 @@ endif
# Workaround for automake < 1.14 bug
$(shell dpkg --compare-versions `dpkg-query -W -f='$${Version}\n' automake` lt 1:1.14 && mkdir -p config)

.autogened: autogen.sh
@echo "Executing autogen.sh for this project..."
./autogen.sh
touch $@

clean-autogened:
rm -f .autogened

override_dh_strip:
dh_strip --dbg-package=fty-metric-cache-dbg

override_dh_auto_test:
echo "Skipped for now"

override_dh_auto_configure:
override_dh_auto_configure: .autogened
dh_auto_configure -- \
--with-systemd-units \
--enable-drafts=$(DRAFTS)

# Additional dependency for certain targets
build: .autogened
clean: clean-autogened

%:
dh $@ \
--with systemd \
Expand Down
3 changes: 3 additions & 0 deletions src/.gitignore
Expand Up @@ -13,6 +13,9 @@ libfty_metric_cache.pc
# + systemd service unit for daemons (if any):
fty-metric-cache.service

# location designated for writing self-tests:
selftest-rw/

################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Read the zproject/README.md for information about making permanent changes. #
Expand Down
79 changes: 63 additions & 16 deletions src/Makemodule.am
Expand Up @@ -82,44 +82,91 @@ src_fty_metric_cache_selftest_SOURCES = src/fty_metric_cache_selftest.c
endif #ENABLE_FTY_METRIC_CACHE_SELFTEST

# define custom target for all products of /src
src:
src/fty-metric-cache \
src/fty-metric-cache-cli \
src/fty_metric_cache_selftest \
src/libfty_metric_cache.la

cd $(srcdir); gsl -target:- project.xml

check-local: src/fty_metric_cache_selftest
src: \
src/fty-metric-cache \
src/fty-metric-cache-cli \
src/fty_metric_cache_selftest \
src/libfty_metric_cache.la


# Directories with test fixtures optionally provided by the project,
# and with volatile RW data possibly created by a selftest program.
# It is up to the project authors to populate the RO directory with
# filenames called from the selftest methods, if any. They will be
# EXTRA_DISTed by the recipes generated with with zproject, however,
# and copied into builddir (if different from srcdir) to simplify
# the "distcheck" and similar tests (so selftest can use same paths).
# Note that the RO directory must exist to fulfill EXTRA_DIST, so we
# add a stub file that can be committed to SCM by project developers.
# The RW directory will be automatically wiped by "make distclean".
SELFTEST_DIR_RO = src/selftest-ro
SELFTEST_DIR_RW = src/selftest-rw

$(abs_top_builddir)/$(SELFTEST_DIR_RW):
mkdir -p "$@"

$(abs_top_builddir)/$(SELFTEST_DIR_RO): $(abs_top_srcdir)/$(SELFTEST_DIR_RO)
@if test "$@" != "$<" ; then \
echo " COPYDIR $(SELFTEST_DIR_RO)"; \
rm -rf "$@"; \
cp -r "$<" "$@" ; \
fi

CLEANFILES += $(abs_top_builddir)/$(SELFTEST_DIR_RW)/*

# Note that this syntax dists the whole directory - including subdirs (if any)
EXTRA_DIST += $(SELFTEST_DIR_RO)

clean-local: clean-local-selftest-ro clean-local-selftest-rw
.PHONY: clean-local-selftest-ro
clean-local-selftest-ro:
@if test "$(abs_top_builddir)" != "$(abs_top_srcdir)" ; then \
if test -d "$(abs_top_builddir)/$(SELFTEST_DIR_RO)" ; then \
chmod -R u+w "$(abs_top_builddir)/$(SELFTEST_DIR_RO)" ; \
rm -rf "$(abs_top_builddir)/$(SELFTEST_DIR_RO)" ; \
fi; \
fi

# Unlike CLEANFILES setting above, this one whould also wipe created subdirs
.PHONY: clean-local-selftest-rw
clean-local-selftest-rw:
@if test "$(abs_top_builddir)" != "$(abs_top_srcdir)" ; then \
if test -d "$(abs_top_builddir)/$(SELFTEST_DIR_RW)" ; then \
chmod -R u+w "$(abs_top_builddir)/$(SELFTEST_DIR_RW)" ; \
rm -rf "$(abs_top_builddir)/$(SELFTEST_DIR_RW)" ; \
fi; \
fi

check-local: src/fty_metric_cache_selftest $(abs_top_builddir)/$(SELFTEST_DIR_RW) $(abs_top_builddir)/$(SELFTEST_DIR_RO)
$(LIBTOOL) --mode=execute $(builddir)/src/fty_metric_cache_selftest

check-verbose: src/fty_metric_cache_selftest
check-verbose: src/fty_metric_cache_selftest $(abs_top_builddir)/$(SELFTEST_DIR_RW) $(abs_top_builddir)/$(SELFTEST_DIR_RO)
$(LIBTOOL) --mode=execute $(builddir)/src/fty_metric_cache_selftest -v

# Run the selftest binary under valgrind to check for memory leaks
memcheck: src/fty_metric_cache_selftest
memcheck: src/fty_metric_cache_selftest $(abs_top_builddir)/$(SELFTEST_DIR_RW) $(abs_top_builddir)/$(SELFTEST_DIR_RO)
$(LIBTOOL) --mode=execute valgrind --tool=memcheck \
--leak-check=full --show-reachable=yes --error-exitcode=1 \
--suppressions=$(srcdir)/src/.valgrind.supp \
$(builddir)/src/fty_metric_cache_selftest

# Run the selftest binary under valgrind to check for performance leaks
callcheck: src/fty_metric_cache_selftest
callcheck: src/fty_metric_cache_selftest $(abs_top_builddir)/$(SELFTEST_DIR_RW) $(abs_top_builddir)/$(SELFTEST_DIR_RO)
$(LIBTOOL) --mode=execute valgrind --tool=callgrind \
$(builddir)/src/fty_metric_cache_selftest

# Run the selftest binary under gdb for debugging
debug: src/fty_metric_cache_selftest
debug: src/fty_metric_cache_selftest $(abs_top_builddir)/$(SELFTEST_DIR_RW) $(abs_top_builddir)/$(SELFTEST_DIR_RO)
$(LIBTOOL) --mode=execute gdb -q \
$(builddir)/src/fty_metric_cache_selftest

# Run the selftest binary with verbose switch for tracing
animate: src/fty_metric_cache_selftest
animate: src/fty_metric_cache_selftest $(abs_top_builddir)/$(SELFTEST_DIR_RW) $(abs_top_builddir)/$(SELFTEST_DIR_RO)
$(LIBTOOL) --mode=execute $(builddir)/src/fty_metric_cache_selftest -v

if WITH_GCOV
coverage: src/fty_metric_cache_selftest
@echo "called configure --with-gcov"
coverage: src/fty_metric_cache_selftest $(abs_top_builddir)/$(SELFTEST_DIR_RW) $(abs_top_builddir)/$(SELFTEST_DIR_RO)
@echo "you had called configure --with-gcov"
lcov --base-directory . --directory . --zerocounters -q
$(MAKE) check
lcov --base-directory . --directory . --capture -o coverage.info
Expand Down
Empty file added src/selftest-ro/.gitkeep
Empty file.

0 comments on commit b8f4712

Please sign in to comment.