summaryrefslogtreecommitdiffstats
path: root/Makefile.am
blob: 17f4c339d6970b4b3ff7c5ead9f012959e043b23 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
AM_CPPFLAGS = \
	-include config.h \
	-I$(top_srcdir)/include \
	-DLOCALEDIR=\"$(localedir)\" \
	-D_PATH_LOCALSTATEDIR=\"${localstatedir}\"
AM_CFLAGS = -fsigned-char $(WARN_CFLAGS)
AM_LDFLAGS =

# Add gettext stuff to the global LDADD for systems with separate libintl
# library. The LTLIBINTL is generated by AM_GNU_GETTEXT macro.
#
LDADD = $(LTLIBINTL)

# Automake (at least up to 1.10) mishandles dist_man_MANS inside conditionals.
# Unlike with other dist primaries, the files are not distributed if the
# conditional is false.
# Work the bug around until it is fixed:
dist_noinst_DATA = $(dist_man_MANS)

# Paths to in-tree libraries (use ul_ prefix to avoid possible collisions)
# Note that blkid.h and libmount.h are generated and stored in build dirs.
#
ul_libblkid_incdir = $(top_builddir)/libblkid/src
ul_libmount_incdir = $(top_builddir)/libmount/src
ul_libuuid_incdir  = $(top_srcdir)/libuuid/src
ul_libfdisk_incdir  = $(top_srcdir)/libfdisk/src

pkgconfigdir = $(usrlib_execdir)/pkgconfig

bashcompletiondir = @bashcompletiondir@

dist_noinst_HEADERS =
noinst_PROGRAMS =
noinst_LTLIBRARIES =
usrbin_exec_PROGRAMS =
usrsbin_exec_PROGRAMS =
dist_man_MANS =
man_MANS =
pkgconfig_DATA =
usrlib_exec_LTLIBRARIES =
bin_PROGRAMS =
sbin_PROGRAMS =
dist_usrbin_exec_SCRIPTS =
systemdsystemunit_DATA =
check_PROGRAMS =
TESTS =

PATHFILES =

INSTALL_EXEC_HOOKS =
UNINSTALL_HOOKS =
INSTALL_DATA_HOOKS =
CLEAN_LOCALS =
CHECK_LOCALS =

EXTRA_DIST =
CLEANFILES =

SUBDIRS = po

