1AM_CPPFLAGS = \
2	-include config.h \
3	-I$(top_srcdir)/include \
4	-DLOCALEDIR=\"$(localedir)\" \
5	-D_PATH_LOCALSTATEDIR=\"${localstatedir}\"
6AM_CFLAGS = -fsigned-char $(WARN_CFLAGS)
7AM_LDFLAGS =
8
9# Add gettext stuff to the global LDADD for systems with separate libintl
10# library. The LTLIBINTL is generated by AM_GNU_GETTEXT macro.
11#
12LDADD = $(LTLIBINTL)
13
14# Automake (at least up to 1.10) mishandles dist_man_MANS inside conditionals.
15# Unlike with other dist primaries, the files are not distributed if the
16# conditional is false.
17# Work the bug around until it is fixed:
18dist_noinst_DATA = $(dist_man_MANS)
19
20# Paths to in-tree libraries (use ul_ prefix to avoid possible collisions) Note
21# that blkid.h, libmount.h and libsmartcols.h are generated and stored in build
22# dirs.
23#
24ul_libblkid_incdir = $(top_builddir)/libblkid/src
25ul_libmount_incdir = $(top_builddir)/libmount/src
26ul_libsmartcols_incdir = $(top_builddir)/libsmartcols/src
27ul_libuuid_incdir  = $(top_srcdir)/libuuid/src
28ul_libfdisk_incdir  = $(top_srcdir)/libfdisk/src
29
30pkgconfigdir = $(usrlib_execdir)/pkgconfig
31
32bashcompletiondir = @bashcompletiondir@
33
34dist_noinst_HEADERS =
35noinst_PROGRAMS =
36noinst_LTLIBRARIES =
37usrbin_exec_PROGRAMS =
38usrsbin_exec_PROGRAMS =
39dist_man_MANS =
40man_MANS =
41pkgconfig_DATA =
42usrlib_exec_LTLIBRARIES =
43bin_PROGRAMS =
44sbin_PROGRAMS =
45dist_usrbin_exec_SCRIPTS =
46systemdsystemunit_DATA =
47dist_bashcompletion_DATA =
48check_PROGRAMS =
49dist_check_SCRIPTS =
50TESTS =
51
52PATHFILES =
53
54INSTALL_EXEC_HOOKS =
55UNINSTALL_HOOKS =
56INSTALL_DATA_HOOKS =
57CLEAN_LOCALS =
58CHECK_LOCALS =
59
60EXTRA_DIST =
61CLEANFILES =
62
63SUBDIRS = po
64
65RCS_FIND_IGNORE = \( -name SCCS -o -name BitKeeper -o -name .svn -o \
66		-name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o
67
68ACLOCAL_AMFLAGS = -I m4
69
70EXTRA_DIST += \
71	.version \
72	autogen.sh \
73	Documentation \
74	po/update-potfiles \
75	README.licensing \
76	tools/git-version-gen
77
78
79include include/Makemodule.am
80include lib/Makemodule.am
81include libuuid/Makemodule.am
82include libblkid/Makemodule.am
83include libmount/Makemodule.am
84include libsmartcols/Makemodule.am
85include libfdisk/Makemodule.am
86
87include schedutils/Makemodule.am
88include text-utils/Makemodule.am
89include term-utils/Makemodule.am
90include login-utils/Makemodule.am
91include sys-utils/Makemodule.am
92include misc-utils/Makemodule.am
93include disk-utils/Makemodule.am
94
95include bash-completion/Makemodule.am
96
97include tests/Makemodule.am
98
99#
100# Don't rely on configure.ac AC_CONFIG_FILES for install paths.
101#
102# The paths should be expanded at make time rather than configure:
103#  - to support 'make install prefix=/foo DESTDIR=/foo'
104#  - to recursively expands the paths (e.g. AC_CONFIG_FILES expands
105#    '@usrsbin_execdir@' to ${exec_prefix}/sbin')
106#
107edit_cmd = sed \
108	 -e 's|@prefix[@]|$(prefix)|g' \
109	 -e 's|@exec_prefix[@]|$(exec_prefix)|g' \
110	 -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
111	 -e 's|@datadir[@]|$(datadir)|g' \
112	 -e 's|@sbindir[@]|$(sbindir)|g' \
113	 -e 's|@bindir[@]|$(bindir)|g' \
114	 -e 's|@includedir[@]|$(includedir)|g' \
115	 -e 's|@localstatedir[@]|$(localstatedir)|g' \
116	 -e 's|@usrlib_execdir[@]|$(usrlib_execdir)|g' \
117	 -e 's|@usrbin_execdir[@]|$(usrbin_execdir)|g' \
118	 -e 's|@usrsbin_execdir[@]|$(usrsbin_execdir)|g' \
119	 -e 's|@VERSION[@]|$(VERSION)|g' \
120	 -e 's|@ADJTIME_PATH[@]|$(ADJTIME_PATH)|g' \
121	 -e 's|@LIBUUID_VERSION[@]|$(LIBUUID_VERSION)|g' \
122	 -e 's|@LIBMOUNT_VERSION[@]|$(LIBMOUNT_VERSION)|g' \
123	 -e 's|@LIBSMARTCOLS_VERSION[@]|$(LIBSMARTCOLS_VERSION)|g' \
124	 -e 's|@LIBBLKID_VERSION[@]|$(LIBBLKID_VERSION)|g'
125
126CLEANFILES += $(PATHFILES)
127EXTRA_DIST += $(PATHFILES:=.in)
128
129$(PATHFILES): Makefile
130	@ rm -f $@ $@.tmp
131	$(AM_V_at) test -d $(dir $@) || mkdir -p $(dir $@)
132	$(AM_V_GEN) srcdir=''; \
133		test -f ./$@.in || srcdir=$(srcdir)/; \
134		$(edit_cmd) $${srcdir}$@.in >$@.tmp
135	@ mv $@.tmp $@
136
137# Arrange so that .tarball-version appears only in the distribution
138# tarball, and never in a checked-out repository.
139dist-hook:
140	echo $(VERSION) > $(distdir)/.tarball-version
141# Set ChangeLog tag reference.
142	sed -i "s/log/log;h=$(VERSION)/" $(distdir)/ChangeLog
143
144distclean-local:
145	-find . -name \*~ -o -name \*.orig -o -name \*.rej | xargs rm -f
146	rm -rf autom4te.cache
147
148
149checkincludes:
150	@find * $(RCS_FIND_IGNORE) \
151		-name '*.[hcS]' -type f -print | sort -u \
152		| xargs $(top_srcdir)/tools/checkincludes.pl
153
154checkconfig:
155	@find * $(RCS_FIND_IGNORE) \
156		-name '*.[hcS]' -type f -print | sort -u \
157		| xargs $(top_srcdir)/tools/checkconfig.sh $(top_srcdir)
158
159checkmans:
160	@$(top_srcdir)/tools/checkmans.sh
161
162checkxalloc:
163	@ $(top_srcdir)/tools/checkxalloc.sh
164
165checkdecl:
166	@ $(top_srcdir)/tools/checkdecl.sh
167
168DISTCHECK_CONFIGURE_FLAGS = \
169	--disable-use-tty-group \
170	--disable-silent-rules \
171	--enable-all-programs \
172	--enable-static-programs \
173	--enable-gtk-doc \
174	--with-python \
175	--with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
176	--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
177
178BUILT_SOURCES = .version
179.version:
180	echo $(VERSION) > $@-t && mv $@-t $@
181
182CHANGELOG_FILE = v$(VERSION)-ChangeLog
183
184$(CHANGELOG_FILE):
185	@ if test "x$$PREVIOUS_VERSION" == "x"; then \
186		echo "Usage make changelog PREVIOUS_VERSION=<version>"; \
187		exit 1; \
188	fi
189	@ echo "Changes between v$(PREVIOUS_VERSION) and v$(VERSION)" > $(CHANGELOG_FILE)
190	@ echo "--------------------------------------------" >> $(CHANGELOG_FILE)
191	@ echo >> $(CHANGELOG_FILE)
192	$(AM_V_GEN) git log --stat v$(PREVIOUS_VERSION)..HEAD >> $(CHANGELOG_FILE)
193#
194#
195# smatch scan -- smatch and cgcc are expected in $PATH
196#
197checksmatch:
198	$(MAKE) CHECK="smatch --data=$(abs_top_srcdir)/tools/smatch-data" CC=cgcc
199
200changelog: $(CHANGELOG_FILE)
201
202install-exec-hook: $(INSTALL_EXEC_HOOKS)
203
204uninstall-hook: $(UNINSTALL_HOOKS)
205
206install-data-hook: $(INSTALL_DATA_HOOKS)
207
208clean-local: $(CLEAN_LOCALS)
209
210check-local: $(CHECK_LOCALS)
211