3 -I$(top_srcdir)/include \
4 -DLOCALEDIR=\"$(localedir)\" \
5 -D_PATH_RUNSTATEDIR=\"${runstatedir}\" \
6 -D_PATH_SYSCONFSTATICDIR=\"${sysconfstaticdir}\"
10 -D_PATH_VENDORDIR=\"${vendordir}\"
16 -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
22 -include $(top_srcdir)/include/coverage.h
25 AM_CFLAGS = -fsigned-char $(WARN_CFLAGS)
26 AM_CXXFLAGS = $(AM_CFLAGS)
27 AM_LDFLAGS = $(ASAN_LDFLAGS) $(UBSAN_LDFLAGS) $(FUZZING_ENGINE_LDFLAGS) $(COVERAGE_LDFLAGS)
29 # Add gettext stuff to the global LDADD for systems with separate libintl
30 # library. The LTLIBINTL is generated by AM_GNU_GETTEXT macro.
34 LIB_FUZZING_ENGINE ?= -fsanitize=fuzzer
36 # Paths to in-tree libraries (use ul_ prefix to avoid possible collisions) Note
37 # that blkid.h, libmount.h, libfdisk.h and libsmartcols.h are generated and
38 # stored in build dirs.
40 ul_libblkid_incdir = $(top_builddir)/libblkid/src
41 ul_libmount_incdir = $(top_builddir)/libmount/src
42 ul_libsmartcols_incdir = $(top_builddir)/libsmartcols/src
43 ul_libfdisk_incdir = $(top_builddir)/libfdisk/src
45 ul_libuuid_incdir = $(top_srcdir)/libuuid/src
47 bashcompletiondir = @bashcompletiondir@
53 usrbin_exec_PROGRAMS =
54 usrsbin_exec_PROGRAMS =
57 usrlib_exec_LTLIBRARIES =
60 dist_usrbin_exec_SCRIPTS =
61 systemdsystemunit_DATA =
62 dist_bashcompletion_DATA =
90 RCS_FIND_IGNORE = \( -name SCCS -o -name BitKeeper -o -name .svn -o \
91 -name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o
93 ACLOCAL_AMFLAGS = -I m4
102 include tools/Makemodule.am
103 include include/Makemodule.am
104 include lib/Makemodule.am
105 include libuuid/Makemodule.am
106 include libblkid/Makemodule.am
107 include libmount/Makemodule.am
108 include libsmartcols/Makemodule.am
109 include libfdisk/Makemodule.am
111 include schedutils/Makemodule.am
112 include text-utils/Makemodule.am
113 include term-utils/Makemodule.am
114 include login-utils/Makemodule.am
115 include sys-utils/Makemodule.am
116 include misc-utils/Makemodule.am
117 include disk-utils/Makemodule.am
119 include bash-completion/Makemodule.am
120 include man-common/Makemodule.am
122 include tests/Makemodule.am
128 tools/meson-make-manpage-stub.sh \
129 tools/meson-make-symlink.sh \
131 include/meson.build \
132 libblkid/meson.build \
133 libmount/meson.build \
134 libmount/python/meson.build \
135 misc-utils/meson.build \
136 libsmartcols/meson.build \
137 text-utils/meson.build \
140 libuuid/meson.build \
141 sys-utils/meson.build \
142 libfdisk/meson.build \
143 term-utils/meson.build \
144 disk-utils/meson.build \
145 login-utils/meson.build
147 # pylibmountexec module must be installed after usrlib_exec libraries,
148 # otherwise the libtool relink step will fail to find libmount.la and
149 # will try -lmount which is possibly not available.
151 # So introduce this dependency rule:
152 # install-pylibmountexecLTLIBRARIES: install-usrlib_execLTLIBRARIES
153 @verbatim_pylibmount_dependency@
156 # Don't rely on configure.ac AC_CONFIG_FILES for install paths.
158 # The paths should be expanded at make time rather than configure:
159 # - to support 'make install prefix=/foo DESTDIR=/foo'
160 # - to recursively expands the paths (e.g. AC_CONFIG_FILES expands
161 # '@usrsbin_execdir@' to ${exec_prefix}/sbin')
164 -e 's|@prefix[@]|$(prefix)|g' \
165 -e 's|@exec_prefix[@]|$(exec_prefix)|g' \
166 -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
167 -e 's|@datadir[@]|$(datadir)|g' \
168 -e 's|@sbindir[@]|$(sbindir)|g' \
169 -e 's|@bindir[@]|$(bindir)|g' \
170 -e 's|@docdir[@]|$(docdir)|g' \
171 -e 's|@includedir[@]|$(includedir)|g' \
172 -e 's|@runstatedir[@]|$(runstatedir)|g' \
173 -e 's|@usrlib_execdir[@]|$(usrlib_execdir)|g' \
174 -e 's|@usrbin_execdir[@]|$(usrbin_execdir)|g' \
175 -e 's|@usrsbin_execdir[@]|$(usrsbin_execdir)|g' \
176 -e 's|@VERSION[@]|$(VERSION)|g' \
177 -e 's|@ADJTIME_PATH[@]|$(ADJTIME_PATH)|g' \
178 -e 's|@LIBUUID_VERSION[@]|$(LIBUUID_VERSION)|g' \
179 -e 's|@LIBMOUNT_VERSION[@]|$(LIBMOUNT_VERSION)|g' \
180 -e 's|@LIBMOUNT_MAJOR_VERSION[@]|$(LIBMOUNT_MAJOR_VERSION)|g' \
181 -e 's|@LIBMOUNT_MINOR_VERSION[@]|$(LIBMOUNT_MINOR_VERSION)|g' \
182 -e 's|@LIBMOUNT_PATCH_VERSION[@]|$(LIBMOUNT_PATCH_VERSION)|g' \
183 -e 's|@LIBSMARTCOLS_VERSION[@]|$(LIBSMARTCOLS_VERSION)|g' \
184 -e 's|@LIBFDISK_PC_REQUIRES[@]|$(LIBFDISK_PC_REQUIRES)|g' \
185 -e 's|@LIBFDISK_VERSION[@]|$(LIBFDISK_VERSION)|g' \
186 -e 's|@LIBFDISK_MAJOR_VERSION[@]|$(LIBFDISK_MAJOR_VERSION)|g' \
187 -e 's|@LIBFDISK_MINOR_VERSION[@]|$(LIBFDISK_MINOR_VERSION)|g' \
188 -e 's|@LIBFDISK_PATCH_VERSION[@]|$(LIBFDISK_PATCH_VERSION)|g' \
189 -e 's|@LIBBLKID_VERSION[@]|$(LIBBLKID_VERSION)|g'
192 edit_cmd += -e 's|@LIBSELINUX[@]|libselinux|g'
194 edit_cmd += -e 's|@LIBSELINUX[@]||g'
198 if CRYPTSETUP_VIA_DLOPEN
199 edit_cmd += -e 's|@LIBCRYPTSETUP[@]||g'
200 edit_cmd += -e 's|@LIBDL[@]|-ldl|g'
202 edit_cmd += -e 's|@LIBCRYPTSETUP[@]|libcryptsetup|g'
203 edit_cmd += -e 's|@LIBDL[@]||g'
206 edit_cmd += -e 's|@LIBCRYPTSETUP[@]||g'
207 edit_cmd += -e 's|@LIBDL[@]||g'
211 edit_cmd += -e 's|@vendordir[@]|$(vendordir)|g'
213 edit_cmd += -e 's|@vendordir[@]||g'
216 CLEANFILES += $(PATHFILES) $(EXTRA_LTLIBRARIES)
217 EXTRA_DIST += $(PATHFILES:=.in)
219 $(PATHFILES): Makefile
221 $(AM_V_at) $(MKDIR_P) $$(dirname $@)
222 $(AM_V_GEN) srcdir=''; \
223 test -f ./$@.in || srcdir=$(srcdir)/; \
224 $(edit_cmd) $${srcdir}$@.in >$@.tmp
229 EXTRA_DIST += $(ADOCFILES_COMMON) $(MANPAGES) $(MANLINKS)
230 man_MANS += $(MANPAGES) $(MANLINKS)
232 $(MANPAGES): $(ADOCFILES_COMMON)
234 asciidoc_man_cmd = $(ASCIIDOCTOR) \
236 -a 'release-version=$(VERSION)' \
237 -a 'package-docdir=$(docdir)' \
238 -a 'VERSION=$(VERSION)' \
239 -a 'ADJTIME_PATH=$(ADJTIME_PATH)' \
240 --load-path '$(abs_srcdir)/tools' \
241 --require asciidoctor-includetracker
243 if HAVE_ASCIIDOCTOR_FAILURE_LEVEL
244 asciidoc_man_cmd += --failure-level ERROR
247 SUFFIXES = .1.adoc .3.adoc .5.adoc .8.adoc .1 .3 .5 .8
248 .1.adoc.1 .3.adoc.3 .5.adoc.5 .8.adoc.8:
249 $(AM_V_GEN) test -f ./$@ || \
250 $(MKDIR_P) $$(dirname $@) && \
251 $(asciidoc_man_cmd) --base-dir=$(abs_srcdir) \
252 --destination-dir $(abs_builddir)/$$(dirname $@) $<
255 $(abs_builddir)/**.1.deps \
256 $(abs_builddir)/**.3.deps \
257 $(abs_builddir)/**.5.deps \
258 $(abs_builddir)/**.8.deps
260 $(MANLINKS): $(MANPAGES)
263 # Standard "make" follows BUILD_* macros from ./configure, and in this case, it
264 # ignores man pages for disabled tools, but for distribution tarball, we need
265 # to generate all man-pages (to avoid dependence on asciidoc). [kzak Jan-2022]
267 @list=`find -name *.adoc -not -path "*/man-common/*" -not -path "*/po-man/*" | sed -e 's/\.adoc//g'`; \
268 missing=`for p in $$list; do test -f $$p || echo $$p; done`; \
269 if test -n "$$missing"; then \
270 $(MAKE) $(AM_MAKEFLAGS) $$missing; \
278 EXTRA_DIST += $(ADOCFILES_COMMON) $(MANPAGES) $(MANLINKS)
279 man_MANS += $(MANPAGES) $(MANLINKS)
287 # Arrange so that .tarball-version appears only in the distribution
288 # tarball, and never in a checked-out repository.
289 dist-hook: gen-man-dist
290 echo $(VERSION) > $(distdir)/.tarball-version
291 # Set ChangeLog tag reference.
292 sed -i "s!log!log?h=v$(VERSION)!" $(distdir)/ChangeLog
295 -find . -name \*~ -o -name \*.orig -o -name \*.rej | xargs rm -f
296 rm -rf autom4te.cache
300 @find * $(RCS_FIND_IGNORE) \
301 -name '*.[hcS]' -type f -print | sort -u \
302 | xargs $(top_srcdir)/tools/checkincludes.pl
305 @find * $(RCS_FIND_IGNORE) \
306 -name '*.[hcS]' -type f -print | sort -u \
307 | xargs $(top_srcdir)/tools/checkconfig.sh $(top_srcdir)
310 @$(top_srcdir)/tools/checkadoc-missing.sh
311 @$(top_srcdir)/tools/checkadoc-repeat.sh
314 @ $(top_srcdir)/tools/checkxalloc.sh
317 @ $(top_srcdir)/tools/checkdecl.sh
320 @ $(top_srcdir)/tools/checkcompletion.sh $(top_srcdir)
323 @ $(top_srcdir)/tools/checkusage.sh \
324 $(bin_PROGRAMS) $(sbin_PROGRAMS) \
325 $(usrbin_exec_PROGRAMS) $(usrsbin_exec_PROGRAMS)
327 @ $(top_srcdir)/tools/checklibdocs.sh \
328 $(top_srcdir)/libmount/src/libmount.sym \
329 $(top_srcdir)/libmount/docs/libmount-sections.txt
330 @ $(top_srcdir)/tools/checklibdocs.sh \
331 $(top_srcdir)/libfdisk/src/libfdisk.sym \
332 $(top_srcdir)/libfdisk/docs/libfdisk-sections.txt
333 @ $(top_srcdir)/tools/checklibdocs.sh \
334 $(top_srcdir)/libsmartcols/src/libsmartcols.sym \
335 $(top_srcdir)/libsmartcols/docs/libsmartcols-sections.txt
336 @ $(top_srcdir)/tools/checklibdocs.sh \
337 $(top_srcdir)/libblkid/src/libblkid.sym \
338 $(top_srcdir)/libblkid/docs/libblkid-sections.txt
340 DISTCHECK_CONFIGURE_FLAGS = \
341 --disable-makeinstall-chown \
342 --disable-use-tty-group \
343 --disable-silent-rules \
345 --enable-all-programs \
348 --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
349 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
352 BUILT_SOURCES += .version
354 echo $(VERSION) > $@-t && mv $@-t $@
356 CHANGELOG_FILE = v$(VERSION)-ChangeLog
359 @ if test "x$$PREVIOUS_VERSION" == "x"; then \
360 echo "Usage make changelog PREVIOUS_VERSION=<version>"; \
363 @ echo "Changes between v$(PREVIOUS_VERSION) and v$(VERSION)" > $(CHANGELOG_FILE)
364 @ echo "--------------------------------------------" >> $(CHANGELOG_FILE)
365 @ echo >> $(CHANGELOG_FILE)
366 $(AM_V_GEN) git log --stat v$(PREVIOUS_VERSION)..HEAD >> $(CHANGELOG_FILE)
369 # smatch scan -- smatch and cgcc are expected in $PATH
372 $(MAKE) CHECK="smatch --data=$(abs_top_srcdir)/tools/smatch-data" CC=cgcc
374 check-programs: $(check_PROGRAMS)
376 changelog: $(CHANGELOG_FILE)
378 install-exec-hook: $(INSTALL_EXEC_HOOKS)
380 uninstall-hook: $(UNINSTALL_HOOKS)
382 install-data-hook: $(INSTALL_DATA_HOOKS)
384 clean-local: $(CLEAN_LOCALS)
386 check-local: $(CHECK_LOCALS)