RCS_FIND_IGNORE = \( -name SCCS -o -name BitKeeper -o -name .svn -o \
		-name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o

ACLOCAL_AMFLAGS = -I m4

EXTRA_DIST += \
	.version \
	autogen.sh \
	Documentation \
	po/update-potfiles \
	README.licensing \
	tools/git-version-gen


include include/Makemodule.am
include lib/Makemodule.am
include libuuid/Makemodule.am
include libblkid/Makemodule.am
include libmount/Makemodule.am
include libfdisk/Makemodule.am

include schedutils/Makemodule.am
include text-utils/Makemodule.am
include term-utils/Makemodule.am
include login-utils/Makemodule.am
include mount-deprecated/Makemodule.am
include sys-utils/Makemodule.am
include misc-utils/Makemodule.am
include disk-utils/Makemodule.am
include fdisks/Makemodule.am

include bash-completion/Makemodule.am

include tests/Makemodule.am

#
# Don't rely on configure.ac AC_CONFIG_FILES for install paths.
#
# The paths should be expanded at make time rather than configure:
#  - to support 'make install prefix=/foo DESTDIR=/foo'
#  - to recursively expands the paths (e.g. AC_CONFIG_FILES expands
#    '@usrsbin_execdir@' to ${exec_prefix}/sbin')
#
edit_cmd = sed \
	 -e 's|@prefix[@]|$(prefix)|g' \
	 -e 's|@exec_prefix[@]|$(exec_prefix)|g' \
	 -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
	 -e 's|@datadir[@]|$(datadir)|g' \
	 -e 's|@sbindir[@]|$(sbindir)|g' \
	 -e 's|@bindir[@]|$(bindir)|g' \
	 -e 's|@includedir[@]|$(includedir)|g' \
	 -e 's|@localstatedir[@]|$(localstatedir)|g' \
	 -e 's|@usrlib_execdir[@]|$(usrlib_execdir)|g' \
	 -e 's|@usrbin_execdir[@]|$(usrbin_execdir)|g' \
	 -e 's|@usrsbin_execdir[@]|$(usrsbin_execdir)|g' \
	 -e 's|@VERSION[@]|$(VERSION)|g' \
	 -e 's|@LIBUUID_VERSION[@]|$(LIBUUID_VERSION)|g' \
	 -e 's|@LIBMOUNT_VERSION[@]|$(LIBMOUNT_VERSION)|g' \
	 -e 's|@LIBBLKID_VERSION[@]|$(LIBBLKID_VERSION)|g'

CLEANFILES += $(PATHFILES)
EXTRA_DIST += $(PATHFILES:=.in)

$(PATHFILES): Makefile
	@ rm -f $@ $@.tmp
	$(AM_V_GEN) srcdir=''; \
		test -f ./$@.in || srcdir=$(srcdir)/; \
		$(edit_cmd) $${srcdir}$@.in >$@.tmp
	@ mv $@.tmp $@

# Arrange so that .tarball-version appears only in the distribution
# tarball, and never in a checked-out repository.
dist-hook:
	echo $(VERSION) > $(distdir)/.tarball-version
# Set ChangeLog tag reference.
	sed -i "s/log/log;h=$(VERSION)/" $(distdir)/ChangeLog

distclean-local:
	-find . -name \*~ -o -name \*.orig -o -name \*.rej | xargs rm -f
	rm -rf autom4te.cache


checkincludes:
	@find * $(RCS_FIND_IGNORE) \
		-name '*.[hcS]' -type f -print | sort -u \
		| xargs $(top_srcdir)/tools/checkincludes.pl

checkconfig:
	@find * $(RCS_FIND_IGNORE) \
		-name '*.[hcS]' -type f -print | sort -u \
		| xargs $(top_srcdir)/tools/checkconfig.sh $(top_srcdir)

checkmans:
	@$(top_srcdir)/tools/checkmans.sh

checkxalloc:
	@ $(top_srcdir)/tools/checkxalloc.sh

checkdecl:
	@ $(top_srcdir)/tools/checkdecl.sh

ENABLE_ALL = --enable-static-programs --enable-most-builds
DISTCHECK_CONFIGURE_FLAGS = --disable-use-tty-group \
			    --disable-silent-rules $(ENABLE_ALL) \
			    --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
			    --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)


BUILT_SOURCES = .version
.version:
	echo $(VERSION) > $@-t && mv $@-t $@

CHANGELOG_FILE = v$(VERSION)-ChangeLog

$(CHANGELOG_FILE):
	@ if test "x$$PREVIOUS_VERSION" == "x"; then \
		echo "Usage make changelog PREVIOUS_VERSION=<version>"; \
		exit 1; \
	fi
	@ echo "Changes between v$(PREVIOUS_VERSION) and v$(VERSION)" > $(CHANGELOG_FILE)
	@ echo "--------------------------------------------" >> $(CHANGELOG_FILE)
	@ echo >> $(CHANGELOG_FILE)
	$(AM_V_GEN) git log --stat v$(PREVIOUS_VERSION)..HEAD >> $(CHANGELOG_FILE)
#
#
# smatch scan -- smatch and cgcc are expected in $PATH
#
checksmatch:
	$(MAKE) CHECK="smatch --data=$(abs_top_srcdir)/tools/smatch-data" CC=cgcc

changelog: $(CHANGELOG_FILE)

install-exec-hook: $(INSTALL_EXEC_HOOKS)

uninstall-hook: $(UNINSTALL_HOOKS)

install-data-hook: $(INSTALL_DATA_HOOKS)

clean-local: $(CLEAN_LOCALS)

check-local: $(CHECK_LOCALS)