Dpkg::OpenPGP::Backend::GnuPG: Fallback to use «gpg dearmor» if present
[dpkg.git] / Makefile.am
blob10f26eeb1d9b53155401786ce98ebaed4ed1289e
1 ## Process this file with automake to produce Makefile.in
3 if BUILD_DSELECT
4   MAYBE_DSELECT = dselect
5 endif
7 SUBDIRS = \
8         lib \
9         src \
10         utils \
11         $(MAYBE_DSELECT) \
12         scripts \
13         po \
14         man \
15         # EOL
17 ACLOCAL_AMFLAGS = -I m4
19 aclocaldir = $(datadir)/aclocal
21 dist_aclocal_DATA = \
22         m4/dpkg-arch.m4 \
23         m4/dpkg-build.m4 \
24         m4/dpkg-compiler.m4 \
25         m4/dpkg-coverage.m4 \
26         m4/dpkg-funcs.m4 \
27         m4/dpkg-libs.m4 \
28         m4/dpkg-linker.m4 \
29         m4/dpkg-progs.m4 \
30         m4/dpkg-types.m4 \
31         m4/dpkg-unicode.m4 \
32         # EOL
34 dist_pkgdata_DATA = \
35         data/pie-compile.specs \
36         data/pie-link.specs \
37         data/no-pie-compile.specs \
38         data/no-pie-link.specs \
39         data/cputable \
40         data/ostable \
41         data/abitable \
42         data/tupletable \
43         # EOL
45 dist_doc_DATA = \
46         doc/README.api \
47         doc/README.feature-removal-schedule \
48         # EOL
50 docspecdir = $(docdir)/spec
52 dist_docspec_DATA = \
53         doc/spec/frontend-api.txt \
54         doc/spec/protected-field.txt \
55         doc/spec/rootless-builds.txt \
56         doc/spec/triggers.txt \
57         # EOL
59 EXTRA_DIST = \
60         .gitlab-ci.yml \
61         .mailmap \
62         ChangeLog.old \
63         README.l10n \
64         autogen \
65         build-aux/gen-changelog \
66         build-aux/get-version \
67         build-aux/lcov-inject \
68         build-aux/run-script \
69         build-aux/test-runner \
70         doc/coding-style.txt \
71         debian/README.bug-usertags \
72         debian/bug-script \
73         debian/changelog \
74         debian/control \
75         debian/copyright \
76         debian/dpkg-dev.docs \
77         debian/dpkg-dev.install \
78         debian/dpkg-dev.manpages \
79         debian/dpkg.alternatives.logrotate \
80         debian/dpkg.cfg \
81         debian/dpkg.cron.daily \
82         debian/dpkg.docs \
83         debian/dpkg.dpkg-db-backup.service \
84         debian/dpkg.dpkg-db-backup.timer \
85         debian/dpkg.install \
86         debian/dpkg.manpages \
87         debian/dpkg.postinst \
88         debian/dpkg.postrm \
89         debian/dpkg.logrotate \
90         debian/dpkg.lintian-overrides \
91         debian/dpkg.lintian-profile \
92         debian/dselect.cfg \
93         debian/dselect.docs \
94         debian/dselect.install \
95         debian/dselect.lintian-overrides \
96         debian/dselect.manpages \
97         debian/dselect.postrm \
98         debian/dselect.preinst \
99         debian/dselect.prerm \
100         debian/libdpkg-dev.install \
101         debian/libdpkg-perl.install \
102         debian/source/format \
103         debian/source/lintian-overrides \
104         debian/not-installed \
105         debian/rules \
106         debian/shlibs.default \
107         debian/shlibs.override \
108         debian/tests/control \
109         debian/tests/test-func \
110         debian/tests/test-func-root \
111         debian/tests/test-not-root \
112         debian/tests/test-root \
113         po/its/polkit.its \
114         po/its/polkit.loc \
115         tests \
116         $(test_scripts) \
117         $(test_data) \
118         # EOL
120 .PHONY: doc
122 doc: doc/Doxyfile
123         $(DOXYGEN) doc/Doxyfile
125 doc-clean:
126         rm -rf doc/html/
128 # Code coverage support
130 .PHONY: coverage coverage-clean
132 if COVERAGE_ENABLED
133 LCOV_OPTS = --quiet --rc geninfo_checksum=1 --rc lcov_branch_coverage=1
134 LCOV_CAPTURE_OPTS = $(LCOV_OPTS) --no-recursion \
135         --directory $(top_builddir)/lib/dpkg \
136         --directory $(top_builddir)/src/common \
137         --directory $(top_builddir)/src/deb \
138         --directory $(top_builddir)/src/split \
139         --directory $(top_builddir)/src/divert \
140         --directory $(top_builddir)/src/query \
141         --directory $(top_builddir)/src/trigger \
142         --directory $(top_builddir)/src/statoverride \
143         --directory $(top_builddir)/src/main \
144         --directory $(top_builddir)/utils \
145         # EOL
146 LCOV_INJECT = $(PERL) -i $(top_srcdir)/build-aux/lcov-inject
148 coverage: all
149         : # Remove coverage data from any previous run
150         rm -f *.lcov
151         find -name '*.gcda' -o -name '*.gcov' | xargs rm -f
153         : # Initialize data
154         $(LCOV) $(LCOV_CAPTURE_OPTS) --capture --initial \
155           --output-file dpkg_base.lcov
156         : # Run test cases
157         $(MAKE) -C lib/dpkg check
158         $(MAKE) -C src check
159         $(MAKE) -C utils check
160         : # Merge test coverage data
161         $(LCOV) $(LCOV_CAPTURE_OPTS) --capture \
162           --output-file dpkg_test.lcov
163         $(LCOV) $(LCOV_OPTS) \
164           --add-tracefile dpkg_base.lcov \
165           --add-tracefile dpkg_test.lcov \
166           --output-file dpkg_merge.lcov
167         $(LCOV) $(LCOV_OPTS) --remove dpkg_merge.lcov '/usr/include/*' \
168           --output-file dpkg.lcov
169         : # Generate reports
170         $(LCOV) $(LCOV_OPTS) --list dpkg.lcov
171         $(LCOV_GENHTML) $(LCOV_OPTS) \
172           --legend --title "dpkg $(VERSION) C code coverage" \
173           --output-directory doc/coverage dpkg.lcov
175         $(MAKE) -C scripts $@
177         : # XXX: Inject perl coverage into lcov index files. This is a fragile
178         : # hack which might break depending on the html output generated.
179         $(LCOV_INJECT) doc/coverage/index-sort-b.html
180         $(LCOV_INJECT) doc/coverage/index-sort-f.html
181         $(LCOV_INJECT) doc/coverage/index-sort-l.html
182         $(LCOV_INJECT) doc/coverage/index.html
184 coverage-clean:
185         rm -rf doc/coverage/
186         find -name '*.gcno' -o -name '*.gcda' -o \
187              -name '*.gcov' -o -name '*.lcov' | xargs rm -f
188         $(MAKE) -C scripts $@
189 else
190 coverage:
191         @echo "Need to reconfigure with --enable-coverage"
193 coverage-clean:
194 endif
196 test_scripts = \
197         t/po.t \
198         t/pod.t \
199         t/pod-spell.t \
200         t/pod-coverage.t \
201         t/synopsis.t \
202         t/minimum-version.t \
203         t/module-version.t \
204         t/syntax.t \
205         t/strict.t \
206         t/critic.t \
207         t/codespell.t \
208         t/shellcheck.t \
209         t/cppcheck.t \
210         # EOL
212 test_data = \
213         t/codespell/stopwords \
214         t/cppcheck/cppcheck.supp \
215         t/critic/perlcriticrc \
216         # EOL
218 # We need to use absolute paths here due to strict.t invoking a sub-perl,
219 # while changing dir to source dir on out-of-tree builds.
220 TEST_ENV_VARS = \
221         DPKG_DATADIR=$(abs_top_srcdir)/data \
222         # EOL
224 include $(top_srcdir)/build-aux/tap.am
226 check-local: tap-check
228 .PHONY: update-po
230 update-po:
231         $(MAKE) -C po update-po
232         $(MAKE) -C scripts/po update-po
233         $(MAKE) -C dselect/po update-po
234         $(MAKE) -C man update-po
236 include $(top_srcdir)/build-aux/cpan.am
238 # If we create the dist tarball from the git repository, make sure
239 # that we're not forgetting some files, and we are not storing any symlink
240 # in the repository (except for the origins/default one) as those degrade
241 # to regular files due to automake telling tar to dereference them.
242 dist-hook:
243         echo $(VERSION) >$(distdir)/.dist-version
244         if [ -e .git ]; then \
245           for file in `git ls-tree -r HEAD | grep ^12 | grep -v t/origins/default`; do \
246             echo "$$file is a symlink packed as a file on the dist tar" >&2 ; \
247             exit 1 ; \
248           done ; \
249           for file in `git ls-files | grep -v .gitignore`; do \
250             if [ ! -e "$(distdir)/$$file" ]; then \
251               echo "$$file is missing in $(distdir)" >&2 ; \
252               exit 1 ; \
253             fi ; \
254           done ; \
255           XDG_CONFIG_HOME= HOME= \
256           git log -C --stat 1.15.0.. >$(distdir)/ChangeLog; \
257         fi
259 clean-local: doc-clean coverage-clean tap-clean