scripts/mk: On dpkg-build-api >= 1 include buildtools.mk in default.mk
[dpkg.git] / scripts / Makefile.am
blob1132a1d88c3d6d3d1ea26fb73954ec6941d6e012
1 ## Process this file with automake to produce Makefile.in
3 SUBDIRS = mk po
5 sbin_SCRIPTS = \
6         dpkg-fsys-usrunmess \
7         # EOL
9 bin_SCRIPTS = \
10         dpkg-architecture \
11         dpkg-buildflags \
12         dpkg-buildapi \
13         dpkg-buildpackage \
14         dpkg-checkbuilddeps \
15         dpkg-distaddfile \
16         dpkg-genbuildinfo \
17         dpkg-genchanges \
18         dpkg-gencontrol \
19         dpkg-gensymbols \
20         dpkg-mergechangelogs \
21         dpkg-name \
22         dpkg-parsechangelog \
23         dpkg-scanpackages \
24         dpkg-scansources \
25         dpkg-shlibdeps \
26         dpkg-source \
27         dpkg-vendor \
28         # EOL
30 EXTRA_DIST = \
31         dpkg-architecture.pl \
32         dpkg-buildapi.pl \
33         dpkg-buildflags.pl \
34         dpkg-buildpackage.pl \
35         dpkg-checkbuilddeps.pl \
36         dpkg-distaddfile.pl \
37         dpkg-fsys-usrunmess.pl \
38         dpkg-genbuildinfo.pl \
39         dpkg-genchanges.pl \
40         dpkg-gencontrol.pl \
41         dpkg-gensymbols.pl \
42         dpkg-mergechangelogs.pl \
43         dpkg-name.pl \
44         dpkg-parsechangelog.pl \
45         dpkg-scanpackages.pl \
46         dpkg-scansources.pl \
47         dpkg-shlibdeps.pl \
48         dpkg-source.pl \
49         dpkg-vendor.pl \
50         $(test_scripts) \
51         $(test_data) \
52         # EOL
54 dist_zshcompletions_DATA = \
55         completion/zsh/_dpkg-parsechangelog \
56         # EOL
58 CLEANFILES = \
59         $(test_data_objects) \
60         $(sbin_SCRIPTS) \
61         $(bin_SCRIPTS) \
62         # EOL
64 perllibdir = $(PERL_LIBDIR)
65 nobase_dist_perllib_DATA = \
66         Dpkg/Arch.pm \
67         Dpkg/BuildAPI.pm \
68         Dpkg/BuildEnv.pm \
69         Dpkg/BuildFlags.pm \
70         Dpkg/BuildInfo.pm \
71         Dpkg/BuildOptions.pm \
72         Dpkg/BuildProfiles.pm \
73         Dpkg/BuildTypes.pm \
74         Dpkg/Build/Info.pm \
75         Dpkg/Changelog.pm \
76         Dpkg/Changelog/Debian.pm \
77         Dpkg/Changelog/Entry.pm \
78         Dpkg/Changelog/Entry/Debian.pm \
79         Dpkg/Changelog/Parse.pm \
80         Dpkg/Checksums.pm \
81         Dpkg/Compression.pm \
82         Dpkg/Compression/FileHandle.pm \
83         Dpkg/Compression/Process.pm \
84         Dpkg/Conf.pm \
85         Dpkg/Control.pm \
86         Dpkg/Control/Changelog.pm \
87         Dpkg/Control/FieldsCore.pm \
88         Dpkg/Control/Fields.pm \
89         Dpkg/Control/Info.pm \
90         Dpkg/Control/HashCore.pm \
91         Dpkg/Control/HashCore/Tie.pm \
92         Dpkg/Control/Hash.pm \
93         Dpkg/Control/Tests.pm \
94         Dpkg/Control/Tests/Entry.pm \
95         Dpkg/Control/Types.pm \
96         Dpkg/Deps.pm \
97         Dpkg/Deps/AND.pm \
98         Dpkg/Deps/KnownFacts.pm \
99         Dpkg/Deps/Multiple.pm \
100         Dpkg/Deps/OR.pm \
101         Dpkg/Deps/Simple.pm \
102         Dpkg/Deps/Union.pm \
103         Dpkg/Dist/Files.pm \
104         Dpkg/ErrorHandling.pm \
105         Dpkg/Exit.pm \
106         Dpkg/File.pm \
107         Dpkg/Getopt.pm \
108         Dpkg/Gettext.pm \
109         Dpkg/Index.pm \
110         Dpkg/Interface/Storable.pm \
111         Dpkg/IPC.pm \
112         Dpkg/Lock.pm \
113         Dpkg/OpenPGP.pm \
114         Dpkg/OpenPGP/Backend.pm \
115         Dpkg/OpenPGP/Backend/GnuPG.pm \
116         Dpkg/OpenPGP/Backend/SOP.pm \
117         Dpkg/OpenPGP/Backend/Sequoia.pm \
118         Dpkg/OpenPGP/ErrorCodes.pm \
119         Dpkg/OpenPGP/KeyHandle.pm \
120         Dpkg/Package.pm \
121         Dpkg/Path.pm \
122         Dpkg/Shlibs.pm \
123         Dpkg/Shlibs/Objdump.pm \
124         Dpkg/Shlibs/Objdump/Object.pm \
125         Dpkg/Shlibs/Symbol.pm \
126         Dpkg/Shlibs/SymbolFile.pm \
127         Dpkg/Shlibs/Cppfilt.pm \
128         Dpkg/Source/Archive.pm \
129         Dpkg/Source/BinaryFiles.pm \
130         Dpkg/Source/Format.pm \
131         Dpkg/Source/Functions.pm \
132         Dpkg/Source/Package.pm \
133         Dpkg/Source/Package/V1.pm \
134         Dpkg/Source/Package/V2.pm \
135         Dpkg/Source/Package/V3/Bzr.pm \
136         Dpkg/Source/Package/V3/Custom.pm \
137         Dpkg/Source/Package/V3/Native.pm \
138         Dpkg/Source/Package/V3/Git.pm \
139         Dpkg/Source/Package/V3/Quilt.pm \
140         Dpkg/Source/Patch.pm \
141         Dpkg/Source/Quilt.pm \
142         Dpkg/Substvars.pm \
143         Dpkg/Vendor.pm \
144         Dpkg/Vendor/Debian.pm \
145         Dpkg/Vendor/Default.pm \
146         Dpkg/Vendor/Devuan.pm \
147         Dpkg/Vendor/Ubuntu.pm \
148         Dpkg/Version.pm \
149         Dpkg.pm \
150         # EOL
152 EXTRA_DIST += \
153         Test/Dpkg.pm \
154         # EOL
156 # Keep it even if empty to have man3dir correctly set
157 man3_MANS =
159 man_perl_section = 3perl
161 SUFFIXES =
163 include $(top_srcdir)/build-aux/subst.am
165 POD2MAN_OPTS = \
166         --utf8 \
167         --release=$(PACKAGE_VERSION) \
168         --date='$(PACKAGE_RELEASE_DATE)' \
169         # EOL
171 install-data-local:
172 if BUILD_POD_DOC
173 # Install manual pages for perl modules manually as make can't deal
174 # properly with filenames containing colons
175 # Remove empty manual pages (perl modules not documented)
176         $(MKDIR_P) $(DESTDIR)$(man3dir)
177         for module in $(nobase_dist_perllib_DATA); do \
178           name=`echo $$module | $(SED) -e 's|/|::|g' -e 's/\.pm$$//'`; \
179           $(POD2MAN) $(POD2MAN_OPTS) --center=libdpkg-perl \
180             --name="$$name" --section=$(man_perl_section) $(srcdir)/$$module \
181             >$(DESTDIR)$(man3dir)/$$name.$(man_perl_section); \
182           if ! [ -s "$(DESTDIR)$(man3dir)/$$name.$(man_perl_section)" ]; then \
183             echo "error: empty $(man3dir)/$$name.$(man_perl_section)" 2>&1; \
184             exit 1; \
185           fi; \
186         done
187 endif
189 # Ideally we'd use '$(SED) -i', but unfortunately that's not portable.
190 install-data-hook:
191         $(do_perl_subst) <$(DESTDIR)$(perllibdir)/Dpkg.pm \
192                          >$(DESTDIR)$(perllibdir)/Dpkg.pm.new
193         mv $(DESTDIR)$(perllibdir)/Dpkg.pm.new \
194            $(DESTDIR)$(perllibdir)/Dpkg.pm
196 uninstall-local:
197 if BUILD_POD_DOC
198         for module in $(nobase_dist_perllib_DATA); do \
199           rm -f $(DESTDIR)$(man3dir)/`echo $$module | $(SED) -e 's|/|::|g' -e 's/\.pm$$/.$(man_perl_section)/'`; \
200         done
201 endif
203 coverage: check
204         $(PERL_COVER) -silent \
205           -ignore_re '^t/.*\.t' \
206           -outputdir $(top_builddir)/doc/coverage/scripts
207         : # Cleanup coverage report index
208         $(PERL) -i -p -e "s:$(abs_top_builddir)::" \
209           $(top_builddir)/doc/coverage/scripts/coverage.html
211 coverage-clean:
212         rm -rf cover_db
214 TEST_ENV_VARS = \
215         DPKG_PROGTAR=$(TAR) \
216         DPKG_PROGPATCH=$(PATCH) \
217         DPKG_PROGMAKE=$(MAKE) \
218         DPKG_DATADIR=$(top_srcdir)/data \
219         DPKG_ORIGINS_DIR=$(srcdir)/t/origins \
220         # EOL
221 TEST_COVERAGE = $(PERL_COVERAGE)
223 test_tmpdir = t.tmp
225 test_scripts = \
226         t/Dpkg_Version.t \
227         t/Dpkg_Arch.t \
228         t/Dpkg_Package.t \
229         t/Dpkg_Shlibs_Cppfilt.t \
230         t/Dpkg_Shlibs.t \
231         t/Dpkg_BuildAPI.t \
232         t/Dpkg_BuildEnv.t \
233         t/Dpkg_BuildFlags.t \
234         t/Dpkg_BuildFlags_Ubuntu.t \
235         t/Dpkg_BuildInfo.t \
236         t/Dpkg_BuildOptions.t \
237         t/Dpkg_BuildProfiles.t \
238         t/Dpkg_BuildTypes.t \
239         t/Dpkg_Checksums.t \
240         t/Dpkg_ErrorHandling.t \
241         t/Dpkg_Exit.t \
242         t/Dpkg_File.t \
243         t/Dpkg_Lock.t \
244         t/Dpkg_Getopt.t \
245         t/Dpkg_Gettext.t \
246         t/Dpkg_Conf.t \
247         t/Dpkg_Deps.t \
248         t/Dpkg_Path.t \
249         t/Dpkg_Interface_Storable.t \
250         t/Dpkg_OpenPGP_KeyHandle.t \
251         t/Dpkg_OpenPGP.t \
252         t/Dpkg_Vendor.t \
253         t/Dpkg_Changelog.t \
254         t/Dpkg_Changelog_Ubuntu.t \
255         t/Dpkg_Control_Fields.t \
256         t/Dpkg_Control.t \
257         t/Dpkg_Control_Tests.t \
258         t/Dpkg_Index.t \
259         t/Dpkg_Substvars.t \
260         t/Dpkg_IPC.t \
261         t/Dpkg_Compression.t \
262         t/Dpkg_Source_Functions.t \
263         t/Dpkg_Source_Patch.t \
264         t/Dpkg_Source_Quilt.t \
265         t/Dpkg_Source_Format.t \
266         t/Dpkg_Source_Archive.t \
267         t/Dpkg_Source_Package.t \
268         t/Dpkg_Dist_Files.t \
269         t/dpkg_source.t \
270         t/dpkg_buildpackage.t \
271         t/dpkg_mergechangelogs.t \
272         t/mk.t \
273         # EOL
275 test_data = \
276         t/Dpkg_BuildAPI/ctrl-api-default \
277         t/Dpkg_BuildAPI/ctrl-api-desync \
278         t/Dpkg_BuildAPI/ctrl-api-explicit \
279         t/Dpkg_BuildAPI/ctrl-api-gt-max \
280         t/Dpkg_BuildAPI/ctrl-api-no-int \
281         t/Dpkg_BuildAPI/ctrl-api-no-ver \
282         t/Dpkg_BuildAPI/ctrl-api-rel-noeq \
283         t/Dpkg_Changelog/countme \
284         t/Dpkg_Changelog/date-format \
285         t/Dpkg_Changelog/fields \
286         t/Dpkg_Changelog/misplaced-tz \
287         t/Dpkg_Changelog/regressions \
288         t/Dpkg_Changelog/shadow \
289         t/Dpkg_Changelog/stop-modeline \
290         t/Dpkg_Changelog/unreleased \
291         t/Dpkg_Checksums/data-1 \
292         t/Dpkg_Checksums/data-2 \
293         t/Dpkg_Checksums/empty \
294         t/Dpkg_Conf/config-mixed \
295         t/Dpkg_Control/bogus-armor-double.dsc \
296         t/Dpkg_Control/bogus-armor-formfeed.dsc \
297         t/Dpkg_Control/bogus-armor-inline.dsc \
298         t/Dpkg_Control/bogus-armor-nested.dsc \
299         t/Dpkg_Control/bogus-armor-no-sig.dsc \
300         t/Dpkg_Control/bogus-armor-spaces.dsc \
301         t/Dpkg_Control/bogus-armor-trail.dsc \
302         t/Dpkg_Control/bogus-unsigned.dsc \
303         t/Dpkg_Control/control-1 \
304         t/Dpkg_Control_Tests/tests-missing-fields \
305         t/Dpkg_Control_Tests/tests-plain-text \
306         t/Dpkg_Control_Tests/tests-valid \
307         t/Dpkg_Dist_Files/files-byhand \
308         t/Dpkg_Dist_Files/files-fragment-a \
309         t/Dpkg_Dist_Files/files-fragment-b \
310         t/Dpkg_File/append-me \
311         t/Dpkg_File/dump-partial \
312         t/Dpkg_File/slurp-me \
313         t/Dpkg_OpenPGP/dpkg-test-pub.asc \
314         t/Dpkg_OpenPGP/dpkg-test-sec.asc \
315         t/Dpkg_OpenPGP/sign-file \
316         t/Dpkg_OpenPGP/sign-file-inline.asc \
317         t/Dpkg_OpenPGP/sign-file-inline.sig \
318         t/Dpkg_OpenPGP/sign-file.asc \
319         t/Dpkg_OpenPGP/sign-file.sig \
320         t/Dpkg_Shlibs/basictags.c \
321         t/Dpkg_Shlibs/basictags.symbols \
322         t/Dpkg_Shlibs/ld.so.conf \
323         t/Dpkg_Shlibs/ld.so.conf.d/inf_recurse.conf \
324         t/Dpkg_Shlibs/ld.so.conf.d/normal.conf \
325         t/Dpkg_Shlibs/ld.so.conf.d/recursive.conf \
326         t/Dpkg_Shlibs/ld.so.conf_2 \
327         t/Dpkg_Shlibs/objdump.basictags-amd64 \
328         t/Dpkg_Shlibs/objdump.basictags-i386 \
329         t/Dpkg_Shlibs/objdump.basictags-mips \
330         t/Dpkg_Shlibs/objdump.dbd-pg \
331         t/Dpkg_Shlibs/objdump.glib-ia64 \
332         t/Dpkg_Shlibs/objdump.internal \
333         t/Dpkg_Shlibs/objdump.libc6-2.3 \
334         t/Dpkg_Shlibs/objdump.libc6-2.6 \
335         t/Dpkg_Shlibs/objdump.ls \
336         t/Dpkg_Shlibs/objdump.patterns \
337         t/Dpkg_Shlibs/objdump.space \
338         t/Dpkg_Shlibs/objdump.spacesyms \
339         t/Dpkg_Shlibs/patterns.cpp \
340         t/Dpkg_Shlibs/patterns.map \
341         t/Dpkg_Shlibs/patterns.symbols \
342         t/Dpkg_Shlibs/spacesyms-c-gen.pl \
343         t/Dpkg_Shlibs/spacesyms-o-map.pl \
344         t/Dpkg_Shlibs/spacesyms.map \
345         t/Dpkg_Shlibs/symbols.fake-1 \
346         t/Dpkg_Shlibs/symbols.fake-2 \
347         t/Dpkg_Shlibs/symbols.fake-3 \
348         t/Dpkg_Shlibs/symbols.include-1 \
349         t/Dpkg_Shlibs/symbols.include-2 \
350         t/Dpkg_Shlibs/symbols.include-3 \
351         t/Dpkg_Shlibs/symbols.internal \
352         t/Dpkg_Shlibs/symbols.internal-allow \
353         t/Dpkg_Shlibs/symbols.internal-allow-groups \
354         t/Dpkg_Shlibs/symbols.internal-filter \
355         t/Dpkg_Source_Patch/c-style.patch \
356         t/Dpkg_Source_Patch/ghost-hunk.patch \
357         t/Dpkg_Source_Patch/indent-header.patch \
358         t/Dpkg_Source_Patch/index-+++.patch \
359         t/Dpkg_Source_Patch/index-alone.patch \
360         t/Dpkg_Source_Patch/index-inert.patch \
361         t/Dpkg_Source_Patch/partial.patch \
362         t/Dpkg_Source_Quilt/parse/debian/patches/series \
363         t/Dpkg_Source_Package/package_1.0.orig.tar \
364         t/Dpkg_Source_Package/package_1.0.orig.tar.asc \
365         t/Dpkg_Source_Package/package_1.0.orig.tar.sig \
366         t/Dpkg_Substvars/substvars1 \
367         t/Dpkg_Substvars/substvars2 \
368         t/dpkg_buildpackage/dpkgdb/status \
369         t/dpkg_buildpackage/hook \
370         t/dpkg_buildpackage/test-source_0.dsc \
371         t/dpkg_buildpackage/test-source_0_all.changes \
372         t/dpkg_buildpackage/test-source_0_all.hook \
373         t/dpkg_buildpackage/test-source_0_any.changes \
374         t/dpkg_buildpackage/test-source_0_any.hook \
375         t/dpkg_buildpackage/test-source_0_binary.changes \
376         t/dpkg_buildpackage/test-source_0_binary.hook \
377         t/dpkg_buildpackage/test-source_0_full.changes \
378         t/dpkg_buildpackage/test-source_0_full.hook \
379         t/dpkg_buildpackage/test-source_0_source.changes \
380         t/dpkg_buildpackage/test-source_0_source.hook \
381         t/dpkg_mergechangelogs/ch-a \
382         t/dpkg_mergechangelogs/ch-b \
383         t/dpkg_mergechangelogs/ch-badver-a \
384         t/dpkg_mergechangelogs/ch-badver-b \
385         t/dpkg_mergechangelogs/ch-badver-merged \
386         t/dpkg_mergechangelogs/ch-badver-old \
387         t/dpkg_mergechangelogs/ch-merged \
388         t/dpkg_mergechangelogs/ch-merged-basic \
389         t/dpkg_mergechangelogs/ch-merged-pr \
390         t/dpkg_mergechangelogs/ch-merged-pr-basic \
391         t/dpkg_mergechangelogs/ch-old \
392         t/dpkg_mergechangelogs/ch-unreleased-a \
393         t/dpkg_mergechangelogs/ch-unreleased-b \
394         t/dpkg_mergechangelogs/ch-unreleased-merged \
395         t/dpkg_mergechangelogs/ch-unreleased-merged-basic \
396         t/dpkg_mergechangelogs/ch-unreleased-old \
397         t/dpkg_source/testsuite_0.dsc \
398         t/dpkg_source/testsuite_1.dsc \
399         t/dpkg_source/testsuite_2.dsc \
400         t/dpkg_source/testsuite_3.dsc \
401         t/mk/architecture.mk \
402         t/mk/buildapi.mk \
403         t/mk/buildflags.mk \
404         t/mk/buildopts.mk \
405         t/mk/buildtools.mk \
406         t/mk/debian/changelog \
407         t/mk/debian/control \
408         t/mk/pkg-info.mk \
409         t/mk/vendor-v0.mk \
410         t/mk/vendor-v1.mk \
411         t/mk/vendor.mk \
412         t/mock-bin/dpkg \
413         t/mock-bin/gcc \
414         t/origins/debian \
415         t/origins/devuan \
416         t/origins/default \
417         t/origins/gnewsense \
418         t/origins/ubuntu \
419         # EOL
421 test_data_objects = \
422         t/Dpkg_Shlibs/libobjdump.basictags-amd64.so \
423         t/Dpkg_Shlibs/libobjdump.basictags-i386.so \
424         t/Dpkg_Shlibs/libobjdump.basictags-mips.so \
425         t/Dpkg_Shlibs/libobjdump.patterns.so \
426         t/Dpkg_Shlibs/libobjdump.spacesyms.so \
427         # EOL
429 $(srcdir)/t/Dpkg_Shlibs/libobjdump.basictags-amd64.so: $(srcdir)/t/Dpkg_Shlibs/basictags.c
430         $(CC) $(CFLAGS) -shared -fPIC -Wl,-soname -Wl,libbasictags.so.1 $< \
431           -DAMD64 -o $@
433 $(srcdir)/t/Dpkg_Shlibs/libobjdump.basictags-mips.so: $(srcdir)/t/Dpkg_Shlibs/basictags.c
434         $(CC) $(CFLAGS) -shared -fPIC -Wl,-soname -Wl,libbasictags.so.1 $< \
435           -DMIPS -o $@
437 $(srcdir)/t/Dpkg_Shlibs/libobjdump.basictags-i386.so: $(srcdir)/t/Dpkg_Shlibs/basictags.c
438         $(CC) $(CFLAGS) -shared -fPIC -Wl,-soname -Wl,libbasictags.so.1 $< \
439           -DI386 -o $@
441 $(srcdir)/t/Dpkg_Shlibs/libobjdump.patterns.so: $(srcdir)/t/Dpkg_Shlibs/patterns.cpp $(srcdir)/t/Dpkg_Shlibs/patterns.map
442         $(CXX) $(CXXFLAGS) -shared -fPIC -Wl,-soname -Wl,libpatterns.so.1 \
443           -Wl,--version-script=$(srcdir)/t/Dpkg_Shlibs/patterns.map $< -o $@
445 $(srcdir)/t/Dpkg_Shlibs/spacesyms.c: $(srcdir)/t/Dpkg_Shlibs/spacesyms-c-gen.pl
446         $(srcdir)/t/Dpkg_Shlibs/spacesyms-c-gen.pl > $@
448 $(srcdir)/t/Dpkg_Shlibs/spacesyms.o: $(srcdir)/t/Dpkg_Shlibs/spacesyms.c $(srcdir)/t/Dpkg_Shlibs/spacesyms-o-map.pl
449         $(CC) $(CFLAGS) -c -fPIC -o $@.tmp $<
450         $(srcdir)/t/Dpkg_Shlibs/spacesyms-o-map.pl $@.tmp $@
451         rm -f $@.tmp
453 $(srcdir)/t/Dpkg_Shlibs/libobjdump.spacesyms.so: $(srcdir)/t/Dpkg_Shlibs/spacesyms.o $(srcdir)/t/Dpkg_Shlibs/spacesyms.map
454         $(CC) -shared -Wl,-soname -Wl,libspacesyms.so.1 \
455           -Wl,--version-script=$(srcdir)/t/Dpkg_Shlibs/spacesyms.map $< -o $@
457 .PHONY: refresh-test-data
459 OBJDUMP = objdump -w -f -p -T -R
461 refresh-test-data: $(test_data_objects)
462         $(OBJDUMP) $(srcdir)/t/Dpkg_Shlibs/libobjdump.basictags-amd64.so \
463           >$(srcdir)/t/Dpkg_Shlibs/objdump.basictags-amd64
464         $(OBJDUMP) $(srcdir)/t/Dpkg_Shlibs/libobjdump.basictags-i386.so \
465           >$(srcdir)/t/Dpkg_Shlibs/objdump.basictags-i386
466         $(OBJDUMP) $(srcdir)/t/Dpkg_Shlibs/libobjdump.basictags-mips.so \
467           >$(srcdir)/t/Dpkg_Shlibs/objdump.basictags-mips
468         $(OBJDUMP) $(srcdir)/t/Dpkg_Shlibs/libobjdump.patterns.so \
469           >$(srcdir)/t/Dpkg_Shlibs/objdump.patterns
470         $(OBJDUMP) $(srcdir)/t/Dpkg_Shlibs/libobjdump.spacesyms.so \
471           >$(srcdir)/t/Dpkg_Shlibs/objdump.spacesyms
472         $(OBJDUMP) `which ls` >$(srcdir)/t/Dpkg_Shlibs/objdump.ls
474 include $(top_srcdir)/build-aux/tap.am
476 check-local: tap-check
478 clean-local: tap-clean coverage-clean
479         rm -fr man