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)' \
233 --failure-level ERROR \
234 --load-path '$(abs_srcdir)/tools' \
235 --require asciidoctor-includetracker
237 SUFFIXES = .1.adoc .3.adoc .5.adoc .8.adoc .1 .3 .5 .8
238 .1.adoc.1 .3.adoc.3 .5.adoc.5 .8.adoc.8:
239 $(AM_V_GEN) test -f ./$@ || \
240 $(MKDIR_P) $$(dirname $@) && \
241 $(asciidoc_man_cmd) --base-dir=$(abs_srcdir) \
242 --destination-dir $(abs_builddir)/$$(dirname $@) $<
245 $(abs_builddir)/**.1.deps \
246 $(abs_builddir)/**.3.deps \
247 $(abs_builddir)/**.5.deps \
248 $(abs_builddir)/**.8.deps
250 $(MANLINKS): $(MANPAGES)
253 # Standard "make" follows BUILD_* macros from ./configure, and in this case, it
254 # ignores man pages for disabled tools, but for distribution tarball, we need
255 # to generate all man-pages (to avoid dependence on asciidoc). [kzak Jan-2022]
257 @list=`find -name *.adoc -not -path "*/man-common/*" -not -path "*/po-man/*" | sed -e 's/\.adoc//g'`; \
258 missing=`for p in $$list; do test -f $$p || echo $$p; done`; \
259 if test -n "$$missing"; then \
260 $(MAKE) $(AM_MAKEFLAGS) $$missing; \
268 EXTRA_DIST += $(ADOCFILES_COMMON) $(MANPAGES) $(MANLINKS)
269 man_MANS += $(MANPAGES) $(MANLINKS)
277 # Arrange so that .tarball-version appears only in the distribution
278 # tarball, and never in a checked-out repository.
279 dist-hook: gen-man-dist
280 echo $(VERSION) > $(distdir)/.tarball-version
281 # Set ChangeLog tag reference.
282 sed -i "s!log!log?h=v$(VERSION)!" $(distdir)/ChangeLog
285 -find . -name \*~ -o -name \*.orig -o -name \*.rej | xargs rm -f
286 rm -rf autom4te.cache
290 @find * $(RCS_FIND_IGNORE) \
291 -name '*.[hcS]' -type f -print | sort -u \
292 | xargs $(top_srcdir)/tools/checkincludes.pl
295 @find * $(RCS_FIND_IGNORE) \
296 -name '*.[hcS]' -type f -print | sort -u \
297 | xargs $(top_srcdir)/tools/checkconfig.sh $(top_srcdir)
300 @$(top_srcdir)/tools/checkadoc-missing.sh
301 @$(top_srcdir)/tools/checkadoc-repeat.sh
304 @ $(top_srcdir)/tools/checkxalloc.sh
307 @ $(top_srcdir)/tools/checkdecl.sh
310 @ $(top_srcdir)/tools/checkcompletion.sh $(top_srcdir)
313 @ $(top_srcdir)/tools/checkusage.sh \
314 $(bin_PROGRAMS) $(sbin_PROGRAMS) \
315 $(usrbin_exec_PROGRAMS) $(usrsbin_exec_PROGRAMS)
317 @ $(top_srcdir)/tools/checklibdocs.sh \
318 $(top_srcdir)/libmount/src/libmount.sym \
319 $(top_srcdir)/libmount/docs/libmount-sections.txt
320 @ $(top_srcdir)/tools/checklibdocs.sh \
321 $(top_srcdir)/libfdisk/src/libfdisk.sym \
322 $(top_srcdir)/libfdisk/docs/libfdisk-sections.txt
323 @ $(top_srcdir)/tools/checklibdocs.sh \
324 $(top_srcdir)/libsmartcols/src/libsmartcols.sym \
325 $(top_srcdir)/libsmartcols/docs/libsmartcols-sections.txt
326 @ $(top_srcdir)/tools/checklibdocs.sh \
327 $(top_srcdir)/libblkid/src/libblkid.sym \
328 $(top_srcdir)/libblkid/docs/libblkid-sections.txt
330 DISTCHECK_CONFIGURE_FLAGS = \
331 --disable-makeinstall-chown \
332 --disable-use-tty-group \
333 --disable-silent-rules \
335 --enable-all-programs \
338 --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
339 --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
342 BUILT_SOURCES = .version
344 echo $(VERSION) > $@-t && mv $@-t $@
346 CHANGELOG_FILE = v$(VERSION)-ChangeLog
349 @ if test "x$$PREVIOUS_VERSION" == "x"; then \
350 echo "Usage make changelog PREVIOUS_VERSION=<version>"; \
353 @ echo "Changes between v$(PREVIOUS_VERSION) and v$(VERSION)" > $(CHANGELOG_FILE)
354 @ echo "--------------------------------------------" >> $(CHANGELOG_FILE)
355 @ echo >> $(CHANGELOG_FILE)
356 $(AM_V_GEN) git log --stat v$(PREVIOUS_VERSION)..HEAD >> $(CHANGELOG_FILE)
359 # smatch scan -- smatch and cgcc are expected in $PATH
362 $(MAKE) CHECK="smatch --data=$(abs_top_srcdir)/tools/smatch-data" CC=cgcc
364 check-programs: $(check_PROGRAMS)
366 changelog: $(CHANGELOG_FILE)
368 install-exec-hook: $(INSTALL_EXEC_HOOKS)
370 uninstall-hook: $(UNINSTALL_HOOKS)
372 install-data-hook: $(INSTALL_DATA_HOOKS)
374 clean-local: $(CLEAN_LOCALS)
376 check-local: $(CHECK_LOCALS)