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
20 AM_CFLAGS = -fsigned-char $(WARN_CFLAGS)
21 AM_CXXFLAGS = $(AM_CFLAGS)
22 AM_LDFLAGS = $(ASAN_LDFLAGS) $(UBSAN_LDFLAGS) $(FUZZING_ENGINE_LDFLAGS)
24 # Add gettext stuff to the global LDADD for systems with separate libintl
25 # library. The LTLIBINTL is generated by AM_GNU_GETTEXT macro.
29 LIB_FUZZING_ENGINE ?= -fsanitize=fuzzer
31 # Paths to in-tree libraries (use ul_ prefix to avoid possible collisions) Note
32 # that blkid.h, libmount.h, libfdisk.h and libsmartcols.h are generated and
33 # stored in build dirs.
35 ul_libblkid_incdir = $(top_builddir)/libblkid/src
36 ul_libmount_incdir = $(top_builddir)/libmount/src
37 ul_libsmartcols_incdir = $(top_builddir)/libsmartcols/src
38 ul_libfdisk_incdir = $(top_builddir)/libfdisk/src
40 ul_libuuid_incdir = $(top_srcdir)/libuuid/src
42 bashcompletiondir = @bashcompletiondir@
48 usrbin_exec_PROGRAMS =
49 usrsbin_exec_PROGRAMS =
52 usrlib_exec_LTLIBRARIES =
55 dist_usrbin_exec_SCRIPTS =
56 systemdsystemunit_DATA =
57 dist_bashcompletion_DATA =
83 RCS_FIND_IGNORE = \( -name SCCS -o -name BitKeeper -o -name .svn -o \
84 -name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o
86 ACLOCAL_AMFLAGS = -I m4
95 include tools/Makemodule.am
96 include include/Makemodule.am
97 include lib/Makemodule.am
98 include libuuid/Makemodule.am
99 include libblkid/Makemodule.am
100 include libmount/Makemodule.am
101 include libsmartcols/Makemodule.am
102 include libfdisk/Makemodule.am
104 include schedutils/Makemodule.am
105 include text-utils/Makemodule.am
106 include term-utils/Makemodule.am
107 include login-utils/Makemodule.am
108 include sys-utils/Makemodule.am
109 include misc-utils/Makemodule.am
110 include disk-utils/Makemodule.am
112 include bash-completion/Makemodule.am
113 include man-common/Makemodule.am
115 include tests/Makemodule.am
121 tools/meson-make-manpage-stub.sh \
122 tools/meson-make-symlink.sh \
124 include/meson.build \
125 libblkid/meson.build \
126 libmount/meson.build \
127 libmount/python/meson.build \
128 misc-utils/meson.build \
129 libsmartcols/meson.build \
130 text-utils/meson.build \
133 libuuid/meson.build \
134 sys-utils/meson.build \
135 libfdisk/meson.build \
136 term-utils/meson.build \
137 disk-utils/meson.build \
138 login-utils/meson.build
140 # pylibmountexec module must be installed after usrlib_exec libraries,
141 # otherwise the libtool relink step will fail to find libmount.la and
142 # will try -lmount which is possibly not available.
144 # So introduce this dependency rule:
145 # install-pylibmountexecLTLIBRARIES: install-usrlib_execLTLIBRARIES
146 @verbatim_pylibmount_dependency@
149 # Don't rely on configure.ac AC_CONFIG_FILES for install paths.
151 # The paths should be expanded at make time rather than configure:
152 # - to support 'make install prefix=/foo DESTDIR=/foo'
153 # - to recursively expands the paths (e.g. AC_CONFIG_FILES expands
154 # '@usrsbin_execdir@' to ${exec_prefix}/sbin')
157 -e 's|@prefix[@]|$(prefix)|g' \
158 -e 's|@exec_prefix[@]|$(exec_prefix)|g' \
159 -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
160 -e 's|@datadir[@]|$(datadir)|g' \
161 -e 's|@sbindir[@]|$(sbindir)|g' \
162 -e 's|@bindir[@]|$(bindir)|g' \
163 -e 's|@docdir[@]|$(docdir)|g' \
164 -e 's|@includedir[@]|$(includedir)|g' \
165 -e 's|@runstatedir[@]|$(runstatedir)|g' \
166 -e 's|@usrlib_execdir[@]|$(usrlib_execdir)|g' \
167 -e 's|@usrbin_execdir[@]|$(usrbin_execdir)|g' \
168 -e 's|@usrsbin_execdir[@]|$(usrsbin_execdir)|g' \
169 -e 's|@VERSION[@]|$(VERSION)|g' \
170 -e 's|@ADJTIME_PATH[@]|$(ADJTIME_PATH)|g' \
171 -e 's|@LIBUUID_VERSION[@]|$(LIBUUID_VERSION)|g' \
172 -e 's|@LIBMOUNT_VERSION[@]|$(LIBMOUNT_VERSION)|g' \
173 -e 's|@LIBMOUNT_MAJOR_VERSION[@]|$(LIBMOUNT_MAJOR_VERSION)|g' \
174 -e 's|@LIBMOUNT_MINOR_VERSION[@]|$(LIBMOUNT_MINOR_VERSION)|g' \
175 -e 's|@LIBMOUNT_PATCH_VERSION[@]|$(LIBMOUNT_PATCH_VERSION)|g' \
176 -e 's|@LIBSMARTCOLS_VERSION[@]|$(LIBSMARTCOLS_VERSION)|g' \
177 -e 's|@LIBFDISK_PC_REQUIRES[@]|$(LIBFDISK_PC_REQUIRES)|g' \
178 -e 's|@LIBFDISK_VERSION[@]|$(LIBFDISK_VERSION)|g' \
179 -e 's|@LIBFDISK_MAJOR_VERSION[@]|$(LIBFDISK_MAJOR_VERSION)|g' \
180 -e 's|@LIBFDISK_MINOR_VERSION[@]|$(LIBFDISK_MINOR_VERSION)|g' \
181 -e 's|@LIBFDISK_PATCH_VERSION[@]|$(LIBFDISK_PATCH_VERSION)|g' \
182 -e 's|@LIBBLKID_VERSION[@]|$(LIBBLKID_VERSION)|g'
185 edit_cmd += -e 's|@LIBSELINUX[@]|libselinux|g'
187 edit_cmd += -e 's|@LIBSELINUX[@]||g'
191 if CRYPTSETUP_VIA_DLOPEN
192 edit_cmd += -e 's|@LIBCRYPTSETUP[@]||g'
193 edit_cmd += -e 's|@LIBDL[@]|-ldl|g'
195 edit_cmd += -e 's|@LIBCRYPTSETUP[@]|libcryptsetup|g'
196 edit_cmd += -e 's|@LIBDL[@]||g'
199 edit_cmd += -e 's|@LIBCRYPTSETUP[@]||g'
200 edit_cmd += -e 's|@LIBDL[@]||g'
204 edit_cmd += -e 's|@vendordir[@]|$(vendordir)|g'
206 edit_cmd += -e 's|@vendordir[@]||g'
209 CLEANFILES += $(PATHFILES) $(EXTRA_LTLIBRARIES)
210 EXTRA_DIST += $(PATHFILES:=.in)
212 $(PATHFILES): Makefile
214 $(AM_V_at) $(MKDIR_P) $$(dirname $@)
215 $(AM_V_GEN) srcdir=''; \
216 test -f ./$@.in || srcdir=$(srcdir)/; \
217 $(edit_cmd) $${srcdir}$@.in >$@.tmp
222 EXTRA_DIST += $(ADOCFILES_COMMON) $(MANPAGES) $(MANLINKS)
223 man_MANS += $(MANPAGES) $(MANLINKS)
225 $(MANPAGES): $(ADOCFILES_COMMON)
227 asciidoc_man_cmd = $(ASCIIDOCTOR) \
229 -a 'release-version=$(VERSION)' \
230 -a 'package-docdir=$(docdir)' \
231 -a 'VERSION=$(VERSION)' \
232 -a 'ADJTIME_PATH=$(ADJTIME_PATH)'
234 SUFFIXES = .1.adoc .3.adoc .5.adoc .8.adoc .1 .3 .5 .8
235 .1.adoc.1 .3.adoc.3 .5.adoc.5 .8.adoc.8:
236 $(AM_V_GEN) test -f ./$@ || \
237 $(MKDIR_P) $$(dirname $@) && \
238 $(asciidoc_man_cmd) --base-dir=$(abs_srcdir) \
239 --destination-dir $(abs_builddir)/$$(dirname $@) $<
241 $(MANLINKS): $(MANPAGES)
244 # Standard "make" follows BUILD_* macros from ./configure, and in this case, it
245 # ignores man pages for disabled tools, but for distribution tarball, we need
246 # to generate all man-pages (to avoid dependence on asciidoc). [kzak Jan-2022]
248 @list=`find -name *.adoc -not -path "*/man-common/*" -not -path "*/po-man/*" | sed -e 's/\.adoc//g'`; \
249 missing=`for p in $$list; do test -f $$p || echo $$p; done`; \
250 if test -n "$$missing"; then \
251 $(MAKE) $(AM_MAKEFLAGS) $$missing; \
259 EXTRA_DIST += $(ADOCFILES_COMMON) $(MANPAGES) $(MANLINKS)
260 man_MANS += $(MANPAGES) $(MANLINKS)
268 # Arrange so that .tarball-version appears only in the distribution
269 # tarball, and never in a checked-out repository.
270 dist-hook: gen-man-dist
271 echo $(VERSION) > $(distdir)/.tarball-version
272 # Set ChangeLog tag reference.
273 sed -i "s!log!log?h=v$(VERSION)!" $(distdir)/ChangeLog
276 -find . -name \*~ -o -name \*.orig -o -name \*.rej | xargs rm -f
277 rm -rf autom4te.cache
281 @find * $(RCS_FIND_IGNORE) \
282 -name '*.[hcS]' -type f -print | sort -u \
283 | xargs $(top_srcdir)/tools/checkincludes.pl
286 @find * $(RCS_FIND_IGNORE) \
287 -name '*.[hcS]' -type f -print | sort -u \
288 | xargs $(top_srcdir)/tools/checkconfig.sh $(top_srcdir)
291 @$(top_srcdir)/tools/checkadoc-missing.sh
292 @$(top_srcdir)/tools/checkadoc-repeat.sh
295 @ $(top_srcdir)/tools/checkxalloc.sh
298 @ $(top_srcdir)/tools/checkdecl.sh
301 @ $(top_srcdir)/tools/checkcompletion.sh $(top_srcdir)
304 @ $(top_srcdir)/tools/checkusage.sh \
305 $(bin_PROGRAMS) $(sbin_PROGRAMS) \
306 $(usrbin_exec_PROGRAMS) $(usrsbin_exec_PROGRAMS)
308 @ $(top_srcdir)/tools/checklibdocs.sh \
309 $(top_srcdir)/libmount/src/libmount.sym \
310 $(top_srcdir)/libmount/docs/libmount-sections.txt
311 @ $(top_srcdir)/tools/checklibdocs.sh \
312 $(top_srcdir)/libfdisk/src/libfdisk.sym \
313 $(top_srcdir)/libfdisk/docs/libfdisk-sections.txt
314 @ $(top_srcdir)/tools/checklibdocs.sh \
315 $(top_srcdir)/libsmartcols/src/libsmartcols.sym \
316 $(top_srcdir)/libsmartcols/docs/libsmartcols-sections.txt
317 @ $(top_srcdir)/tools/checklibdocs.sh \
318 $(top_srcdir)/libblkid/src/libblkid.sym \
319 $(top_srcdir)/libblkid/docs/libblkid-sections.txt
321 DISTCHECK_CONFIGURE_FLAGS = \
322 --disable-makeinstall-chown \
323 --disable-use-tty-group \
324 --disable-silent-rules \
326 --enable-all-programs \
329 --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
330 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
333 BUILT_SOURCES = .version
335 echo $(VERSION) > $@-t && mv $@-t $@
337 CHANGELOG_FILE = v$(VERSION)-ChangeLog
340 @ if test "x$$PREVIOUS_VERSION" == "x"; then \
341 echo "Usage make changelog PREVIOUS_VERSION=<version>"; \
344 @ echo "Changes between v$(PREVIOUS_VERSION) and v$(VERSION)" > $(CHANGELOG_FILE)
345 @ echo "--------------------------------------------" >> $(CHANGELOG_FILE)
346 @ echo >> $(CHANGELOG_FILE)
347 $(AM_V_GEN) git log --stat v$(PREVIOUS_VERSION)..HEAD >> $(CHANGELOG_FILE)
350 # smatch scan -- smatch and cgcc are expected in $PATH
353 $(MAKE) CHECK="smatch --data=$(abs_top_srcdir)/tools/smatch-data" CC=cgcc
355 check-programs: $(check_PROGRAMS)
357 changelog: $(CHANGELOG_FILE)
359 install-exec-hook: $(INSTALL_EXEC_HOOKS)
361 uninstall-hook: $(UNINSTALL_HOOKS)
363 install-data-hook: $(INSTALL_DATA_HOOKS)
365 clean-local: $(CLEAN_LOCALS)
367 check-local: $(CHECK_LOCALS)