1 ACLOCAL_AMFLAGS = -I m4
3 insmod_SOURCES = insmod.c testing.h
4 lsmod_SOURCES = lsmod.c testing.h
5 modprobe_SOURCES = modprobe.c zlibsupport.c zlibsupport.h testing.h
6 rmmod_SOURCES = rmmod.c testing.h
7 depmod_SOURCES = depmod.c zlibsupport.c tables.c \
8 zlibsupport.h tables.h testing.h
9 modinfo_SOURCES = modinfo.c zlibsupport.c zlibsupport.h testing.h
10 modindex_SOURCES = modindex.c zlibsupport.c zlibsupport.h testing.h
12 insmod_static_SOURCES = insmod.c
13 insmod_static_LDFLAGS = -static
14 # We don't want the $(zlib_flags) here: that makes a dynamic executable
15 insmod_static_LDADD = libmodtools.a
17 EXTRA_insmod_SOURCES =
19 EXTRA_modprobe_SOURCES =
21 EXTRA_insmod_static_SOURCES =
22 EXTRA_depmod_SOURCES =
23 EXTRA_modinfo_SOURCES =
25 libmodtools_a_SOURCES = util.c logging.c index.c config_filter.c elfops.c \
26 util.h depmod.h logging.h index.h list.h config_filter.h elfops.h
27 libmodtools_a_CFLAGS = -ffunction-sections
29 EXTRA_libmodtools_a_SOURCES = elfops_core.c
31 insmod_LDADD = $(LDADD) libmodtools.a
32 lsmod_LDADD = $(LDADD) libmodtools.a
33 modprobe_LDADD = $(LDADD) libmodtools.a
34 rmmod_LDADD = $(LDADD) libmodtools.a
35 depmod_LDADD = $(LDADD) libmodtools.a
36 modinfo_LDADD = $(LDADD) libmodtools.a
37 modindex_LDADD = $(LDADD) libmodtools.a
39 MAN5 = modprobe.conf.5 modules.dep.5 depmod.conf.5 modprobe.d.5
40 MAN8 = depmod.8 insmod.8 lsmod.8 rmmod.8 modprobe.8 modinfo.8
41 SGML = $(addprefix doc/, $(MAN5:%.5=%.sgml) $(MAN8:%.8=%.sgml))
42 dist_man_MANS = $(MAN5) $(MAN8)
43 # If they haven't overridden mandir, fix it (never /man!)
44 mandir =$(shell if [ @mandir@ = $(prefix)/man ]; then if [ $(prefix) = / ]; then echo /usr/share/man; else echo $(prefix)/share/man; fi; else echo @mandir@; fi)
46 TESTSUITE := $(shell test -e @srcdir@/tests && find @srcdir@/tests -type f ! -name '*~')
48 EXTRA_DIST = generate-modprobe.conf FAQ CODING stress_modules.sh install-with-care $(SGML) $(man_MANS) $(TESTSUITE)
50 sbin_PROGRAMS = insmod modprobe rmmod depmod modinfo
52 sbin_PROGRAMS += insmod.static
55 noinst_PROGRAMS=modindex
56 noinst_LIBRARIES = libmodtools.a
57 INSTALL = $(SHELL) $(top_srcdir)/install-with-care
59 DIST_DIR := /data/work/releases/module-init-tools/
61 MAINTAINERCLEANFILES := $(man_MANS)
63 # docbook2man writes file itself, doesn't do stdout.
65 if [ "$(DOCBOOKTOMAN)" = "docbook2man" ]; then \
66 $(DOCBOOKTOMAN) $< > /dev/null 2>&1; \
68 $(DOCBOOKTOMAN) $< 2>&1 > $@ | sed 's/^[^:]*://'; \
72 if [ "$(DOCBOOKTOMAN)" = "docbook2man" ]; then \
73 $(DOCBOOKTOMAN) $< > /dev/null 2>&1; \
75 $(DOCBOOKTOMAN) $< 2>&1 > $@ | sed 's/^[^:]*://'; \
78 # docbook2man creates extra crap files which need cleaning.
79 distclean-local: killbuildmanpages
82 rm -f doc/*.tmp manpage.refs manpage.links
84 tarball: $(DIST_DIR)/module-init-tools-$(VERSION).tar.gz
86 $(DIST_DIR)/module-init-tools-$(VERSION).tar.gz: dist
87 mv module-init-tools-$(VERSION).tar.gz $@
89 srpm: $(DIST_DIR)/module-init-tools-$(VERSION).tar.gz
90 ln -sf $(DIST_DIR)/module-init-tools-$(VERSION).tar.gz /usr/src/rpm/SOURCES/
91 set -e; RELEASE=`grep '^Release:' /usr/src/rpm/SPECS/modutils.spec | awk '{ print $$2 }'`; \
92 if [ "`grep '%define mit_ver' /usr/src/rpm/SPECS/modutils.spec | awk '{print $$3}'`" != $(VERSION) ]; then \
93 sed -e "s/Release: $$RELEASE/Release: `expr $$RELEASE + 1`/" -e 's/%define mit_ver.*/%define mit_ver $(VERSION)/' < /usr/src/rpm/SPECS/modutils.spec > /tmp/modutils.spec; \
94 rpm -ba /tmp/modutils.spec; \
95 mv /usr/src/rpm/SRPMS/modutils-2.4.21-`expr $$RELEASE + 1`.src.rpm $(DIST_DIR); \
96 mv /tmp/modutils.spec /usr/src/rpm/SPECS/modutils.spec; \
98 rpm -ba /usr/src/rpm/SPECS/modutils.spec; \
99 mv /usr/src/rpm/SRPMS/modutils-2.4.21-$$RELEASE.src.rpm $(DIST_DIR); \
105 echo '#! /bin/sh' > $@
106 echo '# Install the testsuite over this dir. ' >> $@
109 $(DIST_DIR)/module-init-tools-testsuite-$(VERSION).tar.gz:
110 ln -sfn `pwd` /tmp/module-init-tools-$(VERSION)
111 cd /tmp && tar --exclude '*~' -c -z -f $@ module-init-tools-$(VERSION)/tests
112 rm /tmp/module-init-tools-$(VERSION)
114 release: check clean tarball