Commit 8bc107c8 authored by Pekka Pessi's avatar Pekka Pessi

Makefile.am's: added rules subdir, valcheck.am, recursive.am and valcheck target.

darcs-hash:20070201103848-65a35-afc8fa24fcb461df523edf9ccc7d22f11b981903.gz
parent efcc496b
...@@ -27,6 +27,10 @@ ACLOCAL_AMFLAGS = -I m4 ...@@ -27,6 +27,10 @@ ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST += m4/sac-general.m4 m4/sac-su.m4 \ EXTRA_DIST += m4/sac-general.m4 m4/sac-su.m4 \
m4/sac-su2.m4 m4/sac-tport.m4 m4/sac-openssl.m4 m4/sac-su2.m4 m4/sac-tport.m4 m4/sac-openssl.m4
EXTRA_DIST += docs/build_system.txt \
docs/devel_platform_notes.txt \
docs/release_management.txt
dist_man_MANS = man/man1/sip-date.1 man/man1/sip-options.1 \ dist_man_MANS = man/man1/sip-date.1 man/man1/sip-options.1 \
man/man1/localinfo.1 man/man1/addrinfo.1 \ man/man1/localinfo.1 man/man1/addrinfo.1 \
man/man1/stunc.1 man/man1/sip-dig.1 man/man1/stunc.1 man/man1/sip-dig.1
...@@ -44,7 +48,7 @@ endif ...@@ -44,7 +48,7 @@ endif
CLEANFILES = $(dist_man_MANS) CLEANFILES = $(dist_man_MANS)
coverage built-sources clean-built-sources doxygen: coverage built-sources clean-built-sources valcheck doxygen:
for i in libsofia-sip-ua $(GLIB_SUBDIRS) ; do $(MAKE) $(AM_MAKEFLAGS) -C $$i $@ ; done for i in libsofia-sip-ua $(GLIB_SUBDIRS) ; do $(MAKE) $(AM_MAKEFLAGS) -C $$i $@ ; done
.PHONY: coverage built-sources clean-built-sources doxygen manpages .PHONY: coverage built-sources clean-built-sources doxygen manpages
...@@ -38,6 +38,11 @@ Makefile target notes ...@@ -38,6 +38,11 @@ Makefile target notes
separately in ``DIST_SOURCES`` variable (otherwise ``make dist`` separately in ``DIST_SOURCES`` variable (otherwise ``make dist``
will fail) will fail)
Makefile fragments
------------------
Some common makefile rules are in 'rules' subdirectory.
Maintainer mode Maintainer mode
--------------- ---------------
...@@ -54,13 +59,16 @@ option '--enable-maintainer-mode'. ...@@ -54,13 +59,16 @@ option '--enable-maintainer-mode'.
Running tests Running tests
============= =============
Sofia-SIP has quite complete suite of test cases. It is prudent to Sofia-SIP has quite complete suite of test cases. It is prudent to run
run them while making changes and before committing them to revision them while making changes and before committing them to revision control
control system. However, running certain tests takes quite a long system. However, running certain tests takes quite a long time to
time. Therefore, they are run only if the environment variable execture. Therefore, they are run only if the environment variable
EXPENSIVE_CHECKS has been set. EXPENSIVE_CHECKS is also set by the build EXPENSIVE_CHECKS has been set. EXPENSIVE_CHECKS is also set by the build
system if configure option '--enable-expensive-checks' has been used. system if configure option '--enable-expensive-checks' has been used.
On hosts with i386 architecture, it is possible to run tests under
valgrind. Use the make target 'valcheck' for that purpose.
Code-tree layout Code-tree layout
================ ================
......
...@@ -31,16 +31,6 @@ EXTRA_DIST = docs/Doxyfile.aliases \ ...@@ -31,16 +31,6 @@ EXTRA_DIST = docs/Doxyfile.aliases \
docs/Doxyfile.conf \ docs/Doxyfile.conf \
docs/Doxyfile.version docs/Doxyfile.version
built-sources: built-sources-recursive
clean-built-sources: clean-built-sources-recursive
built-sources-recursive clean-built-sources-recursive:
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $@ in $$subdir"; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target) \
done;
doxygen: built-sources doxygen: built-sources
@cd ${srcdir} ;\ @cd ${srcdir} ;\
mkdir -p docs docs/html &&\ mkdir -p docs docs/html &&\
...@@ -53,4 +43,6 @@ doxygen: built-sources ...@@ -53,4 +43,6 @@ doxygen: built-sources
done done
cd ${srcdir}/docs/html && ../../${top_srcdir}/libsofia-sip-ua/docs/hide_emails.sh cd ${srcdir}/docs/html && ../../${top_srcdir}/libsofia-sip-ua/docs/hide_emails.sh
include $(top_srcdir)/rules/recursive.am
.PHONY: built-sources built-sources-am doxygen .PHONY: built-sources built-sources-am doxygen
...@@ -58,4 +58,4 @@ AUTOMAKE_OPTIONS = foreign ...@@ -58,4 +58,4 @@ AUTOMAKE_OPTIONS = foreign
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../../libsofia-sip-ua/sofia.am include $(top_srcdir)/rules/sofia.am
...@@ -38,26 +38,13 @@ libsofia_sip_ua_la_LIBADD = bnf/libbnf.la \ ...@@ -38,26 +38,13 @@ libsofia_sip_ua_la_LIBADD = bnf/libbnf.la \
stun/libstun.la \ stun/libstun.la \
tport/libtport.la \ tport/libtport.la \
url/liburl.la url/liburl.la
# set the libtool version info version:revision:age for libsofia-sip-ua # set the libtool version info version:revision:age for libsofia-sip-ua
# - soname to 'libsofia-sip-ua.so.(CUR-AGE)' # - soname to 'libsofia-sip-ua.so.(CUR-AGE)'
libsofia_sip_ua_la_LDFLAGS = \ libsofia_sip_ua_la_LDFLAGS = \
-version-info $(LIBVER_SOFIA_SIP_UA_CUR):$(LIBVER_SOFIA_SIP_UA_REV):$(LIBVER_SOFIA_SIP_UA_AGE) -version-info $(LIBVER_SOFIA_SIP_UA_CUR):$(LIBVER_SOFIA_SIP_UA_REV):$(LIBVER_SOFIA_SIP_UA_AGE)
if ENABLE_COVERAGE include $(top_srcdir)/rules/recursive.am
COVERAGE_RECURSIVE = coverage-recursive
coverage: $(COVERAGE_RECURSIVE)
endif
all-recursive: built-sources-recursive
built-sources: built-sources-recursive
clean-built-sources: clean-built-sources-recursive
built-sources-recursive clean-built-sources-recursive $(COVERAGE_RECURSIVE):
target=`echo $@ | sed s/-recursive//`; \
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
echo "Making $@ in $$subdir"; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target) \
done;
doxygen: built-sources doxygen: built-sources
@echo Generating empty doxytags @echo Generating empty doxytags
......
...@@ -43,4 +43,5 @@ TESTS = torture_bnf ...@@ -43,4 +43,5 @@ TESTS = torture_bnf
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
...@@ -47,4 +47,4 @@ CLEANFILES = Doxyfile.rfc ...@@ -47,4 +47,4 @@ CLEANFILES = Doxyfile.rfc
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
\ No newline at end of file
...@@ -31,4 +31,5 @@ EXTRA_DIST = Doxyfile features.docs ...@@ -31,4 +31,5 @@ EXTRA_DIST = Doxyfile features.docs
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
...@@ -64,7 +64,7 @@ EXTRA_DIST = Doxyfile http.docs \ ...@@ -64,7 +64,7 @@ EXTRA_DIST = Doxyfile http.docs \
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
TAG_DLL_FLAGS = DLLREF=1 TAG_DLL_FLAGS = DLLREF=1
......
...@@ -51,4 +51,5 @@ EXTRA_DIST += Doxyfile ipt.docs ...@@ -51,4 +51,5 @@ EXTRA_DIST += Doxyfile ipt.docs
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
...@@ -77,4 +77,5 @@ EXTRA_DIST = Doxyfile iptsec.docs testpasswd \ ...@@ -77,4 +77,5 @@ EXTRA_DIST = Doxyfile iptsec.docs testpasswd \
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
...@@ -77,7 +77,7 @@ TESTS = test_msg ...@@ -77,7 +77,7 @@ TESTS = test_msg
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
MSG_PARSER_AWK = $(srcdir)/msg_parser.awk MSG_PARSER_AWK = $(srcdir)/msg_parser.awk
......
...@@ -59,4 +59,5 @@ EXTRA_DIST = Doxyfile nea.docs $(BUILT_SOURCES) ...@@ -59,4 +59,5 @@ EXTRA_DIST = Doxyfile nea.docs $(BUILT_SOURCES)
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
...@@ -73,7 +73,7 @@ EXTRA_DIST = Doxyfile nta.docs sl_utils.docs \ ...@@ -73,7 +73,7 @@ EXTRA_DIST = Doxyfile nta.docs sl_utils.docs \
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
# Generate list of nta tags # Generate list of nta tags
TAG_DLL_FLAGS = LIST=nta_tag_list TAG_DLL_FLAGS = LIST=nta_tag_list
\ No newline at end of file
...@@ -63,4 +63,4 @@ EXTRA_DIST = Doxyfile nth.docs $(BUILT_SOURCES) \ ...@@ -63,4 +63,4 @@ EXTRA_DIST = Doxyfile nth.docs $(BUILT_SOURCES) \
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
...@@ -96,6 +96,6 @@ EXTRA_DIST = Doxyfile nua.docs $(BUILT_SOURCES) ...@@ -96,6 +96,6 @@ EXTRA_DIST = Doxyfile nua.docs $(BUILT_SOURCES)
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
TAG_DLL_FLAGS = LIST=nua_tag_list TAG_DLL_FLAGS = LIST=nua_tag_list
...@@ -58,4 +58,5 @@ EXTRA_DIST = Doxyfile sdp.docs $(BUILT_SOURCES) \ ...@@ -58,4 +58,5 @@ EXTRA_DIST = Doxyfile sdp.docs $(BUILT_SOURCES) \
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
...@@ -100,7 +100,7 @@ dist_noinst_SCRIPTS = run_test_sip_msg run_test_date ...@@ -100,7 +100,7 @@ dist_noinst_SCRIPTS = run_test_sip_msg run_test_date
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
MSG_PARSER_AWK = $(srcdir)/../msg/msg_parser.awk MSG_PARSER_AWK = $(srcdir)/../msg/msg_parser.awk
......
...@@ -58,6 +58,6 @@ EXTRA_DIST = Doxyfile soa.docs $(BUILT_SOURCES) ...@@ -58,6 +58,6 @@ EXTRA_DIST = Doxyfile soa.docs $(BUILT_SOURCES)
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
TAG_DLL_FLAGS = LIST=soa_tag_list TAG_DLL_FLAGS = LIST=soa_tag_list
\ No newline at end of file
...@@ -61,4 +61,5 @@ dist_noinst_DATA = run_test_sresolv \ ...@@ -61,4 +61,5 @@ dist_noinst_DATA = run_test_sresolv \
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
...@@ -58,6 +58,6 @@ EXTRA_DIST = Doxyfile stun.docs cert.pem key.pem ...@@ -58,6 +58,6 @@ EXTRA_DIST = Doxyfile stun.docs cert.pem key.pem
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
TAG_DLL_FLAGS = LIST=stun_tag_list TAG_DLL_FLAGS = LIST=stun_tag_list
...@@ -119,4 +119,4 @@ AUTOMAKE_OPTIONS = foreign ...@@ -119,4 +119,4 @@ AUTOMAKE_OPTIONS = foreign
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
...@@ -78,4 +78,5 @@ EXTRA_DIST = Doxyfile tport.docs \ ...@@ -78,4 +78,5 @@ EXTRA_DIST = Doxyfile tport.docs \
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
...@@ -52,6 +52,6 @@ TESTS = torture_url test_urlmap ...@@ -52,6 +52,6 @@ TESTS = torture_url test_urlmap
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Sofia specific rules # Sofia specific rules
include ../sofia.am include $(top_srcdir)/rules/sofia.am
TAG_DLL_FLAGS = DLLREF=1 TAG_DLL_FLAGS = DLLREF=1
# Recursive Makefile targets
# --------------------------
if ENABLE_COVERAGE
COVERAGE_RECURSIVE = coverage-recursive
coverage: $(COVERAGE_RECURSIVE)
endif
all-recursive: built-sources-recursive
built-sources: built-sources-recursive
clean-built-sources: clean-built-sources-recursive
valcheck: valcheck-recursive
SOFIA_RECURSIVE = \
valcheck-recursive \
$(COVERAGE_RECURSIVE)
SOFIA_DIST_RECURSIVE = \
built-sources-recursive \
clean-built-sources-recursive
$(SOFIA_RECURSIVE):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target) \
|| eval $$failcom; \
done; \
test -z "$$fail"
$(SOFIA_DIST_RECURSIVE):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
target=`echo $@ | sed s/-recursive//`; \
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target) \
|| eval $$failcom; \
done; \
test -z "$$fail"
# common Makefile targets for libsofia-sip-ua modules # common Makefile targets for libsofia-sip-ua(-glib) modules
# --------------------------------------------------- # ----------------------------------------------------------
AM_CFLAGS = $(CWFLAG) $(SOFIA_CFLAGS) $(SOFIA_COVERAGE) AM_CFLAGS = $(CWFLAG) $(SOFIA_COVERAGE)
# Use with --enable-ndebug # Use with --enable-ndebug
if NDEBUG if NDEBUG
...@@ -56,3 +56,5 @@ INTERNAL_INCLUDES = \ ...@@ -56,3 +56,5 @@ INTERNAL_INCLUDES = \
-I$(srcdir)/../stun -I../stun \ -I$(srcdir)/../stun -I../stun \
-I$(srcdir)/../url -I../url \ -I$(srcdir)/../url -I../url \
-I$(srcdir)/../su -I../su -I$(srcdir)/../su -I../su
include $(top_srcdir)/rules/valcheck.am
\ No newline at end of file
#
# run tests with valgrind
#
# Copyright (C) 2007 Nokia Corporation.
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
# This file contains free software from Makefile.in by the Free Software
# Foundation:
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
VALGRIND = valgrind
VALGRINDFLAGS = --tool=memcheck
valcheck: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) valcheck-am
valcheck-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) valcheck-TESTS
# Run tests with valgrind in
valcheck-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
list='$(TESTS)'; \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
set -x; \
if case $$tst in \
run*) VALGRIND="$(VALGRIND) $(VALGRINDFLAGS)" \
$(TESTS_ENVIRONMENT) $${dir}$$tst ;; \
*) $(TESTS_ENVIRONMENT) $(VALGRIND) $(VALGRINDFLAGS) \
$${dir}$$tst ;; \
esac ; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
echo "XPASS: $$tst"; \
;; \
*) \
echo "PASS: $$tst"; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xfail=`expr $$xfail + 1`; \
echo "XFAIL: $$tst"; \
;; \
*) \
failed=`expr $$failed + 1`; \
echo "FAIL: $$tst"; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
echo "SKIP: $$tst"; \
fi; \
set +x; \
done; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="All $$all tests passed"; \
else \
banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all tests failed"; \
else \
banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
skipped="($$skip tests were not run)"; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
test -z "$$skipped" || echo "$$skipped"; \
test -z "$$report" || echo "$$report"; \
echo "$$dashes"; \
test "$$failed" -eq 0; \
else :; fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment