awful debugging hacking
[dpkg] / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 if BUILD_DSELECT
4 MAYBE_DSELECT = dselect
5 endif
6
7 SUBDIRS = \
8 lib \
9 dpkg-deb \
10 dpkg-split \
11 src \
12 utils \
13 $(MAYBE_DSELECT) \
14 scripts \
15 t-func \
16 po \
17 man
18
19 ACLOCAL_AMFLAGS = -I m4
20
21
22 dist_pkgdata_DATA = \
23 data/pie-compile.specs \
24 data/pie-link.specs \
25 data/no-pie-compile.specs \
26 data/no-pie-link.specs \
27 data/cputable \
28 data/ostable \
29 data/abitable \
30 data/tupletable \
31 $(nil)
32
33 EXTRA_DIST = \
34 .mailmap \
35 ChangeLog.old \
36 README.l10n \
37 get-version \
38 run-script \
39 doc/README.api \
40 doc/README.feature-removal-schedule \
41 doc/coding-style.txt \
42 doc/frontend.txt \
43 doc/lcov-inject.pl \
44 doc/triggers.txt \
45 debian/changelog \
46 debian/compat \
47 debian/control \
48 debian/copyright \
49 debian/dpkg-dev.docs \
50 debian/dpkg-dev.install \
51 debian/dpkg-dev.manpages \
52 debian/dpkg-dev.preinst \
53 debian/dpkg-dev.lintian-overrides \
54 debian/dpkg.cfg \
55 debian/dpkg.cron.daily \
56 debian/dpkg.docs \
57 debian/dpkg.install \
58 debian/dpkg.manpages \
59 debian/dpkg.postinst \
60 debian/dpkg.postrm \
61 debian/dpkg.prerm \
62 debian/dpkg.logrotate \
63 debian/dpkg.lintian-overrides \
64 debian/dselect.cfg \
65 debian/dselect.docs \
66 debian/dselect.install \
67 debian/dselect.manpages \
68 debian/dselect.preinst \
69 debian/dselect.lintian-overrides \
70 debian/libdpkg-dev.docs \
71 debian/libdpkg-dev.install \
72 debian/libdpkg-dev.lintian-overrides \
73 debian/libdpkg-perl.docs \
74 debian/libdpkg-perl.install \
75 debian/libdpkg-perl.lintian-overrides \
76 debian/source/lintian-overrides \
77 debian/source/format \
78 debian/source/options \
79 debian/usertags \
80 debian/rules \
81 debian/shlibs.default \
82 debian/shlibs.override \
83 $(test_scripts) \
84 $(test_data) \
85 $(nil)
86
87 .PHONY: doc
88
89 doc: doc/Doxyfile
90 $(DOXYGEN) doc/Doxyfile
91
92 doc-clean:
93 rm -rf doc/html/
94
95 # Code coverage support
96
97 .PHONY: coverage coverage-clean
98
99 if COVERAGE_ENABLED
100 LCOV_OPTS = -q --rc geninfo_checksum=1 --rc lcov_branch_coverage=1
101 LCOV_CAPTURE_OPTS = $(LCOV_OPTS) --no-recursion \
102 -d $(top_builddir)/lib/dpkg \
103 -d $(top_builddir)/src \
104 -d $(top_builddir)/utils
105 LCOV_INJECT = $(PERL) -i $(top_srcdir)/doc/lcov-inject.pl
106
107 coverage: all
108 : # Remove coverage data from any previous run
109 rm -f *.lcov
110 find -name '*.gcda' -o -name '*.gcov' | xargs rm -f
111
112 : # Initialize data
113 $(LCOV) $(LCOV_CAPTURE_OPTS) -c -o dpkg_base.lcov -i
114 : # Run test cases
115 $(MAKE) -C lib/dpkg check
116 $(MAKE) -C src check
117 $(MAKE) -C utils check
118 : # Merge test coverage data
119 $(LCOV) $(LCOV_CAPTURE_OPTS) -c -o dpkg_test.lcov
120 $(LCOV) $(LCOV_OPTS) -a dpkg_base.lcov -a dpkg_test.lcov \
121 -o dpkg_merge.lcov
122 $(LCOV) $(LCOV_OPTS) -r dpkg_merge.lcov '/usr/include/*' -o dpkg.lcov
123 : # Generate reports
124 $(LCOV) $(LCOV_OPTS) -l dpkg.lcov
125 $(LCOV_GENHTML) $(LCOV_OPTS) \
126 --legend --title "dpkg $(VERSION) C code coverage" \
127 -o doc/coverage dpkg.lcov
128
129 $(MAKE) -C scripts $@
130
131 : # XXX: Inject perl coverage into lcov index files. This is a fragile
132 : # hack which might break depending on the html output generated.
133 $(LCOV_INJECT) doc/coverage/index-sort-b.html
134 $(LCOV_INJECT) doc/coverage/index-sort-f.html
135 $(LCOV_INJECT) doc/coverage/index-sort-l.html
136 $(LCOV_INJECT) doc/coverage/index.html
137
138 coverage-clean:
139 rm -rf doc/coverage/
140 find -name '*.gcno' -o -name '*.gcda' -o \
141 -name '*.gcov' -o -name '*.lcov' | xargs rm -f
142 $(MAKE) -C scripts $@
143 else
144 coverage:
145 @echo "Need to reconfigure with --enable-coverage"
146
147 coverage-clean:
148 endif
149
150 test_scripts = \
151 t/pod.t \
152 t/pod-spell.t \
153 t/pod-coverage.t \
154 t/synopsis.t \
155 t/minimum-version.t \
156 t/syntax.t \
157 t/strict.t \
158 t/critic.t \
159 $(nil)
160
161 test_data = \
162 t/critic/perlcriticrc \
163 $(nil)
164
165 # We need to use absolute paths here due to strict.t invoking a sub-perl,
166 # while changing dir to source dir on out-of-tree builds.
167 TEST_ENV_VARS = \
168 DPKG_DATADIR=$(abs_top_srcdir)/data \
169 $(nil)
170
171 include $(top_srcdir)/check.am
172
173 .PHONY: update-po
174
175 update-po:
176 $(MAKE) -C po update-po
177 $(MAKE) -C scripts/po update-po
178 $(MAKE) -C dselect/po update-po
179 $(MAKE) -C man update-po
180
181 # If we create the dist tarball from the git repository, make sure
182 # that we're not forgetting some files...
183 dist-hook:
184 echo $(VERSION) >$(distdir)/.dist-version
185 if [ -e .git ]; then \
186 for file in `git ls-files | grep -v .gitignore`; do \
187 if [ ! -e "$(distdir)/$$file" ]; then \
188 echo "$$file is missing in $(distdir)" >&2 ; \
189 exit 1 ; \
190 fi ; \
191 done ; \
192 XDG_CONFIG_HOME= HOME= \
193 git log -C --stat 1.15.0.. >$(distdir)/ChangeLog; \
194 fi
195
196 clean-local: doc-clean coverage-clean check-clean