]> git.ipfire.org Git - thirdparty/kmod.git/blame - Makefile.am
TODO: add task to modprobe
[thirdparty/kmod.git] / Makefile.am
CommitLineData
646b83b8
LDM
1SUBDIRS = . libkmod/docs
2
85ece204
LDM
3EXTRA_DIST =
4CLEANFILES =
ecd40ee4
LDM
5ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
6AM_MAKEFLAGS = --no-print-directory
7
8AM_CPPFLAGS = \
9 -include $(top_builddir)/config.h \
586fc304 10 -I$(top_srcdir)/libkmod \
a308abec 11 -DROOTPREFIX=\""$(rootprefix)"\" \
ecd40ee4 12 -DSYSCONFDIR=\""$(sysconfdir)"\" \
7b3a74fc
JE
13 -DLIBEXECDIR=\""$(libexecdir)"\" \
14 ${zlib_CFLAGS}
ecd40ee4
LDM
15
16AM_CFLAGS = \
17 -fvisibility=hidden \
18 -ffunction-sections \
19 -fdata-sections
20
21AM_LDFLAGS = \
22 -Wl,--gc-sections \
23 -Wl,--as-needed
24
9faa7b37
KS
25SED_PROCESS = \
26 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
27 -e 's,@VERSION\@,$(VERSION),g' \
28 -e 's,@prefix\@,$(prefix),g' \
29 -e 's,@exec_prefix\@,$(exec_prefix),g' \
30 -e 's,@libdir\@,$(libdir),g' \
31 -e 's,@includedir\@,$(includedir),g' \
b182f8fb
JE
32 -e 's,@liblzma_CFLAGS\@,${liblzma_CFLAGS},g' \
33 -e 's,@liblzma_LIBS\@,${liblzma_LIBS},g' \
7b3a74fc
JE
34 -e 's,@zlib_CFLAGS\@,${zlib_CFLAGS},g' \
35 -e 's,@zlib_LIBS\@,${zlib_LIBS},g' \
9faa7b37
KS
36 < $< > $@ || rm $@
37
38%.pc: %.pc.in Makefile
39 $(SED_PROCESS)
40
b30a71b8 41LIBKMOD_CURRENT=3
586fc304 42LIBKMOD_REVISION=0
b30a71b8 43LIBKMOD_AGE=2
ecd40ee4 44
529148ea
LDM
45noinst_LTLIBRARIES = libkmod/libkmod-util.la
46libkmod_libkmod_util_la_SOURCES = libkmod/libkmod-hash.c \
6670c633
LDM
47 libkmod/libkmod-hash.h \
48 libkmod/libkmod-array.c \
0c010fae
LDM
49 libkmod/libkmod-array.h \
50 libkmod/libkmod-util.c \
51 libkmod/libkmod-util.h
529148ea 52
586fc304
LDM
53include_HEADERS = libkmod/libkmod.h
54lib_LTLIBRARIES = libkmod/libkmod.la
ecd40ee4 55
586fc304
LDM
56libkmod_libkmod_la_SOURCES =\
57 libkmod/libkmod.h \
58 libkmod/libkmod-private.h \
88e9c12e 59 libkmod/macro.h \
6924e47a 60 libkmod/libkmod.c \
5369797d 61 libkmod/libkmod-list.c \
7c2ab358 62 libkmod/libkmod-config.c \
e8847fd2
LDM
63 libkmod/libkmod-index.c \
64 libkmod/libkmod-index.h \
3d8226ed 65 libkmod/libkmod-module.c \
708624a4
GSB
66 libkmod/libkmod-file.c \
67 libkmod/libkmod-elf.c
ecd40ee4 68
0b22179a
LDM
69noinst_LTLIBRARIES += libkmod/libkmod-private.la
70libkmod_libkmod_private_la_SOURCES = $(libkmod_libkmod_la_SOURCES)
71
586fc304 72EXTRA_DIST += libkmod/libkmod.sym
e269a84c 73EXTRA_DIST += libkmod/COPYING libkmod/README
ecd40ee4 74
586fc304
LDM
75libkmod_libkmod_la_LDFLAGS = $(AM_LDFLAGS) \
76 -version-info $(LIBKMOD_CURRENT):$(LIBKMOD_REVISION):$(LIBKMOD_AGE) \
77 -Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym
529148ea
LDM
78libkmod_libkmod_la_DEPENDENCIES = libkmod/libkmod-util.la \
79 ${top_srcdir}/libkmod/libkmod.sym
80libkmod_libkmod_la_LIBADD = libkmod/libkmod-util.la \
81 ${liblzma_LIBS} ${zlib_LIBS}
ecd40ee4
LDM
82
83pkgconfigdir = $(libdir)/pkgconfig
586fc304 84pkgconfig_DATA = libkmod/libkmod.pc
9faa7b37
KS
85EXTRA_DIST += libkmod/libkmod.pc.in
86CLEANFILES += libkmod/libkmod.pc
ecd40ee4 87
e79bf83b
KS
88install-exec-hook:
89 if test "$(libdir)" != "$(rootlibdir)"; then \
6a4fa8d8 90 $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
e79bf83b
KS
91 so_img_name=$$(readlink $(DESTDIR)$(libdir)/libkmod.so) && \
92 so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
93 ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libkmod.so && \
94 mv $(DESTDIR)$(libdir)/libkmod.so.* $(DESTDIR)$(rootlibdir); \
95 fi
96
97uninstall-hook:
98 rm -f $(DESTDIR)$(rootlibdir)/libkmod.so*
99
72c51a9e 100if BUILD_TOOLS
8d75053e
LDM
101bin_PROGRAMS = tools/kmod
102
00fc926c
LDM
103noinst_SCRIPTS = tools/insmod tools/rmmod tools/lsmod \
104 tools/modprobe tools/modinfo tools/depmod
8900b916 105
f712ebc4 106tools_kmod_SOURCES = tools/kmod.c tools/kmod.h tools/kmod-lsmod.c \
769becb5 107 tools/kmod-rmmod.c tools/kmod-insmod.c \
f6cf14ce
LDM
108 tools/kmod-modinfo.c tools/kmod-modprobe.c \
109 tools/kmod-depmod.c
6fcf69e6 110tools_kmod_CPPFLAGS = $(AM_CPPFLAGS) -DKMOD_BUNDLE_TOOL=1
f6cf14ce
LDM
111tools_kmod_CFLAGS = $(AM_CFLAGS)
112tools_kmod_LDADD = libkmod/libkmod-util.la \
113 libkmod/libkmod.la
00fc926c 114
0b22179a
LDM
115noinst_PROGRAMS = tools/kmod-nolib
116tools_kmod_nolib_SOURCES = $(tools_kmod_SOURCES)
117tools_kmod_nolib_CPPFLAGS = $(tools_kmod_CPPFLAGS)
118tools_kmod_nolib_CFLAGS = $(tools_kmod_CFLAGS)
119tools_kmod_nolib_LDADD = libkmod/libkmod-util.la \
120 libkmod/libkmod-private.la
121
122${noinst_SCRIPTS}: tools/kmod-nolib
00fc926c
LDM
123 $(AM_V_GEN) ($(RM) $@; \
124 $(LN_S) $(notdir $<) $@)
72c51a9e
GSB
125endif
126
043b3f98
LDM
127check_PROGRAMS = test/test-init test/test-loaded \
128 test/test-insmod test/test-rmmod test/test-rmmod2 \
129 test/test-lookup test/test-path-from-name \
130 test/test-get-dependencies test/test-mod-double-ref \
131 test/test-blacklist test/test-elf test/test-probe \
132 test/test-invalidate-config
133
134TESTS = test/test-init test/test-loaded
135
0b22179a
LDM
136test_test_init_LDADD = libkmod/libkmod-private.la
137test_test_loaded_LDADD = libkmod/libkmod-private.la
138
139test_test_rmmod_LDADD = libkmod/libkmod-private.la
140test_test_rmmod2_LDADD = libkmod/libkmod-private.la
141test_test_insmod_LDADD = libkmod/libkmod-private.la
142test_test_lookup_LDADD = libkmod/libkmod-private.la
143test_test_path_from_name_LDADD = libkmod/libkmod-private.la
144test_test_get_dependencies_LDADD = libkmod/libkmod-private.la
145test_test_mod_double_ref_LDADD = libkmod/libkmod-private.la
146test_test_blacklist_LDADD = libkmod/libkmod-private.la
147test_test_elf_LDADD = libkmod/libkmod-private.la
148test_test_probe_LDADD = libkmod/libkmod-private.la
149test_test_invalidate_config_LDADD = libkmod/libkmod-private.la
646b83b8
LDM
150
151DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc