]>
Commit | Line | Data |
---|---|---|
fb55280a KZ |
1 | AM_CPPFLAGS = \ |
2 | -include config.h \ | |
3 | -I$(top_srcdir)/include \ | |
07a16b9d | 4 | -DLOCALEDIR=\"$(localedir)\" \ |
c2409b55 KZ |
5 | -D_PATH_RUNSTATEDIR=\"${runstatedir}\" \ |
6 | -D_PATH_SYSCONFSTATICDIR=\"${sysconfstaticdir}\" | |
7 | ||
fee99106 KZ |
8 | if USE_VENDORDIR |
9 | AM_CPPFLAGS += \ | |
10 | -D_PATH_VENDORDIR=\"${vendordir}\" | |
11 | endif | |
12 | ||
75196cd8 EV |
13 | if FUZZING_ENGINE |
14 | if !OSS_FUZZ | |
15 | AM_CPPFLAGS += \ | |
16 | -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION | |
17 | endif | |
18 | endif | |
19 | ||
b0d00302 FS |
20 | if WITH_COVERAGE |
21 | AM_CPPFLAGS += \ | |
22 | -include $(top_srcdir)/include/coverage.h | |
23 | endif | |
24 | ||
fb55280a | 25 | AM_CFLAGS = -fsigned-char $(WARN_CFLAGS) |
75196cd8 | 26 | AM_CXXFLAGS = $(AM_CFLAGS) |
b4b8f8c2 | 27 | AM_LDFLAGS = $(ASAN_LDFLAGS) $(UBSAN_LDFLAGS) $(FUZZING_ENGINE_LDFLAGS) $(COVERAGE_LDFLAGS) |
fb55280a | 28 | |
7bce71a3 KZ |
29 | # Add gettext stuff to the global LDADD for systems with separate libintl |
30 | # library. The LTLIBINTL is generated by AM_GNU_GETTEXT macro. | |
31 | # | |
32 | LDADD = $(LTLIBINTL) | |
33 | ||
75196cd8 EV |
34 | LIB_FUZZING_ENGINE ?= -fsanitize=fuzzer |
35 | ||
1a4d989e | 36 | # Paths to in-tree libraries (use ul_ prefix to avoid possible collisions) Note |
0bb4c979 KZ |
37 | # that blkid.h, libmount.h, libfdisk.h and libsmartcols.h are generated and |
38 | # stored in build dirs. | |
fb55280a KZ |
39 | # |
40 | ul_libblkid_incdir = $(top_builddir)/libblkid/src | |
41 | ul_libmount_incdir = $(top_builddir)/libmount/src | |
1a4d989e | 42 | ul_libsmartcols_incdir = $(top_builddir)/libsmartcols/src |
0bb4c979 | 43 | ul_libfdisk_incdir = $(top_builddir)/libfdisk/src |
c2e299d0 | 44 | ul_liblastlog2_incdir = $(top_srcdir)/liblastlog2/src |
fb55280a | 45 | ul_libuuid_incdir = $(top_srcdir)/libuuid/src |
48d7b13a | 46 | |
9cc36e9f SK |
47 | bashcompletiondir = @bashcompletiondir@ |
48 | ||
8365ed42 | 49 | dist_noinst_HEADERS = |
d8d54e4b | 50 | dist_noinst_DATA = |
e0ef609e | 51 | noinst_PROGRAMS = |
c65953d7 | 52 | EXTRA_LTLIBRARIES = |
5ed5df5d | 53 | usrbin_exec_PROGRAMS = |
ffeb2805 | 54 | usrsbin_exec_PROGRAMS = |
3632ce21 KZ |
55 | man_MANS = |
56 | pkgconfig_DATA = | |
57 | usrlib_exec_LTLIBRARIES = | |
22d2322e KZ |
58 | bin_PROGRAMS = |
59 | sbin_PROGRAMS = | |
60 | dist_usrbin_exec_SCRIPTS = | |
37b88bfc | 61 | systemdsystemunit_DATA = |
c2e299d0 | 62 | tmpfiles_DATA = |
ac6a37c8 | 63 | dist_bashcompletion_DATA = |
922e6775 | 64 | check_PROGRAMS = |
15b2606c | 65 | dist_check_SCRIPTS = |
8365ed42 | 66 | |
905dde8f KZ |
67 | BUILT_SOURCES = |
68 | ||
d4baf92e | 69 | PATHFILES = |
d8d54e4b KZ |
70 | ADOCFILES_COMMON = |
71 | MANPAGES = | |
72 | MANLINKS = | |
d4baf92e | 73 | |
f77a4d10 KZ |
74 | INSTALL_EXEC_HOOKS = |
75 | UNINSTALL_HOOKS = | |
76 | INSTALL_DATA_HOOKS = | |
ac73480a | 77 | CLEAN_LOCALS = |
1b03e2cd | 78 | CHECK_LOCALS = |
f77a4d10 | 79 | |
4cf02b65 | 80 | EXTRA_DIST = |
3632ce21 KZ |
81 | CLEANFILES = |
82 | ||
fb55280a | 83 | SUBDIRS = po |
44e293d6 | 84 | |
8f5fff53 KZ |
85 | if ENABLE_ASCIIDOC |
86 | if ENABLE_POMAN | |
87 | SUBDIRS += po-man | |
88 | endif | |
89 | endif | |
90 | ||
8b416ca0 | 91 | RCS_FIND_IGNORE = \( -name SCCS -o -name BitKeeper -o -name .svn -o \ |
44e293d6 KZ |
92 | -name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o |
93 | ||
48d7b13a KZ |
94 | ACLOCAL_AMFLAGS = -I m4 |
95 | ||
3632ce21 | 96 | EXTRA_DIST += \ |
f06b4328 SK |
97 | .version \ |
98 | autogen.sh \ | |
99 | Documentation \ | |
100 | po/update-potfiles \ | |
702b6b5f | 101 | README.licensing |
8365ed42 | 102 | |
702b6b5f | 103 | include tools/Makemodule.am |
8365ed42 | 104 | include include/Makemodule.am |
e0ef609e | 105 | include lib/Makemodule.am |
3632ce21 | 106 | include libuuid/Makemodule.am |
c2e299d0 | 107 | include liblastlog2/Makemodule.am |
f77a4d10 | 108 | include libblkid/Makemodule.am |
bc94024d | 109 | include libmount/Makemodule.am |
1a4d989e | 110 | include libsmartcols/Makemodule.am |
baa3b270 | 111 | include libfdisk/Makemodule.am |
bc94024d KZ |
112 | |
113 | include schedutils/Makemodule.am | |
22d2322e KZ |
114 | include text-utils/Makemodule.am |
115 | include term-utils/Makemodule.am | |
ffeb2805 | 116 | include login-utils/Makemodule.am |
8772f8d7 | 117 | include sys-utils/Makemodule.am |
37b88bfc | 118 | include misc-utils/Makemodule.am |
54dbc8cf | 119 | include disk-utils/Makemodule.am |
8365ed42 | 120 | |
c2e299d0 | 121 | include pam_lastlog2/Makemodule.am |
20da5808 | 122 | include bash-completion/Makemodule.am |
19feed6d | 123 | include man-common/Makemodule.am |
9cc36e9f | 124 | |
ac73480a KZ |
125 | include tests/Makemodule.am |
126 | ||
36bbb18a KZ |
127 | # Meson files |
128 | EXTRA_DIST += \ | |
129 | meson.build \ | |
130 | meson_options.txt \ | |
131 | tools/meson-make-manpage-stub.sh \ | |
132 | tools/meson-make-symlink.sh \ | |
133 | \ | |
134 | include/meson.build \ | |
135 | libblkid/meson.build \ | |
136 | libmount/meson.build \ | |
137 | libmount/python/meson.build \ | |
138 | misc-utils/meson.build \ | |
139 | libsmartcols/meson.build \ | |
140 | text-utils/meson.build \ | |
141 | po/meson.build \ | |
142 | lib/meson.build \ | |
143 | libuuid/meson.build \ | |
c2e299d0 | 144 | liblastlog2/meson.build \ |
36bbb18a KZ |
145 | sys-utils/meson.build \ |
146 | libfdisk/meson.build \ | |
147 | term-utils/meson.build \ | |
148 | disk-utils/meson.build \ | |
149 | login-utils/meson.build | |
150 | ||
324330ac FB |
151 | # pylibmountexec module must be installed after usrlib_exec libraries, |
152 | # otherwise the libtool relink step will fail to find libmount.la and | |
153 | # will try -lmount which is possibly not available. | |
154 | # | |
155 | # So introduce this dependency rule: | |
156 | # install-pylibmountexecLTLIBRARIES: install-usrlib_execLTLIBRARIES | |
157 | @verbatim_pylibmount_dependency@ | |
158 | ||
d4baf92e KZ |
159 | # |
160 | # Don't rely on configure.ac AC_CONFIG_FILES for install paths. | |
161 | # | |
162 | # The paths should be expanded at make time rather than configure: | |
163 | # - to support 'make install prefix=/foo DESTDIR=/foo' | |
164 | # - to recursively expands the paths (e.g. AC_CONFIG_FILES expands | |
165 | # '@usrsbin_execdir@' to ${exec_prefix}/sbin') | |
166 | # | |
167 | edit_cmd = sed \ | |
168 | -e 's|@prefix[@]|$(prefix)|g' \ | |
169 | -e 's|@exec_prefix[@]|$(exec_prefix)|g' \ | |
170 | -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ | |
171 | -e 's|@datadir[@]|$(datadir)|g' \ | |
172 | -e 's|@sbindir[@]|$(sbindir)|g' \ | |
173 | -e 's|@bindir[@]|$(bindir)|g' \ | |
44702f12 | 174 | -e 's|@docdir[@]|$(docdir)|g' \ |
d4baf92e | 175 | -e 's|@includedir[@]|$(includedir)|g' \ |
8df54559 | 176 | -e 's|@runstatedir[@]|$(runstatedir)|g' \ |
d4baf92e KZ |
177 | -e 's|@usrlib_execdir[@]|$(usrlib_execdir)|g' \ |
178 | -e 's|@usrbin_execdir[@]|$(usrbin_execdir)|g' \ | |
179 | -e 's|@usrsbin_execdir[@]|$(usrsbin_execdir)|g' \ | |
180 | -e 's|@VERSION[@]|$(VERSION)|g' \ | |
2ad21963 | 181 | -e 's|@ADJTIME_PATH[@]|$(ADJTIME_PATH)|g' \ |
d4baf92e | 182 | -e 's|@LIBUUID_VERSION[@]|$(LIBUUID_VERSION)|g' \ |
c2e299d0 | 183 | -e 's|@LIBLASTLOG2_VERSION[@]|$(LIBLASTLOG2_VERSION)|g' \ |
d4baf92e | 184 | -e 's|@LIBMOUNT_VERSION[@]|$(LIBMOUNT_VERSION)|g' \ |
10e1d2e5 SH |
185 | -e 's|@LIBMOUNT_MAJOR_VERSION[@]|$(LIBMOUNT_MAJOR_VERSION)|g' \ |
186 | -e 's|@LIBMOUNT_MINOR_VERSION[@]|$(LIBMOUNT_MINOR_VERSION)|g' \ | |
187 | -e 's|@LIBMOUNT_PATCH_VERSION[@]|$(LIBMOUNT_PATCH_VERSION)|g' \ | |
14697360 | 188 | -e 's|@LIBSMARTCOLS_VERSION[@]|$(LIBSMARTCOLS_VERSION)|g' \ |
ed79557e KZ |
189 | -e 's|@LIBFDISK_PC_REQUIRES[@]|$(LIBFDISK_PC_REQUIRES)|g' \ |
190 | -e 's|@LIBFDISK_VERSION[@]|$(LIBFDISK_VERSION)|g' \ | |
791da22d KZ |
191 | -e 's|@LIBFDISK_MAJOR_VERSION[@]|$(LIBFDISK_MAJOR_VERSION)|g' \ |
192 | -e 's|@LIBFDISK_MINOR_VERSION[@]|$(LIBFDISK_MINOR_VERSION)|g' \ | |
193 | -e 's|@LIBFDISK_PATCH_VERSION[@]|$(LIBFDISK_PATCH_VERSION)|g' \ | |
d4baf92e KZ |
194 | -e 's|@LIBBLKID_VERSION[@]|$(LIBBLKID_VERSION)|g' |
195 | ||
9ae113ca MH |
196 | if HAVE_SELINUX |
197 | edit_cmd += -e 's|@LIBSELINUX[@]|libselinux|g' | |
198 | else | |
199 | edit_cmd += -e 's|@LIBSELINUX[@]||g' | |
200 | endif | |
201 | ||
e6a49887 | 202 | if HAVE_CRYPTSETUP |
488fd4c3 LB |
203 | if CRYPTSETUP_VIA_DLOPEN |
204 | edit_cmd += -e 's|@LIBCRYPTSETUP[@]||g' | |
205 | edit_cmd += -e 's|@LIBDL[@]|-ldl|g' | |
206 | else | |
e6a49887 | 207 | edit_cmd += -e 's|@LIBCRYPTSETUP[@]|libcryptsetup|g' |
488fd4c3 LB |
208 | edit_cmd += -e 's|@LIBDL[@]||g' |
209 | endif | |
e6a49887 LB |
210 | else |
211 | edit_cmd += -e 's|@LIBCRYPTSETUP[@]||g' | |
488fd4c3 | 212 | edit_cmd += -e 's|@LIBDL[@]||g' |
e6a49887 LB |
213 | endif |
214 | ||
fee99106 KZ |
215 | if USE_VENDORDIR |
216 | edit_cmd += -e 's|@vendordir[@]|$(vendordir)|g' | |
217 | else | |
218 | edit_cmd += -e 's|@vendordir[@]||g' | |
219 | endif | |
220 | ||
075e9f9c | 221 | CLEANFILES += $(PATHFILES) $(EXTRA_LTLIBRARIES) |
d4baf92e KZ |
222 | EXTRA_DIST += $(PATHFILES:=.in) |
223 | ||
224 | $(PATHFILES): Makefile | |
225 | @ rm -f $@ $@.tmp | |
18336d16 | 226 | $(AM_V_at) $(MKDIR_P) $$(dirname $@) |
d4baf92e KZ |
227 | $(AM_V_GEN) srcdir=''; \ |
228 | test -f ./$@.in || srcdir=$(srcdir)/; \ | |
229 | $(edit_cmd) $${srcdir}$@.in >$@.tmp | |
230 | @ mv $@.tmp $@ | |
231 | ||
19feed6d | 232 | |
1a30b2bd | 233 | if ENABLE_ASCIIDOC |
daf9f2e9 | 234 | EXTRA_DIST += $(ADOCFILES_COMMON) $(MANPAGES) $(MANLINKS) |
236421a4 KZ |
235 | man_MANS += $(MANPAGES) $(MANLINKS) |
236 | ||
daf9f2e9 | 237 | $(MANPAGES): $(ADOCFILES_COMMON) |
236421a4 | 238 | |
d9a67eb5 | 239 | asciidoc_man_cmd = $(ASCIIDOCTOR) \ |
34455501 | 240 | -b manpage \ |
14ae6d5a KZ |
241 | -a 'release-version=$(VERSION)' \ |
242 | -a 'package-docdir=$(docdir)' \ | |
34455501 | 243 | -a 'VERSION=$(VERSION)' \ |
adcab835 TW |
244 | -a 'ADJTIME_PATH=$(ADJTIME_PATH)' \ |
245 | --load-path '$(abs_srcdir)/tools' \ | |
246 | --require asciidoctor-includetracker | |
34455501 | 247 | |
25a70dcb TW |
248 | if HAVE_ASCIIDOCTOR_FAILURE_LEVEL |
249 | asciidoc_man_cmd += --failure-level ERROR | |
250 | endif | |
251 | ||
8bb50864 KZ |
252 | SUFFIXES = .1.adoc .3.adoc .5.adoc .8.adoc .1 .3 .5 .8 |
253 | .1.adoc.1 .3.adoc.3 .5.adoc.5 .8.adoc.8: | |
254 | $(AM_V_GEN) test -f ./$@ || \ | |
255 | $(MKDIR_P) $$(dirname $@) && \ | |
256 | $(asciidoc_man_cmd) --base-dir=$(abs_srcdir) \ | |
257 | --destination-dir $(abs_builddir)/$$(dirname $@) $< | |
258 | ||
adcab835 TW |
259 | -include \ |
260 | $(abs_builddir)/**.1.deps \ | |
261 | $(abs_builddir)/**.3.deps \ | |
262 | $(abs_builddir)/**.5.deps \ | |
263 | $(abs_builddir)/**.8.deps | |
264 | ||
8bb50864 | 265 | $(MANLINKS): $(MANPAGES) |
236421a4 | 266 | gen-man: $(man_MANS) |
34455501 | 267 | |
cc999cce KZ |
268 | # Standard "make" follows BUILD_* macros from ./configure, and in this case, it |
269 | # ignores man pages for disabled tools, but for distribution tarball, we need | |
270 | # to generate all man-pages (to avoid dependence on asciidoc). [kzak Jan-2022] | |
271 | gen-man-dist: | |
272 | @list=`find -name *.adoc -not -path "*/man-common/*" -not -path "*/po-man/*" | sed -e 's/\.adoc//g'`; \ | |
273 | missing=`for p in $$list; do test -f $$p || echo $$p; done`; \ | |
274 | if test -n "$$missing"; then \ | |
275 | $(MAKE) $(AM_MAKEFLAGS) $$missing; \ | |
276 | fi; | |
277 | ||
278 | ||
279 | # !ENABLE_ASCIIDOC | |
236421a4 | 280 | else |
1a30b2bd KZ |
281 | |
282 | if HAVE_MANPAGES | |
283 | EXTRA_DIST += $(ADOCFILES_COMMON) $(MANPAGES) $(MANLINKS) | |
284 | man_MANS += $(MANPAGES) $(MANLINKS) | |
285 | endif | |
286 | ||
236421a4 | 287 | gen-man: |
cc999cce | 288 | gen-man-dist: |
236421a4 | 289 | endif |
34455501 MB |
290 | |
291 | ||
38c75b59 SK |
292 | # Arrange so that .tarball-version appears only in the distribution |
293 | # tarball, and never in a checked-out repository. | |
cc999cce | 294 | dist-hook: gen-man-dist |
38c75b59 | 295 | echo $(VERSION) > $(distdir)/.tarball-version |
2b85ab88 | 296 | # Set ChangeLog tag reference. |
595e901b | 297 | sed -i "s!log!log?h=v$(VERSION)!" $(distdir)/ChangeLog |
baf39af1 KZ |
298 | |
299 | distclean-local: | |
0b9f737e | 300 | -find . -name \*~ -o -name \*.orig -o -name \*.rej | xargs rm -f |
baf39af1 | 301 | rm -rf autom4te.cache |
8eeb575c | 302 | |
44e293d6 KZ |
303 | |
304 | checkincludes: | |
043102bf | 305 | @find * $(RCS_FIND_IGNORE) \ |
44e293d6 KZ |
306 | -name '*.[hcS]' -type f -print | sort -u \ |
307 | | xargs $(top_srcdir)/tools/checkincludes.pl | |
308 | ||
043102bf KZ |
309 | checkconfig: |
310 | @find * $(RCS_FIND_IGNORE) \ | |
311 | -name '*.[hcS]' -type f -print | sort -u \ | |
312 | | xargs $(top_srcdir)/tools/checkconfig.sh $(top_srcdir) | |
313 | ||
ea6c96fb | 314 | checkmans: |
a2c3638f KZ |
315 | @$(top_srcdir)/tools/checkadoc-missing.sh |
316 | @$(top_srcdir)/tools/checkadoc-repeat.sh | |
ea6c96fb | 317 | |
d05a3e97 KZ |
318 | checkxalloc: |
319 | @ $(top_srcdir)/tools/checkxalloc.sh | |
44e293d6 | 320 | |
b5c6f486 KZ |
321 | checkdecl: |
322 | @ $(top_srcdir)/tools/checkdecl.sh | |
323 | ||
64a3c227 KZ |
324 | checkcompletion: |
325 | @ $(top_srcdir)/tools/checkcompletion.sh $(top_srcdir) | |
326 | ||
a3c29314 RM |
327 | checkusage: |
328 | @ $(top_srcdir)/tools/checkusage.sh \ | |
329 | $(bin_PROGRAMS) $(sbin_PROGRAMS) \ | |
330 | $(usrbin_exec_PROGRAMS) $(usrsbin_exec_PROGRAMS) | |
58354269 KZ |
331 | checklibdoc: |
332 | @ $(top_srcdir)/tools/checklibdocs.sh \ | |
333 | $(top_srcdir)/libmount/src/libmount.sym \ | |
334 | $(top_srcdir)/libmount/docs/libmount-sections.txt | |
335 | @ $(top_srcdir)/tools/checklibdocs.sh \ | |
336 | $(top_srcdir)/libfdisk/src/libfdisk.sym \ | |
337 | $(top_srcdir)/libfdisk/docs/libfdisk-sections.txt | |
338 | @ $(top_srcdir)/tools/checklibdocs.sh \ | |
339 | $(top_srcdir)/libsmartcols/src/libsmartcols.sym \ | |
340 | $(top_srcdir)/libsmartcols/docs/libsmartcols-sections.txt | |
341 | @ $(top_srcdir)/tools/checklibdocs.sh \ | |
342 | $(top_srcdir)/libblkid/src/libblkid.sym \ | |
343 | $(top_srcdir)/libblkid/docs/libblkid-sections.txt | |
a3c29314 | 344 | |
f339d2a5 | 345 | DISTCHECK_CONFIGURE_FLAGS = \ |
e185f57e | 346 | --disable-makeinstall-chown \ |
f339d2a5 RM |
347 | --disable-use-tty-group \ |
348 | --disable-silent-rules \ | |
e185f57e | 349 | --disable-rpath \ |
f339d2a5 | 350 | --enable-all-programs \ |
f339d2a5 RM |
351 | --enable-gtk-doc \ |
352 | --with-python \ | |
353 | --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \ | |
c2e299d0 SS |
354 | --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \ |
355 | --with-tmpfilesdir=$$dc_install_base/$(tmpfilesdir) | |
236421a4 | 356 | |
905dde8f | 357 | BUILT_SOURCES += .version |
38c75b59 SK |
358 | .version: |
359 | echo $(VERSION) > $@-t && mv $@-t $@ | |
360 | ||
47fb1079 | 361 | CHANGELOG_FILE = v$(VERSION)-ChangeLog |
748c010f KZ |
362 | |
363 | $(CHANGELOG_FILE): | |
364 | @ if test "x$$PREVIOUS_VERSION" == "x"; then \ | |
47fb1079 KZ |
365 | echo "Usage make changelog PREVIOUS_VERSION=<version>"; \ |
366 | exit 1; \ | |
367 | fi | |
368 | @ echo "Changes between v$(PREVIOUS_VERSION) and v$(VERSION)" > $(CHANGELOG_FILE) | |
369 | @ echo "--------------------------------------------" >> $(CHANGELOG_FILE) | |
370 | @ echo >> $(CHANGELOG_FILE) | |
371 | $(AM_V_GEN) git log --stat v$(PREVIOUS_VERSION)..HEAD >> $(CHANGELOG_FILE) | |
fb55280a KZ |
372 | # |
373 | # | |
374 | # smatch scan -- smatch and cgcc are expected in $PATH | |
375 | # | |
376 | checksmatch: | |
377 | $(MAKE) CHECK="smatch --data=$(abs_top_srcdir)/tools/smatch-data" CC=cgcc | |
47fb1079 | 378 | |
884019e2 KZ |
379 | check-programs: $(check_PROGRAMS) |
380 | ||
748c010f KZ |
381 | changelog: $(CHANGELOG_FILE) |
382 | ||
f77a4d10 KZ |
383 | install-exec-hook: $(INSTALL_EXEC_HOOKS) |
384 | ||
385 | uninstall-hook: $(UNINSTALL_HOOKS) | |
386 | ||
387 | install-data-hook: $(INSTALL_DATA_HOOKS) | |
748c010f | 388 | |
ac73480a | 389 | clean-local: $(CLEAN_LOCALS) |
1b03e2cd KZ |
390 | |
391 | check-local: $(CHECK_LOCALS) |