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 moduleops.c tables.c \
8 zlibsupport.h moduleops.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 = moduleops_core.c
23 EXTRA_modinfo_SOURCES =
25 libmodtools_a_SOURCES = util.c logging.c index.c config_filter.c \
26 util.h depmod.h logging.h index.h list.h config_filter.h
27 libmodtools_a_CFLAGS = -ffunction-sections
29 insmod_LDADD = $(LDADD) libmodtools.a
30 lsmod_LDADD = $(LDADD) libmodtools.a
31 modprobe_LDADD = $(LDADD) libmodtools.a
32 rmmod_LDADD = $(LDADD) libmodtools.a
33 depmod_LDADD = $(LDADD) libmodtools.a
34 modinfo_LDADD = $(LDADD) libmodtools.a
35 modindex_LDADD = $(LDADD) libmodtools.a
37 MAN5 = modprobe.conf.5 modules.dep.5 depmod.conf.5
38 MAN8 = depmod.8 insmod.8 lsmod.8 rmmod.8 modprobe.8 modinfo.8
39 SGML = $(addprefix doc/, $(MAN5:%.5=%.sgml) $(MAN8:%.8=%.sgml))
40 dist_man_MANS = $(MAN5) $(MAN8)
41 # If they haven't overridden mandir, fix it (never /man!)
42 mandir =$(shell if [ @mandir@ = $(prefix)/man ]; then if [ $(prefix) = / ]; then echo /usr/share/man; else echo $(prefix)/share/man; fi; else echo @mandir@; fi)
44 TESTSUITE := $(shell test -e @srcdir@/tests && find @srcdir@/tests -type f ! -name '*~')
46 EXTRA_DIST = generate-modprobe.conf modprobe.devfs FAQ CODING stress_modules.sh install-with-care $(SGML) $(man_MANS) $(TESTSUITE)
48 sbin_PROGRAMS = insmod modprobe rmmod depmod modinfo insmod.static
50 sbin_SCRIPTS = generate-modprobe.conf
51 noinst_PROGRAMS=modindex
52 noinst_LIBRARIES = libmodtools.a
53 INSTALL = $(SHELL) $(top_srcdir)/install-with-care
55 DIST_DIR := /home/rusty/devel/kernel/www/modules/
57 MAINTAINERCLEANFILES := $(man_MANS)
59 # docbook2man writes file itself, doesn't do stdout.
61 if [ "$(DOCBOOKTOMAN)" = "docbook2man" ]; then \
62 $(DOCBOOKTOMAN) $< > /dev/null 2>&1; \
64 $(DOCBOOKTOMAN) $< 2>&1 > $@ | sed 's/^[^:]*://'; \
68 if [ "$(DOCBOOKTOMAN)" = "docbook2man" ]; then \
69 $(DOCBOOKTOMAN) $< > /dev/null 2>&1; \
71 $(DOCBOOKTOMAN) $< 2>&1 > $@ | sed 's/^[^:]*://'; \
74 # docbook2man creates extra crap files which need cleaning.
75 distclean-local: killbuildmanpages
78 rm -f doc/*.tmp manpage.refs manpage.links
80 tarball: $(DIST_DIR)/module-init-tools-$(VERSION).tar.gz
82 $(DIST_DIR)/module-init-tools-$(VERSION).tar.gz: dist
83 mv module-init-tools-$(VERSION).tar.gz $@
85 srpm: $(DIST_DIR)/module-init-tools-$(VERSION).tar.gz
86 ln -sf $(DIST_DIR)/module-init-tools-$(VERSION).tar.gz /usr/src/rpm/SOURCES/
87 set -e; RELEASE=`grep '^Release:' /usr/src/rpm/SPECS/modutils.spec | awk '{ print $$2 }'`; \
88 if [ "`grep '%define mit_ver' /usr/src/rpm/SPECS/modutils.spec | awk '{print $$3}'`" != $(VERSION) ]; then \
89 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; \
90 rpm -ba /tmp/modutils.spec; \
91 mv /usr/src/rpm/SRPMS/modutils-2.4.21-`expr $$RELEASE + 1`.src.rpm $(DIST_DIR); \
92 mv /tmp/modutils.spec /usr/src/rpm/SPECS/modutils.spec; \
94 rpm -ba /usr/src/rpm/SPECS/modutils.spec; \
95 mv /usr/src/rpm/SRPMS/modutils-2.4.21-$$RELEASE.src.rpm $(DIST_DIR); \
101 echo '#! /bin/sh' > $@
102 echo '# Install the testsuite over this dir. ' >> $@
105 $(DIST_DIR)/module-init-tools-testsuite-$(VERSION).tar.gz:
106 ln -sfn `pwd` /tmp/module-init-tools-$(VERSION)
107 cd /tmp && tar --exclude '*~' -c -z -f $@ module-init-tools-$(VERSION)/tests
108 rm /tmp/module-init-tools-$(VERSION)
110 release: check clean tarball