Colin Walters | 8631552 | 2012-07-30 12:27:10 -0400 | [diff] [blame] | 1 | SUBDIRS = . libkmod/docs |
| 2 | |
| 3 | if BUILD_MANPAGES |
| 4 | SUBDIRS += man |
| 5 | endif |
Lucas De Marchi | 646b83b | 2012-01-09 04:20:55 -0200 | [diff] [blame] | 6 | |
Lucas De Marchi | 6afc9cd | 2012-01-25 02:44:45 -0200 | [diff] [blame] | 7 | DISTCLEAN_LOCAL_HOOKS = |
Lucas De Marchi | 85ece20 | 2011-12-02 17:53:54 -0200 | [diff] [blame] | 8 | EXTRA_DIST = |
Lucas De Marchi | 3a33a7a | 2014-03-24 08:27:19 -0300 | [diff] [blame] | 9 | CLEANFILES = $(BUILT_FILES) |
| 10 | BUILT_FILES = |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 11 | ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} |
| 12 | AM_MAKEFLAGS = --no-print-directory |
| 13 | |
Mike Auty | fd56638 | 2014-12-05 00:49:13 +0000 | [diff] [blame] | 14 | GCC_COLORS ?= 'yes' |
| 15 | export GCC_COLORS |
| 16 | |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 17 | AM_CPPFLAGS = \ |
| 18 | -include $(top_builddir)/config.h \ |
Lucas De Marchi | 576dd43 | 2014-10-02 22:03:19 -0300 | [diff] [blame] | 19 | -I$(top_srcdir) \ |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 20 | -DSYSCONFDIR=\""$(sysconfdir)"\" \ |
Jan Engelhardt | 7b3a74f | 2011-12-24 04:45:22 +0100 | [diff] [blame] | 21 | ${zlib_CFLAGS} |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 22 | |
Lucas De Marchi | 84aaaed | 2015-01-02 16:32:03 -0200 | [diff] [blame] | 23 | AM_CFLAGS = $(OUR_CFLAGS) |
| 24 | AM_LDFLAGS = $(OUR_LDFLAGS) |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 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 | 4075860 | 2012-09-06 16:26:53 -0300 | [diff] [blame] | 42 | LIBKMOD_CURRENT=4 |
Lucas De Marchi | f9e2167 | 2014-11-16 10:24:50 -0200 | [diff] [blame] | 43 | LIBKMOD_REVISION=9 |
Lucas De Marchi | 4075860 | 2012-09-06 16:26:53 -0300 | [diff] [blame] | 44 | LIBKMOD_AGE=2 |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 45 | |
Lucas De Marchi | 2c5bc21 | 2014-10-09 01:20:35 -0300 | [diff] [blame] | 46 | noinst_LTLIBRARIES = shared/libshared.la |
| 47 | shared_libshared_la_SOURCES = \ |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 48 | shared/macro.h \ |
Lucas De Marchi | 74d1df6 | 2014-10-03 00:22:36 -0300 | [diff] [blame] | 49 | shared/missing.h \ |
| 50 | shared/array.c \ |
| 51 | shared/array.h \ |
Lucas De Marchi | 0db718e | 2014-10-03 00:29:18 -0300 | [diff] [blame] | 52 | shared/hash.c \ |
| 53 | shared/hash.h \ |
Lucas De Marchi | b4d1f44 | 2014-10-11 13:03:21 -0300 | [diff] [blame] | 54 | shared/strbuf.c \ |
| 55 | shared/strbuf.h \ |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 56 | shared/util.c \ |
Lucas De Marchi | f4e8c16 | 2014-10-09 01:14:16 -0300 | [diff] [blame] | 57 | shared/util.h |
Lucas De Marchi | 529148e | 2011-12-27 12:26:51 -0200 | [diff] [blame] | 58 | |
Lucas De Marchi | 586fc30 | 2011-11-21 14:35:35 -0200 | [diff] [blame] | 59 | include_HEADERS = libkmod/libkmod.h |
| 60 | lib_LTLIBRARIES = libkmod/libkmod.la |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 61 | |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 62 | libkmod_libkmod_la_SOURCES = \ |
Lucas De Marchi | 586fc30 | 2011-11-21 14:35:35 -0200 | [diff] [blame] | 63 | libkmod/libkmod.h \ |
Lucas De Marchi | 83b855a | 2013-07-04 16:13:11 -0300 | [diff] [blame] | 64 | libkmod/libkmod-internal.h \ |
Lucas De Marchi | 6924e47 | 2011-11-22 05:38:28 -0200 | [diff] [blame] | 65 | libkmod/libkmod.c \ |
Lucas De Marchi | 5369797 | 2011-11-22 05:42:09 -0200 | [diff] [blame] | 66 | libkmod/libkmod-list.c \ |
Lucas De Marchi | 7c2ab35 | 2011-11-29 18:07:43 -0200 | [diff] [blame] | 67 | libkmod/libkmod-config.c \ |
Lucas De Marchi | e8847fd | 2011-11-30 15:23:28 -0200 | [diff] [blame] | 68 | libkmod/libkmod-index.c \ |
| 69 | libkmod/libkmod-index.h \ |
Gustavo Sverzut Barbieri | 3d8226e | 2011-12-16 16:08:53 -0200 | [diff] [blame] | 70 | libkmod/libkmod-module.c \ |
Gustavo Sverzut Barbieri | 708624a | 2011-12-18 01:25:06 -0200 | [diff] [blame] | 71 | libkmod/libkmod-file.c \ |
Michal Marek | 8fe1681 | 2013-01-16 09:52:01 +0100 | [diff] [blame] | 72 | libkmod/libkmod-elf.c \ |
| 73 | libkmod/libkmod-signature.c |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 74 | |
Lucas De Marchi | 586fc30 | 2011-11-21 14:35:35 -0200 | [diff] [blame] | 75 | EXTRA_DIST += libkmod/libkmod.sym |
Lucas De Marchi | 1a07559 | 2014-10-07 23:23:11 -0300 | [diff] [blame] | 76 | EXTRA_DIST += libkmod/README \ |
| 77 | libkmod/COPYING testsuite/COPYING tools/COPYING COPYING |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 78 | |
Lucas De Marchi | 586fc30 | 2011-11-21 14:35:35 -0200 | [diff] [blame] | 79 | libkmod_libkmod_la_LDFLAGS = $(AM_LDFLAGS) \ |
| 80 | -version-info $(LIBKMOD_CURRENT):$(LIBKMOD_REVISION):$(LIBKMOD_AGE) \ |
| 81 | -Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 82 | libkmod_libkmod_la_DEPENDENCIES = \ |
Lucas De Marchi | 2c5bc21 | 2014-10-09 01:20:35 -0300 | [diff] [blame] | 83 | shared/libshared.la \ |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 84 | ${top_srcdir}/libkmod/libkmod.sym |
| 85 | libkmod_libkmod_la_LIBADD = \ |
Lucas De Marchi | 2c5bc21 | 2014-10-09 01:20:35 -0300 | [diff] [blame] | 86 | shared/libshared.la \ |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 87 | ${liblzma_LIBS} ${zlib_LIBS} |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 88 | |
Lucas De Marchi | 83b855a | 2013-07-04 16:13:11 -0300 | [diff] [blame] | 89 | noinst_LTLIBRARIES += libkmod/libkmod-internal.la |
| 90 | libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES) |
| 91 | libkmod_libkmod_internal_la_LDFLAGS = $(AM_LDFLAGS) \ |
Lucas De Marchi | 39baaec | 2012-01-10 16:22:59 -0200 | [diff] [blame] | 92 | -Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym |
Lucas De Marchi | 83b855a | 2013-07-04 16:13:11 -0300 | [diff] [blame] | 93 | libkmod_libkmod_internal_la_DEPENDENCIES = $(libkmod_libkmod_la_DEPENDENCIES) |
| 94 | libkmod_libkmod_internal_la_LIBADD = $(libkmod_libkmod_la_LIBADD) |
Lucas De Marchi | 39baaec | 2012-01-10 16:22:59 -0200 | [diff] [blame] | 95 | |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 96 | pkgconfigdir = $(libdir)/pkgconfig |
Lucas De Marchi | 586fc30 | 2011-11-21 14:35:35 -0200 | [diff] [blame] | 97 | pkgconfig_DATA = libkmod/libkmod.pc |
Kay Sievers | 9faa7b3 | 2011-12-21 11:48:07 -0200 | [diff] [blame] | 98 | EXTRA_DIST += libkmod/libkmod.pc.in |
| 99 | CLEANFILES += libkmod/libkmod.pc |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 100 | |
Lucas De Marchi | 80cf2c8 | 2013-07-30 03:47:19 -0300 | [diff] [blame] | 101 | bashcompletiondir=@bashcompletiondir@ |
| 102 | dist_bashcompletion_DATA = \ |
| 103 | shell-completion/bash/kmod |
| 104 | |
Kay Sievers | e79bf83 | 2011-12-22 15:40:24 +0100 | [diff] [blame] | 105 | install-exec-hook: |
| 106 | if test "$(libdir)" != "$(rootlibdir)"; then \ |
Lucas De Marchi | 6a4fa8d | 2011-12-23 01:59:31 -0200 | [diff] [blame] | 107 | $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \ |
Kay Sievers | e79bf83 | 2011-12-22 15:40:24 +0100 | [diff] [blame] | 108 | so_img_name=$$(readlink $(DESTDIR)$(libdir)/libkmod.so) && \ |
| 109 | so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \ |
| 110 | ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libkmod.so && \ |
| 111 | mv $(DESTDIR)$(libdir)/libkmod.so.* $(DESTDIR)$(rootlibdir); \ |
| 112 | fi |
| 113 | |
| 114 | uninstall-hook: |
| 115 | rm -f $(DESTDIR)$(rootlibdir)/libkmod.so* |
| 116 | |
Gustavo Sverzut Barbieri | 72c51a9 | 2011-12-10 22:19:41 -0200 | [diff] [blame] | 117 | if BUILD_TOOLS |
Lucas De Marchi | 8d75053 | 2012-01-04 08:58:19 -0200 | [diff] [blame] | 118 | bin_PROGRAMS = tools/kmod |
| 119 | |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 120 | noinst_SCRIPTS = \ |
| 121 | tools/insmod tools/rmmod tools/lsmod \ |
| 122 | tools/modprobe tools/modinfo tools/depmod |
Lucas De Marchi | 8900b91 | 2011-12-22 02:33:36 -0200 | [diff] [blame] | 123 | |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 124 | tools_kmod_SOURCES = \ |
| 125 | tools/kmod.c tools/kmod.h tools/lsmod.c \ |
| 126 | tools/rmmod.c tools/insmod.c \ |
| 127 | tools/modinfo.c tools/modprobe.c \ |
| 128 | tools/depmod.c tools/log.h tools/log.c \ |
| 129 | tools/static-nodes.c |
| 130 | tools_kmod_LDADD = \ |
Lucas De Marchi | 2c5bc21 | 2014-10-09 01:20:35 -0300 | [diff] [blame] | 131 | shared/libshared.la \ |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 132 | libkmod/libkmod-internal.la |
Lucas De Marchi | 00fc926 | 2012-01-10 11:15:19 -0200 | [diff] [blame] | 133 | |
Lucas De Marchi | b6adccd | 2013-07-04 16:01:55 -0300 | [diff] [blame] | 134 | ${noinst_SCRIPTS}: tools/kmod |
Lucas De Marchi | 00fc926 | 2012-01-10 11:15:19 -0200 | [diff] [blame] | 135 | $(AM_V_GEN) ($(RM) $@; \ |
| 136 | $(LN_S) $(notdir $<) $@) |
Gustavo Sverzut Barbieri | 72c51a9 | 2011-12-10 22:19:41 -0200 | [diff] [blame] | 137 | endif |
| 138 | |
Lucas De Marchi | 6afc9cd | 2012-01-25 02:44:45 -0200 | [diff] [blame] | 139 | # ------------------------------------------------------------------------------ |
Lucas De Marchi | 3a33a7a | 2014-03-24 08:27:19 -0300 | [diff] [blame] | 140 | # PYTHON BINDINGS |
| 141 | # ------------------------------------------------------------------------------ |
| 142 | |
| 143 | CYTHON_FLAGS_VERBOSE_ = |
| 144 | CYTHON_FLAGS_VERBOSE_0 = |
| 145 | CYTHON_FLAGS_VERBOSE_1 = -v |
| 146 | CYTHON_FLAGS = $(CYTHON_FLAGS_VERBOSE_$(V)) |
| 147 | AM_V_CYTHON = $(am__v_CYTHON_$(V)) |
| 148 | am__v_CYTHON_ = $(am__v_CYTHON_$(AM_DEFAULT_VERBOSITY)) |
| 149 | am__v_CYTHON_0 = @echo " CYTHON " $@; |
| 150 | |
| 151 | .pyx.c: |
| 152 | $(AM_V_CYTHON)$(CYTHON) -o $@ $< |
| 153 | |
| 154 | %.py: %.py.in Makefile |
| 155 | $(SED_PROCESS) |
| 156 | |
| 157 | # Remove some warnings for generated code |
| 158 | PYTHON_NOWARN = -Wno-redundant-decls -Wno-shadow -Wno-strict-aliasing |
| 159 | |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 160 | CPYTHON_MODULE_CFLAGS = \ |
| 161 | $(AM_CFLAGS) -DCPYTHON_COMPILING_IN_PYPY=0 \ |
| 162 | $(PYTHON_NOWARN) $(PYTHON_CFLAGS) \ |
| 163 | -fvisibility=default |
Lucas De Marchi | 3a33a7a | 2014-03-24 08:27:19 -0300 | [diff] [blame] | 164 | CPYTHON_MODULE_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version -shared |
| 165 | |
| 166 | if BUILD_PYTHON |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 167 | pkgpyexec_LTLIBRARIES = \ |
| 168 | libkmod/python/kmod/kmod.la \ |
| 169 | libkmod/python/kmod/list.la \ |
| 170 | libkmod/python/kmod/module.la \ |
| 171 | libkmod/python/kmod/_util.la |
Lucas De Marchi | 3a33a7a | 2014-03-24 08:27:19 -0300 | [diff] [blame] | 172 | |
| 173 | libkmod_python_kmod_kmod_la_SOURCES = libkmod/python/kmod/kmod.c |
| 174 | libkmod_python_kmod_kmod_la_CFLAGS = $(CPYTHON_MODULE_CFLAGS) |
| 175 | libkmod_python_kmod_kmod_la_LDFLAGS = $(CPYTHON_MODULE_LDFLAGS) |
| 176 | libkmod_python_kmod_kmod_la_LIBADD = $(PYTHON_LIBS) libkmod/libkmod.la |
| 177 | |
| 178 | libkmod_python_kmod_list_la_SOURCES = libkmod/python/kmod/list.c |
| 179 | libkmod_python_kmod_list_la_CFLAGS = $(CPYTHON_MODULE_CFLAGS) |
| 180 | libkmod_python_kmod_list_la_LDFLAGS = $(CPYTHON_MODULE_LDFLAGS) |
| 181 | libkmod_python_kmod_list_la_LIBADD = $(PYTHON_LIBS) libkmod/libkmod.la |
| 182 | |
| 183 | libkmod_python_kmod_module_la_SOURCES = libkmod/python/kmod/module.c |
| 184 | libkmod_python_kmod_module_la_CFLAGS = $(CPYTHON_MODULE_CFLAGS) |
| 185 | libkmod_python_kmod_module_la_LDFLAGS = $(CPYTHON_MODULE_LDFLAGS) |
| 186 | libkmod_python_kmod_module_la_LIBADD = $(PYTHON_LIBS) libkmod/libkmod.la |
| 187 | |
| 188 | libkmod_python_kmod__util_la_SOURCES = libkmod/python/kmod/_util.c |
| 189 | libkmod_python_kmod__util_la_CFLAGS = $(CPYTHON_MODULE_CFLAGS) |
| 190 | libkmod_python_kmod__util_la_LDFLAGS = $(CPYTHON_MODULE_LDFLAGS) |
| 191 | libkmod_python_kmod__util_la_LIBADD = $(PYTHON_LIBS) libkmod/libkmod.la |
| 192 | |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 193 | BUILT_FILES += \ |
| 194 | $(libkmod_python_kmod_kmod_la_SOURCES) \ |
| 195 | $(libkmod_python_kmod_list_la_SOURCES) \ |
| 196 | $(libkmod_python_kmod_module_la_SOURCES) \ |
| 197 | $(libkmod_python_kmod__util_la_SOURCES) |
Lucas De Marchi | 3a33a7a | 2014-03-24 08:27:19 -0300 | [diff] [blame] | 198 | |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 199 | dist_pkgpyexec_PYTHON = \ |
| 200 | libkmod/python/kmod/error.py \ |
| 201 | libkmod/python/kmod/__init__.py \ |
| 202 | libkmod/python/kmod/version.py |
Lucas De Marchi | 3a33a7a | 2014-03-24 08:27:19 -0300 | [diff] [blame] | 203 | |
| 204 | BUILT_FILES += libkmod/python/kmod/version.py |
| 205 | |
| 206 | endif |
| 207 | # ------------------------------------------------------------------------------ |
Lucas De Marchi | 6afc9cd | 2012-01-25 02:44:45 -0200 | [diff] [blame] | 208 | # TESTSUITE |
| 209 | # ------------------------------------------------------------------------------ |
| 210 | |
Lucas De Marchi | e2ee7d9 | 2012-05-23 23:04:44 -0300 | [diff] [blame] | 211 | ROOTFS = testsuite/rootfs |
Lucas De Marchi | 0de690c | 2012-05-24 01:31:36 -0300 | [diff] [blame] | 212 | ROOTFS_PRISTINE = $(top_srcdir)/testsuite/rootfs-pristine |
Saul Wold | 518daf4 | 2013-10-09 23:49:48 -0700 | [diff] [blame] | 213 | CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(dir $(ROOTFS)) && \ |
Lucas De Marchi | 0de690c | 2012-05-24 01:31:36 -0300 | [diff] [blame] | 214 | cp -r $(ROOTFS_PRISTINE) $(ROOTFS) && \ |
Lucas De Marchi | 33202e8 | 2012-06-19 13:09:23 -0300 | [diff] [blame] | 215 | touch testsuite/stamp-rootfs && \ |
| 216 | find $(ROOTFS) -type d -exec chmod +w {} \; ) |
Lucas De Marchi | e2ee7d9 | 2012-05-23 23:04:44 -0300 | [diff] [blame] | 217 | |
Dave Reisner | 84afccb | 2012-09-08 11:50:56 -0400 | [diff] [blame] | 218 | rootfs: |
Lucas De Marchi | 0de690c | 2012-05-24 01:31:36 -0300 | [diff] [blame] | 219 | $(CREATE_ROOTFS) |
Dave Reisner | 2588e3d | 2012-06-28 11:16:36 -0400 | [diff] [blame] | 220 | .PHONY: rootfs |
Lucas De Marchi | 0de690c | 2012-05-24 01:31:36 -0300 | [diff] [blame] | 221 | |
| 222 | $(ROOTFS): $(ROOTFS_PRISTINE) |
| 223 | $(CREATE_ROOTFS) |
Lucas De Marchi | 452c1dd | 2012-05-11 00:04:59 -0300 | [diff] [blame] | 224 | |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 225 | TESTSUITE_OVERRIDE_LIBS = \ |
| 226 | testsuite/uname.la testsuite/path.la \ |
| 227 | testsuite/init_module.la \ |
| 228 | testsuite/delete_module.la |
| 229 | TESTSUITE_OVERRIDE_LIBS_LDFLAGS = \ |
| 230 | avoid-version -module -shared -export-dynamic -rpath /nowhere -ldl |
Lucas De Marchi | 68cc449 | 2012-01-24 22:04:46 -0200 | [diff] [blame] | 231 | |
Michal Marek | 9324bb5 | 2014-04-04 11:30:07 +0200 | [diff] [blame] | 232 | check-sysconfdir: |
| 233 | $(AM_V_at)if test "$(sysconfdir)" != "/etc" -a "$(sysconfdir)" != "/etc/"; then \ |
| 234 | echo "warning: Some tests will fail without --sysconfdir=/etc" >&2; \ |
| 235 | fi |
| 236 | .PHONY: check-sysconfdir |
| 237 | |
| 238 | check-am: rootfs check-sysconfdir |
| 239 | |
Dave Reisner | 2588e3d | 2012-06-28 11:16:36 -0400 | [diff] [blame] | 240 | |
Lucas De Marchi | d2c2b8b | 2012-01-26 12:18:23 -0200 | [diff] [blame] | 241 | check_LTLIBRARIES = $(TESTSUITE_OVERRIDE_LIBS) |
Lucas De Marchi | 68cc449 | 2012-01-24 22:04:46 -0200 | [diff] [blame] | 242 | |
Lucas De Marchi | d2c2b8b | 2012-01-26 12:18:23 -0200 | [diff] [blame] | 243 | testsuite_uname_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) |
Lucas De Marchi | 8ff7f00 | 2015-01-07 19:14:20 -0200 | [diff] [blame] | 244 | testsuite_path_la_CPPFLAGS = $(AM_CPPFLAGS) \ |
| 245 | -DABS_TOP_BUILDDIR=\"$(abs_top_builddir)\" |
Lucas De Marchi | d2c2b8b | 2012-01-26 12:18:23 -0200 | [diff] [blame] | 246 | testsuite_path_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) |
Lucas De Marchi | 6afc9cd | 2012-01-25 02:44:45 -0200 | [diff] [blame] | 247 | |
Lucas De Marchi | f6ef5d6 | 2012-01-26 16:10:41 -0200 | [diff] [blame] | 248 | testsuite_delete_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) |
Lucas De Marchi | d2c2b8b | 2012-01-26 12:18:23 -0200 | [diff] [blame] | 249 | testsuite_init_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) |
| 250 | testsuite_init_module_la_SOURCES = testsuite/init_module.c \ |
Lucas De Marchi | d48b8a7 | 2012-01-29 16:09:59 -0200 | [diff] [blame] | 251 | testsuite/stripped-module.h |
Lucas De Marchi | 83b855a | 2013-07-04 16:13:11 -0300 | [diff] [blame] | 252 | testsuite_init_module_la_LIBADD = libkmod/libkmod-internal.la |
Lucas De Marchi | 6afc9cd | 2012-01-25 02:44:45 -0200 | [diff] [blame] | 253 | |
Lucas De Marchi | 6b88ef3 | 2012-01-25 15:13:45 -0200 | [diff] [blame] | 254 | TESTSUITE_CPPFLAGS = $(AM_CPPFLAGS) \ |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 255 | -DTESTSUITE_ROOTFS=\"$(abs_top_builddir)/$(ROOTFS)/\" \ |
| 256 | -DABS_TOP_BUILDDIR=\"$(abs_top_builddir)\" |
| 257 | TESTSUITE_LDADD = \ |
| 258 | testsuite/libtestsuite.la libkmod/libkmod-internal.la \ |
Lucas De Marchi | 2c5bc21 | 2014-10-09 01:20:35 -0300 | [diff] [blame] | 259 | shared/libshared.la |
Lucas De Marchi | 6b88ef3 | 2012-01-25 15:13:45 -0200 | [diff] [blame] | 260 | |
Lucas De Marchi | d2c2b8b | 2012-01-26 12:18:23 -0200 | [diff] [blame] | 261 | check_LTLIBRARIES += testsuite/libtestsuite.la |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 262 | testsuite_libtestsuite_la_SOURCES = \ |
| 263 | testsuite/testsuite.c testsuite/testsuite.h |
| 264 | testsuite_libtestsuite_la_DEPENDENCIES = \ |
| 265 | $(ROOTFS) $(TESTSUITE_OVERRIDE_LIBS) |
Lucas De Marchi | 6b88ef3 | 2012-01-25 15:13:45 -0200 | [diff] [blame] | 266 | testsuite_libtestsuite_la_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
Lucas De Marchi | b8e344a | 2012-06-06 01:03:15 -0300 | [diff] [blame] | 267 | testsuite_libtestsuite_la_LIBADD = -lrt |
Lucas De Marchi | 646b83b | 2012-01-09 04:20:55 -0200 | [diff] [blame] | 268 | |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 269 | TESTSUITE = \ |
| 270 | testsuite/test-hash \ |
Lucas De Marchi | fdafa6b | 2014-10-08 01:12:15 -0300 | [diff] [blame] | 271 | testsuite/test-array \ |
Lucas De Marchi | 48e4d18 | 2014-10-13 18:42:01 -0300 | [diff] [blame] | 272 | testsuite/test-strbuf \ |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 273 | testsuite/test-init testsuite/test-testsuite testsuite/test-loaded \ |
| 274 | testsuite/test-modinfo testsuite/test-util testsuite/test-new-module \ |
| 275 | testsuite/test-modprobe testsuite/test-blacklist \ |
| 276 | testsuite/test-dependencies testsuite/test-depmod |
Lucas De Marchi | b0c9fc8 | 2012-10-04 01:08:13 -0300 | [diff] [blame] | 277 | |
Lucas De Marchi | eebca81 | 2012-01-24 21:53:27 -0200 | [diff] [blame] | 278 | check_PROGRAMS = $(TESTSUITE) |
| 279 | TESTS = $(TESTSUITE) |
| 280 | |
Lucas De Marchi | 8eded79 | 2014-10-03 00:13:49 -0300 | [diff] [blame] | 281 | testsuite_test_testsuite_LDADD = \ |
Lucas De Marchi | 2c5bc21 | 2014-10-09 01:20:35 -0300 | [diff] [blame] | 282 | testsuite/libtestsuite.la shared/libshared.la |
Lucas De Marchi | 6b88ef3 | 2012-01-25 15:13:45 -0200 | [diff] [blame] | 283 | testsuite_test_testsuite_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
Lucas De Marchi | 5963c36 | 2014-06-06 02:22:43 -0300 | [diff] [blame] | 284 | |
| 285 | testsuite_test_hash_LDADD = $(TESTSUITE_LDADD) |
| 286 | testsuite_test_hash_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
| 287 | |
Lucas De Marchi | fdafa6b | 2014-10-08 01:12:15 -0300 | [diff] [blame] | 288 | testsuite_test_array_LDADD = $(TESTSUITE_LDADD) |
| 289 | testsuite_test_array_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
| 290 | |
Lucas De Marchi | 48e4d18 | 2014-10-13 18:42:01 -0300 | [diff] [blame] | 291 | testsuite_test_strbuf_LDADD = $(TESTSUITE_LDADD) |
| 292 | testsuite_test_strbuf_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
| 293 | |
Dan McGee | d35e883 | 2012-02-03 20:29:09 -0600 | [diff] [blame] | 294 | testsuite_test_init_LDADD = $(TESTSUITE_LDADD) |
| 295 | testsuite_test_init_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
| 296 | testsuite_test_loaded_LDADD = $(TESTSUITE_LDADD) |
Lucas De Marchi | 61e9433 | 2012-01-25 18:16:45 -0200 | [diff] [blame] | 297 | testsuite_test_loaded_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
Dan McGee | d35e883 | 2012-02-03 20:29:09 -0600 | [diff] [blame] | 298 | testsuite_test_modinfo_LDADD = $(TESTSUITE_LDADD) |
Lucas De Marchi | 95daea0 | 2012-01-25 20:32:48 -0200 | [diff] [blame] | 299 | testsuite_test_modinfo_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
Lucas De Marchi | 807c601 | 2013-11-18 04:32:45 -0200 | [diff] [blame] | 300 | testsuite_test_util_LDADD = $(TESTSUITE_LDADD) |
| 301 | testsuite_test_util_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
Dan McGee | d35e883 | 2012-02-03 20:29:09 -0600 | [diff] [blame] | 302 | testsuite_test_new_module_LDADD = $(TESTSUITE_LDADD) |
Lucas De Marchi | a947430 | 2012-01-29 15:43:19 -0200 | [diff] [blame] | 303 | testsuite_test_new_module_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
Lucas De Marchi | 976ea8c | 2012-02-08 01:40:00 -0200 | [diff] [blame] | 304 | testsuite_test_modprobe_LDADD = $(TESTSUITE_LDADD) |
| 305 | testsuite_test_modprobe_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
Dan McGee | bcca1b9 | 2012-02-22 23:56:58 -0600 | [diff] [blame] | 306 | testsuite_test_blacklist_LDADD = $(TESTSUITE_LDADD) |
| 307 | testsuite_test_blacklist_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
Dan McGee | c88aec7 | 2012-02-22 23:56:59 -0600 | [diff] [blame] | 308 | testsuite_test_dependencies_LDADD = $(TESTSUITE_LDADD) |
| 309 | testsuite_test_dependencies_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
Lucas De Marchi | b0c9fc8 | 2012-10-04 01:08:13 -0300 | [diff] [blame] | 310 | testsuite_test_depmod_LDADD = $(TESTSUITE_LDADD) |
| 311 | testsuite_test_depmod_CPPFLAGS = $(TESTSUITE_CPPFLAGS) |
Lucas De Marchi | eebca81 | 2012-01-24 21:53:27 -0200 | [diff] [blame] | 312 | |
Lucas De Marchi | 452c1dd | 2012-05-11 00:04:59 -0300 | [diff] [blame] | 313 | testsuite-distclean: |
Dave Reisner | 86bbd05 | 2012-09-08 11:43:54 -0400 | [diff] [blame] | 314 | $(RM) -r $(ROOTFS) |
| 315 | $(RM) testsuite/stamp-rootfs |
Lucas De Marchi | 452c1dd | 2012-05-11 00:04:59 -0300 | [diff] [blame] | 316 | |
| 317 | DISTCLEAN_LOCAL_HOOKS += testsuite-distclean |
Lucas De Marchi | e2ee7d9 | 2012-05-23 23:04:44 -0300 | [diff] [blame] | 318 | EXTRA_DIST += testsuite/rootfs-pristine |
Lucas De Marchi | 9c41596 | 2012-05-10 23:42:41 -0300 | [diff] [blame] | 319 | |
Lucas De Marchi | 3a33a7a | 2014-03-24 08:27:19 -0300 | [diff] [blame] | 320 | DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --enable-python --sysconfdir=/etc \ |
| 321 | --with-zlib \ |
Lucas De Marchi | 80cf2c8 | 2013-07-30 03:47:19 -0300 | [diff] [blame] | 322 | --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) |
Lucas De Marchi | f4647b6 | 2012-01-16 00:42:28 -0200 | [diff] [blame] | 323 | |
Lucas De Marchi | 6afc9cd | 2012-01-25 02:44:45 -0200 | [diff] [blame] | 324 | distclean-local: $(DISTCLEAN_LOCAL_HOOKS) |
Lucas De Marchi | f4647b6 | 2012-01-16 00:42:28 -0200 | [diff] [blame] | 325 | |
Saul Wold | 16535ab | 2013-10-09 18:09:52 -0700 | [diff] [blame] | 326 | buildtest-TESTS: |
| 327 | $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS) |
| 328 | |
Lucas De Marchi | f4647b6 | 2012-01-16 00:42:28 -0200 | [diff] [blame] | 329 | # ------------------------------------------------------------------------------ |
Lucas De Marchi | e9b0d1b | 2015-01-07 19:17:15 -0200 | [diff] [blame] | 330 | # coverage |
| 331 | # ------------------------------------------------------------------------------ |
| 332 | |
| 333 | # .PHONY so it always rebuilds it |
| 334 | .PHONY: coverage lcov-run lcov-report coverage-sync |
| 335 | |
| 336 | # run lcov from scratch, always |
| 337 | coverage: all |
| 338 | $(MAKE) lcov-run |
| 339 | $(MAKE) lcov-report |
| 340 | |
| 341 | coverage_dir = coverage |
| 342 | coverage_opts = --base-directory $(srcdir) --directory $(builddir) \ |
| 343 | --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))' |
| 344 | |
| 345 | if ENABLE_COVERAGE |
| 346 | # reset run coverage tests |
| 347 | lcov-run: |
| 348 | @rm -rf $(coverage_dir) |
| 349 | lcov $(coverage_opts) --zerocounters |
| 350 | -$(MAKE) check |
| 351 | |
| 352 | # generate report based on current coverage data |
| 353 | lcov-report: |
| 354 | $(MKDIR_P) $(coverage_dir) |
| 355 | lcov $(coverage_opts) --capture --no-external --ignore-errors graph \ |
| 356 | | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info |
| 357 | lcov --remove $(coverage_dir)/.lcov.info --output-file $(coverage_dir)/.lcov-clean.info 'test-*' |
| 358 | genhtml -t "kmod test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov-clean.info |
| 359 | @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html" |
| 360 | |
| 361 | else |
| 362 | |
| 363 | lcov-run lcov-report: |
| 364 | echo "Need to reconfigure with --enable-coverage" |
| 365 | |
| 366 | endif |
| 367 | |
| 368 | # ------------------------------------------------------------------------------ |
Lucas De Marchi | f4647b6 | 2012-01-16 00:42:28 -0200 | [diff] [blame] | 369 | # custom release helpers |
| 370 | # ------------------------------------------------------------------------------ |
| 371 | |
| 372 | git-release: |
| 373 | head -1 NEWS | grep -q "kmod $(VERSION)" |
| 374 | git commit -a -m "kmod $(VERSION)" |
| 375 | git tag -m "kmod $(VERSION)" -s v$(VERSION) |
| 376 | git gc --prune=0 |
| 377 | |
| 378 | kmod-$(VERSION).tar.xz: |
| 379 | make distcheck |
| 380 | |
| 381 | kmod-$(VERSION).tar.sign: |
| 382 | xz -d -c kmod-$(VERSION).tar.xz | gpg --armor --detach-sign --output kmod-$(VERSION).tar.sign |
| 383 | |
| 384 | tar: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign |
| 385 | |
| 386 | tar-sync: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign |
Lucas De Marchi | bb05bc8 | 2012-02-24 01:58:20 -0200 | [diff] [blame] | 387 | kup put kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign /pub/linux/utils/kernel/kmod/ |