[Title] update spec file for glib-networking_2.32.3
[external/glib-networking.git] / Makefile.decl
1 ### glib-networking declarations
2
3 NULL =
4
5 module_flags = -export_dynamic -avoid-version -module -no-undefined -export-symbols-regex '^g_io_module_(load|unload|query)'
6
7 giomoduledir = $(GIO_MODULE_DIR)
8
9 INCLUDES =                              \
10         -DG_LOG_DOMAIN=\"GLib-Net\"     \
11         -DG_DISABLE_DEPRECATED          \
12         $(GLIB_CFLAGS)                  \
13         $(NULL)
14
15
16 ### gtester stuff from glib
17
18 GTESTER = gtester                       # for non-GLIB packages
19 GTESTER_REPORT = gtester-report         # for the GLIB package
20
21 # initialize variables for unconditional += appending
22 EXTRA_DIST =
23 TEST_PROGS =
24
25 ### testing rules
26
27 # test: run all tests in cwd and subdirs
28 test: test-nonrecursive
29         @ for subdir in $(SUBDIRS) . ; do \
30             test "$$subdir" = "." -o "$$subdir" = "po" || \
31             ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
32           done
33
34 # test-nonrecursive: run tests only in cwd
35 test-nonrecursive: ${TEST_PROGS}
36         @test -z "${TEST_PROGS}" || ${TEST_ENVIRONMENT} ${GTESTER} --verbose ${TEST_PROGS}
37
38 # test-report: run tests in subdirs and generate report
39 # perf-report: run tests in subdirs with -m perf and generate report
40 # full-report: like test-report: with -m perf and -m slow
41 test-report perf-report full-report:    ${TEST_PROGS}
42         @test -z "${TEST_PROGS}" || { \
43           case $@ in \
44           test-report) test_options="-k";; \
45           perf-report) test_options="-k -m=perf";; \
46           full-report) test_options="-k -m=perf -m=slow";; \
47           esac ; \
48           if test -z "$$GTESTER_LOGDIR" ; then  \
49             ${GTESTER} --verbose $$test_options -o test-report.xml ${TEST_PROGS} ; \
50           elif test -n "${TEST_PROGS}" ; then \
51             ${GTESTER} --verbose $$test_options -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \
52           fi ; \
53         }
54         @ ignore_logdir=true ; \
55           if test -z "$$GTESTER_LOGDIR" ; then \
56             GTESTER_LOGDIR=`mktemp -d "\`pwd\`/.testlogs-XXXXXX"`; export GTESTER_LOGDIR ; \
57             ignore_logdir=false ; \
58           fi ; \
59           if test -d "$(top_srcdir)/.git" ; then \
60             REVISION=`git describe` ; \
61           else \
62             REVISION=$(VERSION) ; \
63           fi ; \
64           for subdir in $(SUBDIRS) . ; do \
65             test "$$subdir" = "." -o "$$subdir" = "po" || \
66             ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
67           done ; \
68           $$ignore_logdir || { \
69             echo '<?xml version="1.0"?>'              > $@.xml ; \
70             echo '<report-collection>'               >> $@.xml ; \
71             echo '<info>'                            >> $@.xml ; \
72             echo '  <package>$(PACKAGE)</package>'   >> $@.xml ; \
73             echo '  <version>$(VERSION)</version>'   >> $@.xml ; \
74             echo "  <revision>$$REVISION</revision>" >> $@.xml ; \
75             echo '</info>'                           >> $@.xml ; \
76             for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
77               sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
78             done ; \
79             echo >> $@.xml ; \
80             echo '</report-collection>' >> $@.xml ; \
81             rm -rf "$$GTESTER_LOGDIR"/ ; \
82             ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \
83           }
84 .PHONY: test test-report perf-report full-report test-nonrecursive
85
86 .PHONY: lcov genlcov lcov-clean
87 # use recursive makes in order to ignore errors during check
88 lcov:
89         find $(top_builddir) -name '*.gcda' -delete
90         -$(MAKE) $(AM_MAKEFLAGS) -k check
91         $(MAKE) $(AM_MAKEFLAGS) genlcov
92
93 genlcov:
94         $(LTP) --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool
95         LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --show-details glib-lcov.info
96
97 lcov-clean:
98         -$(LTP) --directory $(top_builddir) -z
99         -rm -rf glib-lcov.info glib-lcov
100         -find -name '*.gcda' -print | xargs rm
101
102 # run tests in cwd as part of make check
103 check-local: test-nonrecursive