3 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
4 AM_MAKEFLAGS = --no-print-directory
7 -include $(top_builddir)/config.h \
8 -I$(top_srcdir)/libkmod \
9 -DROOTPREFIX=\""$(rootprefix)"\" \
10 -DSYSCONFDIR=\""$(sysconfdir)"\" \
11 -DLIBEXECDIR=\""$(libexecdir)"\" \
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-private.h \
59 libkmod/libkmod-list.c \
60 libkmod/libkmod-config.c \
61 libkmod/libkmod-index.c \
62 libkmod/libkmod-index.h \
63 libkmod/libkmod-module.c \
64 libkmod/libkmod-file.c \
67 EXTRA_DIST += libkmod/libkmod.sym
68 EXTRA_DIST += libkmod/COPYING libkmod/README
70 libkmod_libkmod_la_LDFLAGS = $(AM_LDFLAGS) \
71 -version-info $(LIBKMOD_CURRENT):$(LIBKMOD_REVISION):$(LIBKMOD_AGE) \
72 -Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym
73 libkmod_libkmod_la_DEPENDENCIES = libkmod/libkmod-util.la \
74 ${top_srcdir}/libkmod/libkmod.sym
75 libkmod_libkmod_la_LIBADD = libkmod/libkmod-util.la \
76 ${liblzma_LIBS} ${zlib_LIBS}
78 pkgconfigdir = $(libdir)/pkgconfig
79 pkgconfig_DATA = libkmod/libkmod.pc
80 EXTRA_DIST += libkmod/libkmod.pc.in
81 CLEANFILES += libkmod/libkmod.pc
84 if test "$(libdir)" != "$(rootlibdir)"; then \
85 $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
86 so_img_name=$$(readlink $(DESTDIR)$(libdir)/libkmod.so) && \
87 so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
88 ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libkmod.so && \
89 mv $(DESTDIR)$(libdir)/libkmod.so.* $(DESTDIR)$(rootlibdir); \
93 rm -f $(DESTDIR)$(rootlibdir)/libkmod.so*
98 bin_PROGRAMS = tools/kmod
100 noinst_PROGRAMS += tools/kmod-insmod tools/kmod-rmmod tools/kmod-lsmod \
101 tools/kmod-modprobe tools/kmod-modinfo tools/kmod-depmod
103 tools_kmod_insmod_LDADD = libkmod/libkmod.la
104 tools_kmod_rmmod_LDADD = libkmod/libkmod.la
105 tools_kmod_lsmod_LDADD = libkmod/libkmod.la
106 tools_kmod_modprobe_LDADD = libkmod/libkmod.la
107 tools_kmod_modinfo_LDADD = libkmod/libkmod.la
109 tools_kmod_depmod_LDADD = libkmod/libkmod-util.la \
111 tools_kmod_depmod_CFLAGS = $(AM_CFLAGS)
112 tools_kmod_depmod_CPPFLAGS = $(AM_CPPFLAGS)
113 tools_kmod_depmod_LDFLAGS = $(AM_LDFLAGS)
115 tools_kmod_SOURCES = tools/kmod.c tools/kmod.h tools/kmod-lsmod.c \
116 tools/kmod-rmmod.c tools/kmod-insmod.c \
117 tools/kmod-modinfo.c tools/kmod-modprobe.c \
119 tools_kmod_CPPFLAGS = $(AM_CPPFLAGS) -DKMOD_BUNDLE_TOOL=1
120 tools_kmod_CFLAGS = $(AM_CFLAGS)
121 tools_kmod_LDADD = libkmod/libkmod-util.la \
125 check_PROGRAMS = test/test-init test/test-loaded
126 test_test_init_LDADD = libkmod/libkmod.la
127 test_test_loaded_LDADD = libkmod/libkmod.la
129 noinst_PROGRAMS += test/test-insmod test/test-rmmod test/test-rmmod2 \
130 test/test-lookup test/test-path-from-name \
131 test/test-get-dependencies test/test-mod-double-ref \
132 test/test-blacklist test/test-elf test/test-probe \
133 test/test-invalidate-config \
136 test_test_rmmod_LDADD = libkmod/libkmod.la
137 test_test_rmmod2_LDADD = libkmod/libkmod.la
138 test_test_insmod_LDADD = libkmod/libkmod.la
139 test_test_lookup_LDADD = libkmod/libkmod.la
140 test_test_path_from_name_LDADD = libkmod/libkmod.la
141 test_test_get_dependencies_LDADD = libkmod/libkmod.la
142 test_test_mod_double_ref_LDADD = libkmod/libkmod.la
143 test_test_blacklist_LDADD = libkmod/libkmod.la
144 test_test_elf_LDADD = libkmod/libkmod.la
145 test_test_probe_LDADD = libkmod/libkmod.la
146 test_test_invalidate_config_LDADD = libkmod/libkmod.la