]>
Commit | Line | Data |
---|---|---|
1 | SUBDIRS = . libkmod/docs | |
2 | ||
3 | if BUILD_MANPAGES | |
4 | SUBDIRS += man | |
5 | endif | |
6 | ||
7 | DISTCLEAN_LOCAL_HOOKS = | |
8 | EXTRA_DIST = | |
9 | CLEANFILES = $(BUILT_FILES) | |
10 | DISTCLEANFILES = | |
11 | BUILT_FILES = | |
12 | ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} | |
13 | AM_MAKEFLAGS = --no-print-directory | |
14 | ||
15 | GCC_COLORS ?= 'yes' | |
16 | export GCC_COLORS | |
17 | ||
18 | AM_CPPFLAGS = \ | |
19 | -include $(top_builddir)/config.h \ | |
20 | -I$(top_srcdir) \ | |
21 | -DSYSCONFDIR=\""$(sysconfdir)"\" \ | |
22 | ${zlib_CFLAGS} | |
23 | ||
24 | AM_CFLAGS = $(OUR_CFLAGS) | |
25 | AM_LDFLAGS = $(OUR_LDFLAGS) | |
26 | ||
27 | SED_PROCESS = \ | |
28 | $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \ | |
29 | -e 's,@VERSION\@,$(VERSION),g' \ | |
30 | -e 's,@prefix\@,$(prefix),g' \ | |
31 | -e 's,@exec_prefix\@,$(exec_prefix),g' \ | |
32 | -e 's,@libdir\@,$(libdir),g' \ | |
33 | -e 's,@includedir\@,$(includedir),g' \ | |
34 | -e 's,@libzstd_CFLAGS\@,${libzstd_CFLAGS},g' \ | |
35 | -e 's,@libzstd_LIBS\@,${libzstd_LIBS},g' \ | |
36 | -e 's,@liblzma_CFLAGS\@,${liblzma_CFLAGS},g' \ | |
37 | -e 's,@liblzma_LIBS\@,${liblzma_LIBS},g' \ | |
38 | -e 's,@zlib_CFLAGS\@,${zlib_CFLAGS},g' \ | |
39 | -e 's,@zlib_LIBS\@,${zlib_LIBS},g' \ | |
40 | -e 's,@libcrypto_CFLAGS\@,${libcrypto_CFLAGS},g' \ | |
41 | -e 's,@libcrypto_LIBS\@,${libcrypto_LIBS},g' \ | |
42 | < $< > $@ || rm $@ | |
43 | ||
44 | %.pc: %.pc.in Makefile | |
45 | $(SED_PROCESS) | |
46 | ||
47 | # Rules for libtool versioning (from https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html) | |
48 | # 1. Start with version information of ‘0:0:0’ for each libtool library. | |
49 | # 2. Update the version information only immediately before a public release of | |
50 | # your software. More frequent updates are unnecessary, and only guarantee that | |
51 | # the current interface number gets larger faster. | |
52 | # 3. If the library source code has changed at all since the last update, then | |
53 | # increment revision (‘c:r:a’ becomes ‘c:r+1:a’). | |
54 | # 4. If any interfaces have been added, removed, or changed since the last | |
55 | # update, increment current, and set revision to 0. | |
56 | # 5. If any interfaces have been added since the last public release, then | |
57 | # increment age. | |
58 | # 6. If any interfaces have been removed or changed since the last public | |
59 | # release, then set age to 0. | |
60 | LIBKMOD_CURRENT=5 | |
61 | LIBKMOD_REVISION=7 | |
62 | LIBKMOD_AGE=3 | |
63 | ||
64 | noinst_LTLIBRARIES = shared/libshared.la | |
65 | shared_libshared_la_SOURCES = \ | |
66 | shared/macro.h \ | |
67 | shared/missing.h \ | |
68 | shared/array.c \ | |
69 | shared/array.h \ | |
70 | shared/hash.c \ | |
71 | shared/hash.h \ | |
72 | shared/scratchbuf.c \ | |
73 | shared/scratchbuf.h \ | |
74 | shared/strbuf.c \ | |
75 | shared/strbuf.h \ | |
76 | shared/util.c \ | |
77 | shared/util.h | |
78 | ||
79 | include_HEADERS = libkmod/libkmod.h | |
80 | lib_LTLIBRARIES = libkmod/libkmod.la | |
81 | ||
82 | libkmod_libkmod_la_SOURCES = \ | |
83 | libkmod/libkmod.h \ | |
84 | libkmod/libkmod-internal.h \ | |
85 | libkmod/libkmod.c \ | |
86 | libkmod/libkmod-builtin.c \ | |
87 | libkmod/libkmod-list.c \ | |
88 | libkmod/libkmod-config.c \ | |
89 | libkmod/libkmod-index.c \ | |
90 | libkmod/libkmod-index.h \ | |
91 | libkmod/libkmod-module.c \ | |
92 | libkmod/libkmod-file.c \ | |
93 | libkmod/libkmod-elf.c \ | |
94 | libkmod/libkmod-signature.c | |
95 | ||
96 | EXTRA_DIST += libkmod/libkmod.sym | |
97 | EXTRA_DIST += libkmod/README \ | |
98 | libkmod/COPYING testsuite/COPYING tools/COPYING COPYING | |
99 | ||
100 | libkmod_libkmod_la_LDFLAGS = $(AM_LDFLAGS) \ | |
101 | -version-info $(LIBKMOD_CURRENT):$(LIBKMOD_REVISION):$(LIBKMOD_AGE) \ | |
102 | -Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym | |
103 | libkmod_libkmod_la_DEPENDENCIES = \ | |
104 | shared/libshared.la \ | |
105 | ${top_srcdir}/libkmod/libkmod.sym | |
106 | libkmod_libkmod_la_LIBADD = \ | |
107 | shared/libshared.la \ | |
108 | ${libzstd_LIBS} ${liblzma_LIBS} ${zlib_LIBS} ${libcrypto_LIBS} | |
109 | ||
110 | noinst_LTLIBRARIES += libkmod/libkmod-internal.la | |
111 | libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES) | |
112 | libkmod_libkmod_internal_la_LDFLAGS = $(AM_LDFLAGS) \ | |
113 | -Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym | |
114 | libkmod_libkmod_internal_la_DEPENDENCIES = $(libkmod_libkmod_la_DEPENDENCIES) | |
115 | libkmod_libkmod_internal_la_LIBADD = $(libkmod_libkmod_la_LIBADD) | |
116 | ||
117 | pkgconfigdir = $(libdir)/pkgconfig | |
118 | pkgconfig_DATA = libkmod/libkmod.pc | |
119 | EXTRA_DIST += libkmod/libkmod.pc.in | |
120 | CLEANFILES += libkmod/libkmod.pc | |
121 | ||
122 | bashcompletiondir=@bashcompletiondir@ | |
123 | dist_bashcompletion_DATA = \ | |
124 | shell-completion/bash/kmod | |
125 | ||
126 | install-exec-hook: | |
127 | if test "$(libdir)" != "$(rootlibdir)"; then \ | |
128 | $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \ | |
129 | so_img_name=$$(readlink $(DESTDIR)$(libdir)/libkmod.so) && \ | |
130 | so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \ | |
131 | ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libkmod.so && \ | |
132 | mv $(DESTDIR)$(libdir)/libkmod.so.* $(DESTDIR)$(rootlibdir); \ | |
133 | fi | |
134 | ||
135 | uninstall-hook: | |
136 | rm -f $(DESTDIR)$(rootlibdir)/libkmod.so* | |
137 | ||
138 | if BUILD_TOOLS | |
139 | bin_PROGRAMS = tools/kmod | |
140 | ||
141 | noinst_SCRIPTS = \ | |
142 | tools/insmod tools/rmmod tools/lsmod \ | |
143 | tools/modprobe tools/modinfo tools/depmod | |
144 | ||
145 | tools_kmod_SOURCES = \ | |
146 | tools/kmod.c tools/kmod.h tools/lsmod.c \ | |
147 | tools/rmmod.c tools/insmod.c \ | |
148 | tools/modinfo.c tools/modprobe.c \ | |
149 | tools/depmod.c tools/log.h tools/log.c \ | |
150 | tools/static-nodes.c | |
151 | ||
152 | if BUILD_EXPERIMENTAL | |
153 | tools_kmod_SOURCES += \ | |
154 | tools/insert.c \ | |
155 | tools/remove.c | |
156 | endif | |
157 | ||
158 | tools_kmod_LDADD = \ | |
159 | shared/libshared.la \ | |
160 | libkmod/libkmod-internal.la | |
161 | ||
162 | ${noinst_SCRIPTS}: tools/kmod | |
163 | $(AM_V_GEN) ($(RM) $@; \ | |
164 | $(LN_S) $(notdir $<) $@) | |
165 | endif | |
166 | ||
167 | # ------------------------------------------------------------------------------ | |
168 | # PYTHON BINDINGS | |
169 | # ------------------------------------------------------------------------------ | |
170 | ||
171 | CYTHON_FLAGS_VERBOSE_ = | |
172 | CYTHON_FLAGS_VERBOSE_0 = | |
173 | CYTHON_FLAGS_VERBOSE_1 = -v | |
174 | CYTHON_FLAGS = $(CYTHON_FLAGS_VERBOSE_$(V)) | |
175 | AM_V_CYTHON = $(am__v_CYTHON_$(V)) | |
176 | am__v_CYTHON_ = $(am__v_CYTHON_$(AM_DEFAULT_VERBOSITY)) | |
177 | am__v_CYTHON_0 = @echo " CYTHON " $@; | |
178 | ||
179 | .pyx.c: | |
180 | $(AM_V_CYTHON)$(CYTHON) -o $@ $< | |
181 | ||
182 | %.py: %.py.in Makefile | |
183 | $(SED_PROCESS) | |
184 | ||
185 | # Remove some warnings for generated code | |
186 | PYTHON_NOWARN = -Wno-redundant-decls -Wno-shadow -Wno-strict-aliasing | |
187 | ||
188 | CPYTHON_MODULE_CFLAGS = \ | |
189 | $(AM_CFLAGS) -DCPYTHON_COMPILING_IN_PYPY=0 \ | |
190 | $(PYTHON_NOWARN) $(PYTHON_CFLAGS) \ | |
191 | -fvisibility=default | |
192 | # Filter -Wl,--no-undefined to fix build with python 3.8 | |
193 | comma = , | |
194 | CPYTHON_MODULE_LDFLAGS = $(subst -Wl$(comma)--no-undefined,,$(AM_LDFLAGS)) | |
195 | CPYTHON_MODULE_LDFLAGS += -module -avoid-version -shared | |
196 | ||
197 | if BUILD_PYTHON | |
198 | pkgpyexec_LTLIBRARIES = \ | |
199 | libkmod/python/kmod/kmod.la \ | |
200 | libkmod/python/kmod/list.la \ | |
201 | libkmod/python/kmod/module.la \ | |
202 | libkmod/python/kmod/_util.la | |
203 | ||
204 | libkmod_python_kmod_kmod_la_SOURCES = libkmod/python/kmod/kmod.c | |
205 | libkmod_python_kmod_kmod_la_CFLAGS = $(CPYTHON_MODULE_CFLAGS) | |
206 | libkmod_python_kmod_kmod_la_LDFLAGS = $(CPYTHON_MODULE_LDFLAGS) | |
207 | libkmod_python_kmod_kmod_la_LIBADD = $(PYTHON_LIBS) libkmod/libkmod.la | |
208 | ||
209 | libkmod_python_kmod_list_la_SOURCES = libkmod/python/kmod/list.c | |
210 | libkmod_python_kmod_list_la_CFLAGS = $(CPYTHON_MODULE_CFLAGS) | |
211 | libkmod_python_kmod_list_la_LDFLAGS = $(CPYTHON_MODULE_LDFLAGS) | |
212 | libkmod_python_kmod_list_la_LIBADD = $(PYTHON_LIBS) libkmod/libkmod.la | |
213 | ||
214 | libkmod_python_kmod_module_la_SOURCES = libkmod/python/kmod/module.c | |
215 | libkmod_python_kmod_module_la_CFLAGS = $(CPYTHON_MODULE_CFLAGS) | |
216 | libkmod_python_kmod_module_la_LDFLAGS = $(CPYTHON_MODULE_LDFLAGS) | |
217 | libkmod_python_kmod_module_la_LIBADD = $(PYTHON_LIBS) libkmod/libkmod.la | |
218 | ||
219 | libkmod_python_kmod__util_la_SOURCES = libkmod/python/kmod/_util.c | |
220 | libkmod_python_kmod__util_la_CFLAGS = $(CPYTHON_MODULE_CFLAGS) | |
221 | libkmod_python_kmod__util_la_LDFLAGS = $(CPYTHON_MODULE_LDFLAGS) | |
222 | libkmod_python_kmod__util_la_LIBADD = $(PYTHON_LIBS) libkmod/libkmod.la | |
223 | ||
224 | BUILT_FILES += \ | |
225 | $(libkmod_python_kmod_kmod_la_SOURCES) \ | |
226 | $(libkmod_python_kmod_list_la_SOURCES) \ | |
227 | $(libkmod_python_kmod_module_la_SOURCES) \ | |
228 | $(libkmod_python_kmod__util_la_SOURCES) | |
229 | ||
230 | dist_pkgpyexec_PYTHON = \ | |
231 | libkmod/python/kmod/error.py \ | |
232 | libkmod/python/kmod/__init__.py \ | |
233 | libkmod/python/kmod/version.py | |
234 | ||
235 | BUILT_FILES += libkmod/python/kmod/version.py | |
236 | ||
237 | endif | |
238 | # ------------------------------------------------------------------------------ | |
239 | # TESTSUITE | |
240 | # ------------------------------------------------------------------------------ | |
241 | ||
242 | EXTRA_DIST += testsuite/populate-modules.sh | |
243 | ||
244 | MODULE_PLAYGROUND = testsuite/module-playground | |
245 | ROOTFS = testsuite/rootfs | |
246 | ROOTFS_PRISTINE = $(top_srcdir)/testsuite/rootfs-pristine | |
247 | CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(dir $(ROOTFS)) && \ | |
248 | cp -r $(ROOTFS_PRISTINE) $(ROOTFS) && \ | |
249 | find $(ROOTFS) -type d -exec chmod +w {} \; && \ | |
250 | find $(ROOTFS) -type f -name .gitignore -exec rm -f {} \; && \ | |
251 | $(top_srcdir)/testsuite/populate-modules.sh \ | |
252 | $(MODULE_PLAYGROUND) $(ROOTFS) $(top_builddir)/config.h ) && \ | |
253 | touch testsuite/stamp-rootfs | |
254 | ||
255 | build-module-playground: | |
256 | $(AM_V_GEN)if test "$(top_srcdir)" != "$(top_builddir)"; then \ | |
257 | $(RM) -rf testsuite/module-playground && \ | |
258 | cp -r $(top_srcdir)/$(MODULE_PLAYGROUND) $(top_builddir)/$(MODULE_PLAYGROUND) && \ | |
259 | find $(top_builddir)/$(MODULE_PLAYGROUND) -type d -exec chmod +w {} \; ; \ | |
260 | fi | |
261 | if BUILD_MODULES | |
262 | $(MAKE) -C $(MODULE_PLAYGROUND) | |
263 | else | |
264 | $(MAKE) -C $(MODULE_PLAYGROUND) FAKE_BUILD=1 | |
265 | endif | |
266 | ||
267 | ||
268 | rootfs: build-module-playground | |
269 | $(CREATE_ROOTFS) | |
270 | ||
271 | .PHONY: rootfs build-playground | |
272 | ||
273 | $(ROOTFS): $(ROOTFS_PRISTINE) | |
274 | $(CREATE_ROOTFS) | |
275 | ||
276 | TESTSUITE_OVERRIDE_LIBS = \ | |
277 | testsuite/uname.la testsuite/path.la \ | |
278 | testsuite/init_module.la \ | |
279 | testsuite/delete_module.la | |
280 | TESTSUITE_OVERRIDE_LIBS_LDFLAGS = \ | |
281 | avoid-version -module -shared -export-dynamic -rpath /nowhere -ldl | |
282 | ||
283 | check-am: rootfs | |
284 | ||
285 | ||
286 | EXTRA_DIST += \ | |
287 | testsuite/module-playground/cache \ | |
288 | testsuite/module-playground/dummy.pkcs7 \ | |
289 | testsuite/module-playground/dummy.sha1 \ | |
290 | testsuite/module-playground/dummy.sha256 \ | |
291 | testsuite/module-playground/Makefile \ | |
292 | testsuite/module-playground/Makefile.arch \ | |
293 | testsuite/module-playground/mod-fake-cciss.c \ | |
294 | testsuite/module-playground/mod-fake-hpsa.c \ | |
295 | testsuite/module-playground/mod-fake-scsi-mod.c \ | |
296 | testsuite/module-playground/mod-foo-a.c \ | |
297 | testsuite/module-playground/mod-foo-b.c \ | |
298 | testsuite/module-playground/mod-foo.c \ | |
299 | testsuite/module-playground/mod-foo-c.c \ | |
300 | testsuite/module-playground/mod-loop-a.c \ | |
301 | testsuite/module-playground/mod-loop-b.c \ | |
302 | testsuite/module-playground/mod-loop-c.c \ | |
303 | testsuite/module-playground/mod-loop-d.c \ | |
304 | testsuite/module-playground/mod-loop-e.c \ | |
305 | testsuite/module-playground/mod-loop-f.c \ | |
306 | testsuite/module-playground/mod-loop-g.c \ | |
307 | testsuite/module-playground/mod-loop-h.c \ | |
308 | testsuite/module-playground/mod-loop-i.c \ | |
309 | testsuite/module-playground/mod-loop-j.c \ | |
310 | testsuite/module-playground/mod-loop-k.c \ | |
311 | testsuite/module-playground/mod-loop.h \ | |
312 | testsuite/module-playground/mod-simple.c \ | |
313 | testsuite/module-playground/mod-simple-i386.ko \ | |
314 | testsuite/module-playground/mod-simple-sparc64.ko \ | |
315 | testsuite/module-playground/mod-simple-x86_64.ko \ | |
316 | testsuite/module-playground/README | |
317 | ||
318 | check_LTLIBRARIES = $(TESTSUITE_OVERRIDE_LIBS) | |
319 | ||
320 | testsuite_uname_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) | |
321 | testsuite_path_la_CPPFLAGS = $(AM_CPPFLAGS) \ | |
322 | -DABS_TOP_BUILDDIR=\"$(abs_top_builddir)\" | |
323 | testsuite_path_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) | |
324 | ||
325 | testsuite_delete_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) | |
326 | testsuite_init_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) | |
327 | testsuite_init_module_la_SOURCES = testsuite/init_module.c \ | |
328 | testsuite/stripped-module.h | |
329 | testsuite_init_module_la_LIBADD = libkmod/libkmod-internal.la | |
330 | ||
331 | TESTSUITE_CPPFLAGS = $(AM_CPPFLAGS) \ | |
332 | -DTESTSUITE_ROOTFS=\"$(abs_top_builddir)/$(ROOTFS)/\" \ | |
333 | -DABS_TOP_BUILDDIR=\"$(abs_top_builddir)\" | |
334 | TESTSUITE_LDADD = \ | |
335 | testsuite/libtestsuite.la libkmod/libkmod-internal.la \ | |
336 | shared/libshared.la | |
337 | ||
338 | if KMOD_SYSCONFDIR_NOT_ETC | |
339 | TESTSUITE_CPPFLAGS += -DKMOD_SYSCONFDIR_NOT_ETC | |
340 | endif | |
341 | ||
342 | check_LTLIBRARIES += testsuite/libtestsuite.la | |
343 | testsuite_libtestsuite_la_SOURCES = \ | |
344 | testsuite/testsuite.c testsuite/testsuite.h | |
345 | testsuite_libtestsuite_la_DEPENDENCIES = \ | |
346 | $(ROOTFS) $(TESTSUITE_OVERRIDE_LIBS) | |
347 | testsuite_libtestsuite_la_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
348 | testsuite_libtestsuite_la_LIBADD = -lrt | |
349 | ||
350 | TESTSUITE = \ | |
351 | testsuite/test-hash \ | |
352 | testsuite/test-array \ | |
353 | testsuite/test-scratchbuf \ | |
354 | testsuite/test-strbuf \ | |
355 | testsuite/test-init \ | |
356 | testsuite/test-initstate \ | |
357 | testsuite/test-testsuite testsuite/test-loaded \ | |
358 | testsuite/test-modinfo testsuite/test-util testsuite/test-new-module \ | |
359 | testsuite/test-modprobe testsuite/test-blacklist \ | |
360 | testsuite/test-dependencies testsuite/test-depmod \ | |
361 | testsuite/test-list | |
362 | ||
363 | if BUILD_EXPERIMENTAL | |
364 | TESTSUITE += \ | |
365 | testsuite/test-tools | |
366 | endif | |
367 | ||
368 | check_PROGRAMS = $(TESTSUITE) | |
369 | TESTS = $(TESTSUITE) | |
370 | ||
371 | testsuite_test_testsuite_LDADD = \ | |
372 | testsuite/libtestsuite.la shared/libshared.la | |
373 | testsuite_test_testsuite_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
374 | ||
375 | testsuite_test_hash_LDADD = $(TESTSUITE_LDADD) | |
376 | testsuite_test_hash_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
377 | ||
378 | testsuite_test_array_LDADD = $(TESTSUITE_LDADD) | |
379 | testsuite_test_array_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
380 | ||
381 | testsuite_test_scratchbuf_LDADD = $(TESTSUITE_LDADD) | |
382 | testsuite_test_scratchbuf_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
383 | ||
384 | testsuite_test_strbuf_LDADD = $(TESTSUITE_LDADD) | |
385 | testsuite_test_strbuf_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
386 | ||
387 | testsuite_test_init_LDADD = $(TESTSUITE_LDADD) | |
388 | testsuite_test_init_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
389 | testsuite_test_initstate_LDADD = $(TESTSUITE_LDADD) | |
390 | testsuite_test_initstate_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
391 | testsuite_test_loaded_LDADD = $(TESTSUITE_LDADD) | |
392 | testsuite_test_loaded_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
393 | testsuite_test_modinfo_LDADD = $(TESTSUITE_LDADD) | |
394 | testsuite_test_modinfo_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
395 | testsuite_test_util_LDADD = $(TESTSUITE_LDADD) | |
396 | testsuite_test_util_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
397 | testsuite_test_new_module_LDADD = $(TESTSUITE_LDADD) | |
398 | testsuite_test_new_module_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
399 | testsuite_test_modprobe_LDADD = $(TESTSUITE_LDADD) | |
400 | testsuite_test_modprobe_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
401 | testsuite_test_blacklist_LDADD = $(TESTSUITE_LDADD) | |
402 | testsuite_test_blacklist_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
403 | testsuite_test_dependencies_LDADD = $(TESTSUITE_LDADD) | |
404 | testsuite_test_dependencies_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
405 | testsuite_test_depmod_LDADD = $(TESTSUITE_LDADD) | |
406 | testsuite_test_depmod_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
407 | testsuite_test_list_LDADD = $(TESTSUITE_LDADD) | |
408 | testsuite_test_list_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
409 | ||
410 | if BUILD_EXPERIMENTAL | |
411 | testsuite_test_tools_LDADD = $(TESTSUITE_LDADD) | |
412 | testsuite_test_tools_CPPFLAGS = $(TESTSUITE_CPPFLAGS) | |
413 | endif | |
414 | ||
415 | testsuite-distclean: | |
416 | $(RM) -r $(ROOTFS) | |
417 | $(RM) testsuite/stamp-rootfs | |
418 | $(MAKE) -C testsuite/module-playground/ clean | |
419 | if test "$(top_srcdir)" != "$(top_builddir)"; then \ | |
420 | $(RM) -rf testsuite/module-playground; \ | |
421 | fi | |
422 | ||
423 | DISTCLEAN_LOCAL_HOOKS += testsuite-distclean | |
424 | EXTRA_DIST += testsuite/rootfs-pristine | |
425 | ||
426 | DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --enable-python --sysconfdir=/etc \ | |
427 | --with-zlib --with-zstd --with-openssl \ | |
428 | --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) | |
429 | ||
430 | distclean-local: $(DISTCLEAN_LOCAL_HOOKS) | |
431 | ||
432 | buildtest-TESTS: | |
433 | $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS) | |
434 | ||
435 | # ------------------------------------------------------------------------------ | |
436 | # coverage | |
437 | # ------------------------------------------------------------------------------ | |
438 | ||
439 | # .PHONY so it always rebuilds it | |
440 | .PHONY: coverage lcov-run lcov-report coverage-sync | |
441 | ||
442 | # run lcov from scratch, always | |
443 | coverage: all | |
444 | $(MAKE) lcov-run | |
445 | $(MAKE) lcov-report | |
446 | ||
447 | coverage_dir = coverage | |
448 | coverage_opts = --base-directory $(srcdir) --directory $(builddir) \ | |
449 | --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))' | |
450 | ||
451 | if ENABLE_COVERAGE | |
452 | # reset run coverage tests | |
453 | lcov-run: | |
454 | @rm -rf $(coverage_dir) | |
455 | lcov $(coverage_opts) --zerocounters | |
456 | -$(MAKE) check | |
457 | ||
458 | # generate report based on current coverage data | |
459 | lcov-report: | |
460 | $(MKDIR_P) $(coverage_dir) | |
461 | lcov $(coverage_opts) --capture --no-external --ignore-errors graph \ | |
462 | | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info | |
463 | lcov --remove $(coverage_dir)/.lcov.info --output-file $(coverage_dir)/.lcov-clean.info 'test-*' | |
464 | genhtml -t "kmod test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov-clean.info | |
465 | @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html" | |
466 | ||
467 | else | |
468 | ||
469 | lcov-run lcov-report: | |
470 | echo "Need to reconfigure with --enable-coverage" | |
471 | ||
472 | endif | |
473 | ||
474 | # ------------------------------------------------------------------------------ | |
475 | # coverity | |
476 | # ------------------------------------------------------------------------------ | |
477 | ||
478 | kmod-coverity-%.tar.xz: | |
479 | rm -rf $< cov-int | |
480 | ./autogen.sh c --disable-python --disable-manpages | |
481 | make clean | |
482 | cov-build --dir cov-int make -j 4 | |
483 | tar caf $@ cov-int | |
484 | ||
485 | coverity-tar: kmod-coverity-$(shell git describe 2>/dev/null).tar.xz | |
486 | ||
487 | coverity-sync: kmod-coverity-$(shell git describe 2>/dev/null).tar.xz | |
488 | @echo "uploading coverity tarball" | |
489 | @curl --form token=$(COVERITY_KMOD_TOKEN) \ | |
490 | --form email=lucas.de.marchi@gmail.com \ | |
491 | --form file=@$< \ | |
492 | --form version="$(shell git describe)" \ | |
493 | --form description="" \ | |
494 | https://scan.coverity.com/builds?project=kmod | |
495 | ||
496 | coverity-clean: | |
497 | rm -rf kmod-coverity-*.tar.xz cov-int | |
498 | ||
499 | # ------------------------------------------------------------------------------ | |
500 | # custom release helpers | |
501 | # ------------------------------------------------------------------------------ | |
502 | ||
503 | git-release: | |
504 | head -1 NEWS | grep -q "kmod $(VERSION)" | |
505 | git commit -a -m "kmod $(VERSION)" | |
506 | git tag -m "kmod $(VERSION)" -s v$(VERSION) | |
507 | git gc --prune=0 | |
508 | ||
509 | kmod-$(VERSION).tar.xz: | |
510 | make distcheck | |
511 | ||
512 | kmod-$(VERSION).tar.sign: | |
513 | xz -d -c kmod-$(VERSION).tar.xz | gpg --armor --detach-sign --output kmod-$(VERSION).tar.sign | |
514 | ||
515 | tar: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign | |
516 | ||
517 | tar-sync: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign | |
518 | kup put kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign /pub/linux/utils/kernel/kmod/ | |
519 | ||
520 | # ------------------------------------------------------------------------------ | |
521 | # mkosi | |
522 | # ------------------------------------------------------------------------------ | |
523 | ||
524 | DISTRO ?= "arch" | |
525 | ||
526 | mkosi: | |
527 | -$(MKDIR_P) $(top_srcdir)/testsuite/mkosi/mkosi.cache | |
528 | $(MKOSI) -C $(top_srcdir)/testsuite/mkosi --build-sources ../../ --default mkosi.${DISTRO} -fi |