Lucas De Marchi | 904b57d | 2012-01-12 11:48:21 -0200 | [diff] [blame] | 1 | SUBDIRS = . libkmod/docs man |
Lucas De Marchi | 646b83b | 2012-01-09 04:20:55 -0200 | [diff] [blame] | 2 | |
Lucas De Marchi | 6afc9cd | 2012-01-25 02:44:45 -0200 | [diff] [blame] | 3 | DISTCLEAN_LOCAL_HOOKS = |
Lucas De Marchi | 85ece20 | 2011-12-02 17:53:54 -0200 | [diff] [blame] | 4 | EXTRA_DIST = |
| 5 | CLEANFILES = |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 6 | ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} |
| 7 | AM_MAKEFLAGS = --no-print-directory |
| 8 | |
| 9 | AM_CPPFLAGS = \ |
| 10 | -include $(top_builddir)/config.h \ |
Lucas De Marchi | 586fc30 | 2011-11-21 14:35:35 -0200 | [diff] [blame] | 11 | -I$(top_srcdir)/libkmod \ |
Kay Sievers | a308abe | 2011-12-20 17:58:05 +0100 | [diff] [blame] | 12 | -DROOTPREFIX=\""$(rootprefix)"\" \ |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 13 | -DSYSCONFDIR=\""$(sysconfdir)"\" \ |
Jan Engelhardt | 7b3a74f | 2011-12-24 04:45:22 +0100 | [diff] [blame] | 14 | -DLIBEXECDIR=\""$(libexecdir)"\" \ |
| 15 | ${zlib_CFLAGS} |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 16 | |
| 17 | AM_CFLAGS = \ |
| 18 | -fvisibility=hidden \ |
| 19 | -ffunction-sections \ |
| 20 | -fdata-sections |
| 21 | |
| 22 | AM_LDFLAGS = \ |
| 23 | -Wl,--gc-sections \ |
| 24 | -Wl,--as-needed |
| 25 | |
Kay Sievers | 9faa7b3 | 2011-12-21 11:48:07 -0200 | [diff] [blame] | 26 | SED_PROCESS = \ |
| 27 | $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \ |
| 28 | -e 's,@VERSION\@,$(VERSION),g' \ |
| 29 | -e 's,@prefix\@,$(prefix),g' \ |
| 30 | -e 's,@exec_prefix\@,$(exec_prefix),g' \ |
| 31 | -e 's,@libdir\@,$(libdir),g' \ |
| 32 | -e 's,@includedir\@,$(includedir),g' \ |
Jan Engelhardt | b182f8f | 2011-12-24 14:58:30 +0100 | [diff] [blame] | 33 | -e 's,@liblzma_CFLAGS\@,${liblzma_CFLAGS},g' \ |
| 34 | -e 's,@liblzma_LIBS\@,${liblzma_LIBS},g' \ |
Jan Engelhardt | 7b3a74f | 2011-12-24 04:45:22 +0100 | [diff] [blame] | 35 | -e 's,@zlib_CFLAGS\@,${zlib_CFLAGS},g' \ |
| 36 | -e 's,@zlib_LIBS\@,${zlib_LIBS},g' \ |
Kay Sievers | 9faa7b3 | 2011-12-21 11:48:07 -0200 | [diff] [blame] | 37 | < $< > $@ || rm $@ |
| 38 | |
| 39 | %.pc: %.pc.in Makefile |
| 40 | $(SED_PROCESS) |
| 41 | |
Lucas De Marchi | b53b7e3 | 2012-01-16 16:53:04 -0200 | [diff] [blame] | 42 | LIBKMOD_CURRENT=4 |
Lucas De Marchi | 586fc30 | 2011-11-21 14:35:35 -0200 | [diff] [blame] | 43 | LIBKMOD_REVISION=0 |
Lucas De Marchi | b53b7e3 | 2012-01-16 16:53:04 -0200 | [diff] [blame] | 44 | LIBKMOD_AGE=3 |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 45 | |
Lucas De Marchi | 529148e | 2011-12-27 12:26:51 -0200 | [diff] [blame] | 46 | noinst_LTLIBRARIES = libkmod/libkmod-util.la |
| 47 | libkmod_libkmod_util_la_SOURCES = libkmod/libkmod-hash.c \ |
Lucas De Marchi | 6670c63 | 2011-12-28 12:53:37 -0200 | [diff] [blame] | 48 | libkmod/libkmod-hash.h \ |
| 49 | libkmod/libkmod-array.c \ |
Lucas De Marchi | 0c010fa | 2011-12-28 13:33:26 -0200 | [diff] [blame] | 50 | libkmod/libkmod-array.h \ |
| 51 | libkmod/libkmod-util.c \ |
| 52 | libkmod/libkmod-util.h |
Lucas De Marchi | 529148e | 2011-12-27 12:26:51 -0200 | [diff] [blame] | 53 | |
Lucas De Marchi | 586fc30 | 2011-11-21 14:35:35 -0200 | [diff] [blame] | 54 | include_HEADERS = libkmod/libkmod.h |
| 55 | lib_LTLIBRARIES = libkmod/libkmod.la |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 56 | |
Lucas De Marchi | 586fc30 | 2011-11-21 14:35:35 -0200 | [diff] [blame] | 57 | libkmod_libkmod_la_SOURCES =\ |
| 58 | libkmod/libkmod.h \ |
| 59 | libkmod/libkmod-private.h \ |
Lucas De Marchi | 88e9c12 | 2011-11-23 12:23:46 -0200 | [diff] [blame] | 60 | libkmod/macro.h \ |
Lucas De Marchi | 6924e47 | 2011-11-22 05:38:28 -0200 | [diff] [blame] | 61 | libkmod/libkmod.c \ |
Lucas De Marchi | 5369797 | 2011-11-22 05:42:09 -0200 | [diff] [blame] | 62 | libkmod/libkmod-list.c \ |
Lucas De Marchi | 7c2ab35 | 2011-11-29 18:07:43 -0200 | [diff] [blame] | 63 | libkmod/libkmod-config.c \ |
Lucas De Marchi | e8847fd | 2011-11-30 15:23:28 -0200 | [diff] [blame] | 64 | libkmod/libkmod-index.c \ |
| 65 | libkmod/libkmod-index.h \ |
Gustavo Sverzut Barbieri | 3d8226e | 2011-12-16 16:08:53 -0200 | [diff] [blame] | 66 | libkmod/libkmod-module.c \ |
Gustavo Sverzut Barbieri | 708624a | 2011-12-18 01:25:06 -0200 | [diff] [blame] | 67 | libkmod/libkmod-file.c \ |
| 68 | libkmod/libkmod-elf.c |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 69 | |
Lucas De Marchi | 586fc30 | 2011-11-21 14:35:35 -0200 | [diff] [blame] | 70 | EXTRA_DIST += libkmod/libkmod.sym |
Lucas De Marchi | e269a84 | 2011-12-15 15:37:41 -0200 | [diff] [blame] | 71 | EXTRA_DIST += libkmod/COPYING libkmod/README |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 72 | |
Lucas De Marchi | 586fc30 | 2011-11-21 14:35:35 -0200 | [diff] [blame] | 73 | libkmod_libkmod_la_LDFLAGS = $(AM_LDFLAGS) \ |
| 74 | -version-info $(LIBKMOD_CURRENT):$(LIBKMOD_REVISION):$(LIBKMOD_AGE) \ |
| 75 | -Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym |
Lucas De Marchi | 529148e | 2011-12-27 12:26:51 -0200 | [diff] [blame] | 76 | libkmod_libkmod_la_DEPENDENCIES = libkmod/libkmod-util.la \ |
| 77 | ${top_srcdir}/libkmod/libkmod.sym |
| 78 | libkmod_libkmod_la_LIBADD = libkmod/libkmod-util.la \ |
| 79 | ${liblzma_LIBS} ${zlib_LIBS} |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 80 | |
Lucas De Marchi | 39baaec | 2012-01-10 16:22:59 -0200 | [diff] [blame] | 81 | noinst_LTLIBRARIES += libkmod/libkmod-private.la |
| 82 | libkmod_libkmod_private_la_SOURCES = $(libkmod_libkmod_la_SOURCES) |
| 83 | libkmod_libkmod_private_la_LDFLAGS = $(AM_LDFLAGS) \ |
| 84 | -Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym |
| 85 | libkmod_libkmod_private_la_DEPENDENCIES = $(libkmod_libkmod_la_DEPENDENCIES) |
| 86 | libkmod_libkmod_private_la_LIBADD = $(libkmod_libkmod_la_LIBADD) |
| 87 | |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 88 | pkgconfigdir = $(libdir)/pkgconfig |
Lucas De Marchi | 586fc30 | 2011-11-21 14:35:35 -0200 | [diff] [blame] | 89 | pkgconfig_DATA = libkmod/libkmod.pc |
Kay Sievers | 9faa7b3 | 2011-12-21 11:48:07 -0200 | [diff] [blame] | 90 | EXTRA_DIST += libkmod/libkmod.pc.in |
| 91 | CLEANFILES += libkmod/libkmod.pc |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 92 | |
Kay Sievers | e79bf83 | 2011-12-22 15:40:24 +0100 | [diff] [blame] | 93 | install-exec-hook: |
| 94 | if test "$(libdir)" != "$(rootlibdir)"; then \ |
Lucas De Marchi | 6a4fa8d | 2011-12-23 01:59:31 -0200 | [diff] [blame] | 95 | $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \ |
Kay Sievers | e79bf83 | 2011-12-22 15:40:24 +0100 | [diff] [blame] | 96 | so_img_name=$$(readlink $(DESTDIR)$(libdir)/libkmod.so) && \ |
| 97 | so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \ |
| 98 | ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libkmod.so && \ |
| 99 | mv $(DESTDIR)$(libdir)/libkmod.so.* $(DESTDIR)$(rootlibdir); \ |
| 100 | fi |
| 101 | |
| 102 | uninstall-hook: |
| 103 | rm -f $(DESTDIR)$(rootlibdir)/libkmod.so* |
| 104 | |
Gustavo Sverzut Barbieri | 72c51a9 | 2011-12-10 22:19:41 -0200 | [diff] [blame] | 105 | if BUILD_TOOLS |
Lucas De Marchi | 8d75053 | 2012-01-04 08:58:19 -0200 | [diff] [blame] | 106 | bin_PROGRAMS = tools/kmod |
| 107 | |
Lucas De Marchi | 00fc926 | 2012-01-10 11:15:19 -0200 | [diff] [blame] | 108 | noinst_SCRIPTS = tools/insmod tools/rmmod tools/lsmod \ |
| 109 | tools/modprobe tools/modinfo tools/depmod |
Lucas De Marchi | 8900b91 | 2011-12-22 02:33:36 -0200 | [diff] [blame] | 110 | |
Lucas De Marchi | f712ebc | 2011-12-22 03:39:11 -0200 | [diff] [blame] | 111 | tools_kmod_SOURCES = tools/kmod.c tools/kmod.h tools/kmod-lsmod.c \ |
Lucas De Marchi | 769becb | 2011-12-22 03:50:54 -0200 | [diff] [blame] | 112 | tools/kmod-rmmod.c tools/kmod-insmod.c \ |
Lucas De Marchi | f6cf14c | 2011-12-27 19:56:33 -0200 | [diff] [blame] | 113 | tools/kmod-modinfo.c tools/kmod-modprobe.c \ |
| 114 | tools/kmod-depmod.c |
Lucas De Marchi | 6fcf69e | 2011-12-22 03:01:45 -0200 | [diff] [blame] | 115 | tools_kmod_CPPFLAGS = $(AM_CPPFLAGS) -DKMOD_BUNDLE_TOOL=1 |
Lucas De Marchi | f6cf14c | 2011-12-27 19:56:33 -0200 | [diff] [blame] | 116 | tools_kmod_CFLAGS = $(AM_CFLAGS) |
| 117 | tools_kmod_LDADD = libkmod/libkmod-util.la \ |
| 118 | libkmod/libkmod.la |
Lucas De Marchi | 00fc926 | 2012-01-10 11:15:19 -0200 | [diff] [blame] | 119 | |
Lucas De Marchi | fe8b067 | 2012-01-21 15:38:25 -0200 | [diff] [blame] | 120 | noinst_PROGRAMS = tools/kmod-nolib |
Lucas De Marchi | 0b22179 | 2012-01-10 14:06:24 -0200 | [diff] [blame] | 121 | tools_kmod_nolib_SOURCES = $(tools_kmod_SOURCES) |
| 122 | tools_kmod_nolib_CPPFLAGS = $(tools_kmod_CPPFLAGS) |
| 123 | tools_kmod_nolib_CFLAGS = $(tools_kmod_CFLAGS) |
| 124 | tools_kmod_nolib_LDADD = libkmod/libkmod-util.la \ |
| 125 | libkmod/libkmod-private.la |
| 126 | |
| 127 | ${noinst_SCRIPTS}: tools/kmod-nolib |
Lucas De Marchi | 00fc926 | 2012-01-10 11:15:19 -0200 | [diff] [blame] | 128 | $(AM_V_GEN) ($(RM) $@; \ |
| 129 | $(LN_S) $(notdir $<) $@) |
Gustavo Sverzut Barbieri | 72c51a9 | 2011-12-10 22:19:41 -0200 | [diff] [blame] | 130 | endif |
| 131 | |
Lucas De Marchi | 6afc9cd | 2012-01-25 02:44:45 -0200 | [diff] [blame] | 132 | # ------------------------------------------------------------------------------ |
| 133 | # TESTSUITE |
| 134 | # ------------------------------------------------------------------------------ |
| 135 | |
Lucas De Marchi | 68cc449 | 2012-01-24 22:04:46 -0200 | [diff] [blame] | 136 | # libtool will not create a shared library that is not installed. Workaround |
| 137 | # this by creating it by ourselves |
| 138 | CREATE_SHARED_OVERRIDE_LIB = \ |
| 139 | $(AM_V_CCLD)gcc -fPIC $(AM_CPPFLAGS) $(AM_CFLAGS) -shared $^ \ |
| 140 | -o $@ $(AM_LDFLAGS) -ldl |
| 141 | |
| 142 | testsuite/uname.so: testsuite/uname.c |
| 143 | $(CREATE_SHARED_OVERRIDE_LIB) |
| 144 | |
Lucas De Marchi | 6afc9cd | 2012-01-25 02:44:45 -0200 | [diff] [blame] | 145 | testsuite/path.so: testsuite/path.c |
| 146 | $(CREATE_SHARED_OVERRIDE_LIB) |
| 147 | |
Lucas De Marchi | 53646fc | 2012-01-26 02:09:28 -0200 | [diff] [blame^] | 148 | testsuite/init_module.so: testsuite/init_module.c $(abs_top_builddir)/libkmod/.libs/libkmod-private.a |
| 149 | $(CREATE_SHARED_OVERRIDE_LIB) |
| 150 | |
| 151 | EXTRA_DIST += testsuite/uname.c testsuite/path.c testsuite/init_module.c |
| 152 | CLEANFILES += testsuite/uname.so testsuite/path.so testsuite/init_module.so |
Lucas De Marchi | 6afc9cd | 2012-01-25 02:44:45 -0200 | [diff] [blame] | 153 | |
| 154 | testsuite/rootfs: |
| 155 | $(AM_V_GEN) tar -C testsuite/ \ |
| 156 | -xJf $(top_srcdir)/testsuite/rootfs.tar.xz |
| 157 | |
| 158 | testsuite-distclean: |
| 159 | -rm -rf testsuite/rootfs |
| 160 | |
| 161 | DISTCLEAN_LOCAL_HOOKS += testsuite-distclean |
| 162 | EXTRA_DIST += testsuite/rootfs.tar.xz |
Lucas De Marchi | 68cc449 | 2012-01-24 22:04:46 -0200 | [diff] [blame] | 163 | |
Lucas De Marchi | 6b88ef3 | 2012-01-25 15:13:45 -0200 | [diff] [blame] | 164 | TESTSUITE_CPPFLAGS = $(AM_CPPFLAGS) \ |
| 165 | -DTESTSUITE_ROOTFS=\"$(abs_top_builddir)/testsuite/rootfs/\" \ |
| 166 | -DABS_TOP_BUILDDIR=\"$(abs_top_builddir)\" |
| 167 | |
Lucas De Marchi | 80f9e02 | 2012-01-24 20:59:54 -0200 | [diff] [blame] | 168 | check_LTLIBRARIES = testsuite/libtestsuite.la |
| 169 | testsuite_libtestsuite_la_SOURCES = testsuite/testsuite.c \ |
| 170 | testsuite/testsuite.h |
Lucas De Marchi | 6afc9cd | 2012-01-25 02:44:45 -0200 | [diff] [blame] | 171 | testsuite_libtestsuite_la_DEPENDENCIES = testsuite/uname.so \ |
| 172 | testsuite/path.so \ |
Lucas De Marchi | 53646fc | 2012-01-26 02:09:28 -0200 | [diff] [blame^] | 173 | testsuite/init_module.so \ |
Lucas De Marchi | 6afc9cd | 2012-01-25 02:44:45 -0200 | [diff] [blame] | 174 | testsuite/rootfs |
Lucas De Marchi | 6b88ef3 | 2012-01-25 15:13:45 -0200 | [diff] [blame] | 175 | testsuite_libtestsuite_la_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
Lucas De Marchi | 646b83b | 2012-01-09 04:20:55 -0200 | [diff] [blame] | 176 | |
Lucas De Marchi | 95daea0 | 2012-01-25 20:32:48 -0200 | [diff] [blame] | 177 | TESTSUITE = testsuite/test-init testsuite/test-testsuite testsuite/test-loaded \ |
| 178 | testsuite/test-modinfo |
Lucas De Marchi | eebca81 | 2012-01-24 21:53:27 -0200 | [diff] [blame] | 179 | check_PROGRAMS = $(TESTSUITE) |
| 180 | TESTS = $(TESTSUITE) |
| 181 | |
| 182 | testsuite_test_init_LDADD = testsuite/libtestsuite.la libkmod/libkmod-private.la |
Lucas De Marchi | 6b88ef3 | 2012-01-25 15:13:45 -0200 | [diff] [blame] | 183 | testsuite_test_init_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
Lucas De Marchi | ab25311 | 2012-01-24 23:35:18 -0200 | [diff] [blame] | 184 | testsuite_test_testsuite_LDADD = testsuite/libtestsuite.la |
Lucas De Marchi | 6b88ef3 | 2012-01-25 15:13:45 -0200 | [diff] [blame] | 185 | testsuite_test_testsuite_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
Lucas De Marchi | 61e9433 | 2012-01-25 18:16:45 -0200 | [diff] [blame] | 186 | testsuite_test_loaded_LDADD = testsuite/libtestsuite.la libkmod/libkmod-private.la |
| 187 | testsuite_test_loaded_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
Lucas De Marchi | 95daea0 | 2012-01-25 20:32:48 -0200 | [diff] [blame] | 188 | testsuite_test_modinfo_LDADD = testsuite/libtestsuite.la |
| 189 | testsuite_test_modinfo_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
Lucas De Marchi | 61e9433 | 2012-01-25 18:16:45 -0200 | [diff] [blame] | 190 | |
Lucas De Marchi | eebca81 | 2012-01-24 21:53:27 -0200 | [diff] [blame] | 191 | |
Lucas De Marchi | 646b83b | 2012-01-09 04:20:55 -0200 | [diff] [blame] | 192 | DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc |
Lucas De Marchi | f4647b6 | 2012-01-16 00:42:28 -0200 | [diff] [blame] | 193 | |
Lucas De Marchi | 6afc9cd | 2012-01-25 02:44:45 -0200 | [diff] [blame] | 194 | distclean-local: $(DISTCLEAN_LOCAL_HOOKS) |
Lucas De Marchi | f4647b6 | 2012-01-16 00:42:28 -0200 | [diff] [blame] | 195 | |
| 196 | # ------------------------------------------------------------------------------ |
| 197 | # custom release helpers |
| 198 | # ------------------------------------------------------------------------------ |
| 199 | |
| 200 | git-release: |
| 201 | head -1 NEWS | grep -q "kmod $(VERSION)" |
| 202 | git commit -a -m "kmod $(VERSION)" |
| 203 | git tag -m "kmod $(VERSION)" -s v$(VERSION) |
| 204 | git gc --prune=0 |
| 205 | |
| 206 | kmod-$(VERSION).tar.xz: |
| 207 | make distcheck |
| 208 | |
| 209 | kmod-$(VERSION).tar.sign: |
| 210 | xz -d -c kmod-$(VERSION).tar.xz | gpg --armor --detach-sign --output kmod-$(VERSION).tar.sign |
| 211 | |
| 212 | tar: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign |
| 213 | |
| 214 | tar-sync: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign |
| 215 | scp $^ packages.profusion.mobi:/var/www/packages/kmod/ |