2012-07-30 23:27:10 +07:00
|
|
|
SUBDIRS = . libkmod/docs
|
|
|
|
|
|
|
|
if BUILD_MANPAGES
|
|
|
|
SUBDIRS += man
|
|
|
|
endif
|
2012-01-09 13:20:55 +07:00
|
|
|
|
2012-01-25 11:44:45 +07:00
|
|
|
DISTCLEAN_LOCAL_HOOKS =
|
2011-12-03 02:53:54 +07:00
|
|
|
EXTRA_DIST =
|
|
|
|
CLEANFILES =
|
2011-11-21 21:35:15 +07:00
|
|
|
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
|
|
|
AM_MAKEFLAGS = --no-print-directory
|
|
|
|
|
|
|
|
AM_CPPFLAGS = \
|
|
|
|
-include $(top_builddir)/config.h \
|
2011-11-21 23:35:35 +07:00
|
|
|
-I$(top_srcdir)/libkmod \
|
2011-11-21 21:35:15 +07:00
|
|
|
-DSYSCONFDIR=\""$(sysconfdir)"\" \
|
2011-12-24 10:45:22 +07:00
|
|
|
-DLIBEXECDIR=\""$(libexecdir)"\" \
|
|
|
|
${zlib_CFLAGS}
|
2011-11-21 21:35:15 +07:00
|
|
|
|
2012-03-18 01:12:44 +07:00
|
|
|
AM_CFLAGS = $(WARNINGFLAGS)
|
|
|
|
AM_LDFLAGS = $(GCLDFLAGS)
|
2011-11-21 21:35:15 +07:00
|
|
|
|
2011-12-21 20:48:07 +07:00
|
|
|
SED_PROCESS = \
|
|
|
|
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
|
|
|
|
-e 's,@VERSION\@,$(VERSION),g' \
|
|
|
|
-e 's,@prefix\@,$(prefix),g' \
|
|
|
|
-e 's,@exec_prefix\@,$(exec_prefix),g' \
|
|
|
|
-e 's,@libdir\@,$(libdir),g' \
|
|
|
|
-e 's,@includedir\@,$(includedir),g' \
|
2011-12-24 20:58:30 +07:00
|
|
|
-e 's,@liblzma_CFLAGS\@,${liblzma_CFLAGS},g' \
|
|
|
|
-e 's,@liblzma_LIBS\@,${liblzma_LIBS},g' \
|
2011-12-24 10:45:22 +07:00
|
|
|
-e 's,@zlib_CFLAGS\@,${zlib_CFLAGS},g' \
|
|
|
|
-e 's,@zlib_LIBS\@,${zlib_LIBS},g' \
|
2011-12-21 20:48:07 +07:00
|
|
|
< $< > $@ || rm $@
|
|
|
|
|
|
|
|
%.pc: %.pc.in Makefile
|
|
|
|
$(SED_PROCESS)
|
|
|
|
|
2012-09-07 02:26:53 +07:00
|
|
|
LIBKMOD_CURRENT=4
|
2013-12-23 04:45:19 +07:00
|
|
|
LIBKMOD_REVISION=6
|
2012-09-07 02:26:53 +07:00
|
|
|
LIBKMOD_AGE=2
|
2011-11-21 21:35:15 +07:00
|
|
|
|
2011-12-27 21:26:51 +07:00
|
|
|
noinst_LTLIBRARIES = libkmod/libkmod-util.la
|
|
|
|
libkmod_libkmod_util_la_SOURCES = libkmod/libkmod-hash.c \
|
2011-12-28 21:53:37 +07:00
|
|
|
libkmod/libkmod-hash.h \
|
|
|
|
libkmod/libkmod-array.c \
|
2011-12-28 22:33:26 +07:00
|
|
|
libkmod/libkmod-array.h \
|
|
|
|
libkmod/libkmod-util.c \
|
|
|
|
libkmod/libkmod-util.h
|
2011-12-27 21:26:51 +07:00
|
|
|
|
2011-11-21 23:35:35 +07:00
|
|
|
include_HEADERS = libkmod/libkmod.h
|
|
|
|
lib_LTLIBRARIES = libkmod/libkmod.la
|
2011-11-21 21:35:15 +07:00
|
|
|
|
2011-11-21 23:35:35 +07:00
|
|
|
libkmod_libkmod_la_SOURCES =\
|
|
|
|
libkmod/libkmod.h \
|
2013-07-05 02:13:11 +07:00
|
|
|
libkmod/libkmod-internal.h \
|
2011-11-23 21:23:46 +07:00
|
|
|
libkmod/macro.h \
|
2013-04-09 14:00:20 +07:00
|
|
|
libkmod/missing.h \
|
2011-11-22 14:38:28 +07:00
|
|
|
libkmod/libkmod.c \
|
2011-11-22 14:42:09 +07:00
|
|
|
libkmod/libkmod-list.c \
|
2011-11-30 03:07:43 +07:00
|
|
|
libkmod/libkmod-config.c \
|
2011-12-01 00:23:28 +07:00
|
|
|
libkmod/libkmod-index.c \
|
|
|
|
libkmod/libkmod-index.h \
|
2011-12-17 01:08:53 +07:00
|
|
|
libkmod/libkmod-module.c \
|
2011-12-18 10:25:06 +07:00
|
|
|
libkmod/libkmod-file.c \
|
2013-01-16 15:52:01 +07:00
|
|
|
libkmod/libkmod-elf.c \
|
|
|
|
libkmod/libkmod-signature.c
|
2011-11-21 21:35:15 +07:00
|
|
|
|
2011-11-21 23:35:35 +07:00
|
|
|
EXTRA_DIST += libkmod/libkmod.sym
|
2012-07-10 19:42:24 +07:00
|
|
|
EXTRA_DIST += libkmod/README libkmod/COPYING testsuite/COPYING COPYING
|
2011-11-21 21:35:15 +07:00
|
|
|
|
2011-11-21 23:35:35 +07:00
|
|
|
libkmod_libkmod_la_LDFLAGS = $(AM_LDFLAGS) \
|
|
|
|
-version-info $(LIBKMOD_CURRENT):$(LIBKMOD_REVISION):$(LIBKMOD_AGE) \
|
|
|
|
-Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym
|
2011-12-27 21:26:51 +07:00
|
|
|
libkmod_libkmod_la_DEPENDENCIES = libkmod/libkmod-util.la \
|
|
|
|
${top_srcdir}/libkmod/libkmod.sym
|
|
|
|
libkmod_libkmod_la_LIBADD = libkmod/libkmod-util.la \
|
|
|
|
${liblzma_LIBS} ${zlib_LIBS}
|
2011-11-21 21:35:15 +07:00
|
|
|
|
2013-07-05 02:13:11 +07:00
|
|
|
noinst_LTLIBRARIES += libkmod/libkmod-internal.la
|
|
|
|
libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES)
|
|
|
|
libkmod_libkmod_internal_la_LDFLAGS = $(AM_LDFLAGS) \
|
2012-01-11 01:22:59 +07:00
|
|
|
-Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym
|
2013-07-05 02:13:11 +07:00
|
|
|
libkmod_libkmod_internal_la_DEPENDENCIES = $(libkmod_libkmod_la_DEPENDENCIES)
|
|
|
|
libkmod_libkmod_internal_la_LIBADD = $(libkmod_libkmod_la_LIBADD)
|
2012-01-11 01:22:59 +07:00
|
|
|
|
2011-11-21 21:35:15 +07:00
|
|
|
pkgconfigdir = $(libdir)/pkgconfig
|
2011-11-21 23:35:35 +07:00
|
|
|
pkgconfig_DATA = libkmod/libkmod.pc
|
2011-12-21 20:48:07 +07:00
|
|
|
EXTRA_DIST += libkmod/libkmod.pc.in
|
|
|
|
CLEANFILES += libkmod/libkmod.pc
|
2011-11-21 21:35:15 +07:00
|
|
|
|
2013-07-30 13:47:19 +07:00
|
|
|
bashcompletiondir=@bashcompletiondir@
|
|
|
|
dist_bashcompletion_DATA = \
|
|
|
|
shell-completion/bash/kmod
|
|
|
|
|
2011-12-22 21:40:24 +07:00
|
|
|
install-exec-hook:
|
|
|
|
if test "$(libdir)" != "$(rootlibdir)"; then \
|
2011-12-23 10:59:31 +07:00
|
|
|
$(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
|
2011-12-22 21:40:24 +07:00
|
|
|
so_img_name=$$(readlink $(DESTDIR)$(libdir)/libkmod.so) && \
|
|
|
|
so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
|
|
|
|
ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libkmod.so && \
|
|
|
|
mv $(DESTDIR)$(libdir)/libkmod.so.* $(DESTDIR)$(rootlibdir); \
|
|
|
|
fi
|
|
|
|
|
|
|
|
uninstall-hook:
|
|
|
|
rm -f $(DESTDIR)$(rootlibdir)/libkmod.so*
|
|
|
|
|
2011-12-11 07:19:41 +07:00
|
|
|
if BUILD_TOOLS
|
2012-01-04 17:58:19 +07:00
|
|
|
bin_PROGRAMS = tools/kmod
|
|
|
|
|
2013-07-05 02:01:55 +07:00
|
|
|
noinst_SCRIPTS = tools/insmod tools/rmmod tools/lsmod \
|
|
|
|
tools/modprobe tools/modinfo tools/depmod
|
2011-12-22 11:33:36 +07:00
|
|
|
|
2012-06-15 02:29:28 +07:00
|
|
|
tools_kmod_SOURCES = tools/kmod.c tools/kmod.h tools/lsmod.c \
|
|
|
|
tools/rmmod.c tools/insmod.c \
|
|
|
|
tools/modinfo.c tools/modprobe.c \
|
2013-04-17 03:39:55 +07:00
|
|
|
tools/depmod.c tools/log.h tools/log.c \
|
|
|
|
tools/static-nodes.c
|
2011-12-28 04:56:33 +07:00
|
|
|
tools_kmod_LDADD = libkmod/libkmod-util.la \
|
2013-07-05 02:13:11 +07:00
|
|
|
libkmod/libkmod-internal.la
|
2012-01-10 20:15:19 +07:00
|
|
|
|
2013-07-05 02:01:55 +07:00
|
|
|
${noinst_SCRIPTS}: tools/kmod
|
2012-01-10 20:15:19 +07:00
|
|
|
$(AM_V_GEN) ($(RM) $@; \
|
|
|
|
$(LN_S) $(notdir $<) $@)
|
2011-12-11 07:19:41 +07:00
|
|
|
endif
|
|
|
|
|
2012-01-25 11:44:45 +07:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# TESTSUITE
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
2012-05-24 09:04:44 +07:00
|
|
|
ROOTFS = testsuite/rootfs
|
2012-05-24 11:31:36 +07:00
|
|
|
ROOTFS_PRISTINE = $(top_srcdir)/testsuite/rootfs-pristine
|
2013-10-10 13:49:48 +07:00
|
|
|
CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(dir $(ROOTFS)) && \
|
2012-05-24 11:31:36 +07:00
|
|
|
cp -r $(ROOTFS_PRISTINE) $(ROOTFS) && \
|
2012-06-19 23:09:23 +07:00
|
|
|
touch testsuite/stamp-rootfs && \
|
|
|
|
find $(ROOTFS) -type d -exec chmod +w {} \; )
|
2012-05-24 09:04:44 +07:00
|
|
|
|
2012-09-08 22:50:56 +07:00
|
|
|
rootfs:
|
2012-05-24 11:31:36 +07:00
|
|
|
$(CREATE_ROOTFS)
|
2012-06-28 22:16:36 +07:00
|
|
|
.PHONY: rootfs
|
2012-05-24 11:31:36 +07:00
|
|
|
|
|
|
|
$(ROOTFS): $(ROOTFS_PRISTINE)
|
|
|
|
$(CREATE_ROOTFS)
|
2012-05-11 10:04:59 +07:00
|
|
|
|
2012-01-26 21:18:23 +07:00
|
|
|
TESTSUITE_OVERRIDE_LIBS = testsuite/uname.la testsuite/path.la \
|
2012-01-27 01:10:41 +07:00
|
|
|
testsuite/init_module.la \
|
|
|
|
testsuite/delete_module.la
|
2012-01-26 21:18:23 +07:00
|
|
|
TESTSUITE_OVERRIDE_LIBS_LDFLAGS = avoid-version -module -shared -export-dynamic \
|
|
|
|
-rpath /nowhere -ldl
|
2012-01-25 07:04:46 +07:00
|
|
|
|
2012-09-09 01:08:50 +07:00
|
|
|
check-am: rootfs
|
2012-06-28 22:16:36 +07:00
|
|
|
|
2012-01-26 21:18:23 +07:00
|
|
|
check_LTLIBRARIES = $(TESTSUITE_OVERRIDE_LIBS)
|
2012-01-25 07:04:46 +07:00
|
|
|
|
2012-01-26 21:18:23 +07:00
|
|
|
testsuite_uname_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS)
|
|
|
|
testsuite_path_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS)
|
2012-01-25 11:44:45 +07:00
|
|
|
|
2012-01-27 01:10:41 +07:00
|
|
|
testsuite_delete_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS)
|
2012-01-26 21:18:23 +07:00
|
|
|
testsuite_init_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS)
|
|
|
|
testsuite_init_module_la_SOURCES = testsuite/init_module.c \
|
2012-01-30 01:09:59 +07:00
|
|
|
testsuite/stripped-module.h
|
2013-07-05 02:13:11 +07:00
|
|
|
testsuite_init_module_la_LIBADD = libkmod/libkmod-internal.la
|
2012-01-25 11:44:45 +07:00
|
|
|
|
2012-01-26 00:13:45 +07:00
|
|
|
TESTSUITE_CPPFLAGS = $(AM_CPPFLAGS) \
|
2012-05-24 09:04:44 +07:00
|
|
|
-DTESTSUITE_ROOTFS=\"$(abs_top_builddir)/$(ROOTFS)/\" \
|
2012-01-26 00:13:45 +07:00
|
|
|
-DABS_TOP_BUILDDIR=\"$(abs_top_builddir)\"
|
2013-07-05 02:13:11 +07:00
|
|
|
TESTSUITE_LDADD = testsuite/libtestsuite.la libkmod/libkmod-internal.la \
|
2012-05-24 11:31:36 +07:00
|
|
|
libkmod/libkmod-util.la
|
2012-01-26 00:13:45 +07:00
|
|
|
|
2012-01-26 21:18:23 +07:00
|
|
|
check_LTLIBRARIES += testsuite/libtestsuite.la
|
2012-01-25 05:59:54 +07:00
|
|
|
testsuite_libtestsuite_la_SOURCES = testsuite/testsuite.c \
|
|
|
|
testsuite/testsuite.h
|
2012-05-24 09:04:44 +07:00
|
|
|
testsuite_libtestsuite_la_DEPENDENCIES = $(ROOTFS) \
|
|
|
|
$(TESTSUITE_OVERRIDE_LIBS)
|
2012-01-26 00:13:45 +07:00
|
|
|
testsuite_libtestsuite_la_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-06-06 11:03:15 +07:00
|
|
|
testsuite_libtestsuite_la_LIBADD = -lrt
|
2012-01-09 13:20:55 +07:00
|
|
|
|
2012-01-26 05:32:48 +07:00
|
|
|
TESTSUITE = testsuite/test-init testsuite/test-testsuite testsuite/test-loaded \
|
2013-11-18 13:32:45 +07:00
|
|
|
testsuite/test-modinfo testsuite/test-util testsuite/test-new-module \
|
2012-10-04 11:08:13 +07:00
|
|
|
testsuite/test-modprobe testsuite/test-blacklist \
|
|
|
|
testsuite/test-dependencies testsuite/test-depmod
|
|
|
|
|
2012-01-25 06:53:27 +07:00
|
|
|
check_PROGRAMS = $(TESTSUITE)
|
|
|
|
TESTS = $(TESTSUITE)
|
|
|
|
|
2012-05-24 11:31:36 +07:00
|
|
|
testsuite_test_testsuite_LDADD = testsuite/libtestsuite.la libkmod/libkmod-util.la
|
2012-01-26 00:13:45 +07:00
|
|
|
testsuite_test_testsuite_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-02-04 09:29:09 +07:00
|
|
|
testsuite_test_init_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
testsuite_test_init_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
|
|
|
testsuite_test_loaded_LDADD = $(TESTSUITE_LDADD)
|
2012-01-26 03:16:45 +07:00
|
|
|
testsuite_test_loaded_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-02-04 09:29:09 +07:00
|
|
|
testsuite_test_modinfo_LDADD = $(TESTSUITE_LDADD)
|
2012-01-26 05:32:48 +07:00
|
|
|
testsuite_test_modinfo_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2013-11-18 13:32:45 +07:00
|
|
|
testsuite_test_util_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
testsuite_test_util_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-02-04 09:29:09 +07:00
|
|
|
testsuite_test_new_module_LDADD = $(TESTSUITE_LDADD)
|
2012-01-30 00:43:19 +07:00
|
|
|
testsuite_test_new_module_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-02-08 10:40:00 +07:00
|
|
|
testsuite_test_modprobe_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
testsuite_test_modprobe_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-02-23 12:56:58 +07:00
|
|
|
testsuite_test_blacklist_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
testsuite_test_blacklist_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-02-23 12:56:59 +07:00
|
|
|
testsuite_test_dependencies_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
testsuite_test_dependencies_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-10-04 11:08:13 +07:00
|
|
|
testsuite_test_depmod_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
testsuite_test_depmod_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-01-25 06:53:27 +07:00
|
|
|
|
2012-05-11 10:04:59 +07:00
|
|
|
testsuite-distclean:
|
2012-09-08 22:43:54 +07:00
|
|
|
$(RM) -r $(ROOTFS)
|
|
|
|
$(RM) testsuite/stamp-rootfs
|
2012-05-11 10:04:59 +07:00
|
|
|
|
|
|
|
DISTCLEAN_LOCAL_HOOKS += testsuite-distclean
|
2012-05-24 09:04:44 +07:00
|
|
|
EXTRA_DIST += testsuite/rootfs-pristine
|
2012-05-11 09:42:41 +07:00
|
|
|
|
2013-07-30 13:47:19 +07:00
|
|
|
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --sysconfdir=/etc --with-zlib \
|
|
|
|
--with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir)
|
2012-01-16 09:42:28 +07:00
|
|
|
|
2012-01-25 11:44:45 +07:00
|
|
|
distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
|
2012-01-16 09:42:28 +07:00
|
|
|
|
2013-10-10 08:09:52 +07:00
|
|
|
buildtest-TESTS:
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS)
|
|
|
|
|
2012-01-16 09:42:28 +07:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# custom release helpers
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
git-release:
|
|
|
|
head -1 NEWS | grep -q "kmod $(VERSION)"
|
|
|
|
git commit -a -m "kmod $(VERSION)"
|
|
|
|
git tag -m "kmod $(VERSION)" -s v$(VERSION)
|
|
|
|
git gc --prune=0
|
|
|
|
|
|
|
|
kmod-$(VERSION).tar.xz:
|
|
|
|
make distcheck
|
|
|
|
|
|
|
|
kmod-$(VERSION).tar.sign:
|
|
|
|
xz -d -c kmod-$(VERSION).tar.xz | gpg --armor --detach-sign --output kmod-$(VERSION).tar.sign
|
|
|
|
|
|
|
|
tar: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign
|
|
|
|
|
|
|
|
tar-sync: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign
|
2012-02-24 10:58:20 +07:00
|
|
|
kup put kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign /pub/linux/utils/kernel/kmod/
|