1 SUBDIRS = . libkmod/docs
7 DISTCLEAN_LOCAL_HOOKS =
10 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
11 AM_MAKEFLAGS = --no-print-directory
14 -include $(top_builddir)/config.h \
15 -I$(top_srcdir)/libkmod \
16 -DSYSCONFDIR=\""$(sysconfdir)"\" \
17 -DLIBEXECDIR=\""$(libexecdir)"\" \
20 AM_CFLAGS = $(WARNINGFLAGS)
21 AM_LDFLAGS = $(GCLDFLAGS)
24 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
25 -e 's,@VERSION\@,$(VERSION),g' \
26 -e 's,@prefix\@,$(prefix),g' \
27 -e 's,@exec_prefix\@,$(exec_prefix),g' \
28 -e 's,@libdir\@,$(libdir),g' \
29 -e 's,@includedir\@,$(includedir),g' \
30 -e 's,@liblzma_CFLAGS\@,${liblzma_CFLAGS},g' \
31 -e 's,@liblzma_LIBS\@,${liblzma_LIBS},g' \
32 -e 's,@zlib_CFLAGS\@,${zlib_CFLAGS},g' \
33 -e 's,@zlib_LIBS\@,${zlib_LIBS},g' \
36 %.pc: %.pc.in Makefile
43 noinst_LTLIBRARIES = libkmod/libkmod-util.la
44 libkmod_libkmod_util_la_SOURCES = libkmod/libkmod-hash.c \
45 libkmod/libkmod-hash.h \
46 libkmod/libkmod-array.c \
47 libkmod/libkmod-array.h \
48 libkmod/libkmod-util.c \
49 libkmod/libkmod-util.h
51 include_HEADERS = libkmod/libkmod.h
52 lib_LTLIBRARIES = libkmod/libkmod.la
54 libkmod_libkmod_la_SOURCES =\
56 libkmod/libkmod-internal.h \
60 libkmod/libkmod-list.c \
61 libkmod/libkmod-config.c \
62 libkmod/libkmod-index.c \
63 libkmod/libkmod-index.h \
64 libkmod/libkmod-module.c \
65 libkmod/libkmod-file.c \
66 libkmod/libkmod-elf.c \
67 libkmod/libkmod-signature.c
69 EXTRA_DIST += libkmod/libkmod.sym
70 EXTRA_DIST += libkmod/README libkmod/COPYING testsuite/COPYING COPYING
72 libkmod_libkmod_la_LDFLAGS = $(AM_LDFLAGS) \
73 -version-info $(LIBKMOD_CURRENT):$(LIBKMOD_REVISION):$(LIBKMOD_AGE) \
74 -Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym
75 libkmod_libkmod_la_DEPENDENCIES = libkmod/libkmod-util.la \
76 ${top_srcdir}/libkmod/libkmod.sym
77 libkmod_libkmod_la_LIBADD = libkmod/libkmod-util.la \
78 ${liblzma_LIBS} ${zlib_LIBS}
80 noinst_LTLIBRARIES += libkmod/libkmod-internal.la
81 libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES)
82 libkmod_libkmod_internal_la_LDFLAGS = $(AM_LDFLAGS) \
83 -Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym
84 libkmod_libkmod_internal_la_DEPENDENCIES = $(libkmod_libkmod_la_DEPENDENCIES)
85 libkmod_libkmod_internal_la_LIBADD = $(libkmod_libkmod_la_LIBADD)
87 pkgconfigdir = $(libdir)/pkgconfig
88 pkgconfig_DATA = libkmod/libkmod.pc
89 EXTRA_DIST += libkmod/libkmod.pc.in
90 CLEANFILES += libkmod/libkmod.pc
92 bashcompletiondir=@bashcompletiondir@
93 dist_bashcompletion_DATA = \
94 shell-completion/bash/kmod
97 if test "$(libdir)" != "$(rootlibdir)"; then \
98 $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
99 so_img_name=$$(readlink $(DESTDIR)$(libdir)/libkmod.so) && \
100 so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
101 ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libkmod.so && \
102 mv $(DESTDIR)$(libdir)/libkmod.so.* $(DESTDIR)$(rootlibdir); \
106 rm -f $(DESTDIR)$(rootlibdir)/libkmod.so*
109 bin_PROGRAMS = tools/kmod
111 noinst_SCRIPTS = tools/insmod tools/rmmod tools/lsmod \
112 tools/modprobe tools/modinfo tools/depmod
114 tools_kmod_SOURCES = tools/kmod.c tools/kmod.h tools/lsmod.c \
115 tools/rmmod.c tools/insmod.c \
116 tools/modinfo.c tools/modprobe.c \
117 tools/depmod.c tools/log.h tools/log.c \
119 tools_kmod_LDADD = libkmod/libkmod-util.la \
120 libkmod/libkmod-internal.la
122 ${noinst_SCRIPTS}: tools/kmod
123 $(AM_V_GEN) ($(RM) $@; \
124 $(LN_S) $(notdir $<) $@)
127 # ------------------------------------------------------------------------------
129 # ------------------------------------------------------------------------------
131 ROOTFS = testsuite/rootfs
132 ROOTFS_PRISTINE = $(top_srcdir)/testsuite/rootfs-pristine
133 CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && \
134 cp -r $(ROOTFS_PRISTINE) $(ROOTFS) && \
135 touch testsuite/stamp-rootfs && \
136 find $(ROOTFS) -type d -exec chmod +w {} \; )
142 $(ROOTFS): $(ROOTFS_PRISTINE)
145 TESTSUITE_OVERRIDE_LIBS = testsuite/uname.la testsuite/path.la \
146 testsuite/init_module.la \
147 testsuite/delete_module.la
148 TESTSUITE_OVERRIDE_LIBS_LDFLAGS = avoid-version -module -shared -export-dynamic \
153 check_LTLIBRARIES = $(TESTSUITE_OVERRIDE_LIBS)
155 testsuite_uname_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS)
156 testsuite_path_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS)
158 testsuite_delete_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS)
159 testsuite_init_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS)
160 testsuite_init_module_la_SOURCES = testsuite/init_module.c \
161 testsuite/stripped-module.h
162 testsuite_init_module_la_LIBADD = libkmod/libkmod-internal.la
164 TESTSUITE_CPPFLAGS = $(AM_CPPFLAGS) \
165 -DTESTSUITE_ROOTFS=\"$(abs_top_builddir)/$(ROOTFS)/\" \
166 -DABS_TOP_BUILDDIR=\"$(abs_top_builddir)\"
167 TESTSUITE_LDADD = testsuite/libtestsuite.la libkmod/libkmod-internal.la \
168 libkmod/libkmod-util.la
170 check_LTLIBRARIES += testsuite/libtestsuite.la
171 testsuite_libtestsuite_la_SOURCES = testsuite/testsuite.c \
172 testsuite/testsuite.h
173 testsuite_libtestsuite_la_DEPENDENCIES = $(ROOTFS) \
174 $(TESTSUITE_OVERRIDE_LIBS)
175 testsuite_libtestsuite_la_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
176 testsuite_libtestsuite_la_LIBADD = -lrt
178 TESTSUITE = testsuite/test-init testsuite/test-testsuite testsuite/test-loaded \
179 testsuite/test-modinfo testsuite/test-alias testsuite/test-new-module \
180 testsuite/test-modprobe testsuite/test-blacklist \
181 testsuite/test-dependencies testsuite/test-depmod
183 check_PROGRAMS = $(TESTSUITE)
186 testsuite_test_testsuite_LDADD = testsuite/libtestsuite.la libkmod/libkmod-util.la
187 testsuite_test_testsuite_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
188 testsuite_test_init_LDADD = $(TESTSUITE_LDADD)
189 testsuite_test_init_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
190 testsuite_test_loaded_LDADD = $(TESTSUITE_LDADD)
191 testsuite_test_loaded_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
192 testsuite_test_modinfo_LDADD = $(TESTSUITE_LDADD)
193 testsuite_test_modinfo_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
194 testsuite_test_alias_LDADD = $(TESTSUITE_LDADD)
195 testsuite_test_alias_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
196 testsuite_test_new_module_LDADD = $(TESTSUITE_LDADD)
197 testsuite_test_new_module_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
198 testsuite_test_modprobe_LDADD = $(TESTSUITE_LDADD)
199 testsuite_test_modprobe_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
200 testsuite_test_blacklist_LDADD = $(TESTSUITE_LDADD)
201 testsuite_test_blacklist_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
202 testsuite_test_dependencies_LDADD = $(TESTSUITE_LDADD)
203 testsuite_test_dependencies_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
204 testsuite_test_depmod_LDADD = $(TESTSUITE_LDADD)
205 testsuite_test_depmod_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
209 $(RM) testsuite/stamp-rootfs
211 DISTCLEAN_LOCAL_HOOKS += testsuite-distclean
212 EXTRA_DIST += testsuite/rootfs-pristine
214 DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --sysconfdir=/etc --with-zlib \
215 --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir)
217 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
220 $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS)
222 # ------------------------------------------------------------------------------
223 # custom release helpers
224 # ------------------------------------------------------------------------------
227 head -1 NEWS | grep -q "kmod $(VERSION)"
228 git commit -a -m "kmod $(VERSION)"
229 git tag -m "kmod $(VERSION)" -s v$(VERSION)
232 kmod-$(VERSION).tar.xz:
235 kmod-$(VERSION).tar.sign:
236 xz -d -c kmod-$(VERSION).tar.xz | gpg --armor --detach-sign --output kmod-$(VERSION).tar.sign
238 tar: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign
240 tar-sync: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign
241 kup put kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign /pub/linux/utils/kernel/kmod/