File: modules.mk

package info (click to toggle)
kernel-package 12.036%2Bnmu1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,848 kB
  • ctags: 657
  • sloc: perl: 2,887; sh: 840; makefile: 219
file content (263 lines) | stat: -rw-r--r-- 13,974 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
######################### -*- Mode: Makefile-Gmake -*- ########################
## modules.mk --- 
## Author           : Manoj Srivastava ( srivasta@glaurung.internal.golden-gryphon.com ) 
## Created On       : Mon Oct 31 10:37:44 2005
## Created On Node  : glaurung.internal.golden-gryphon.com
## Last Modified By : Manoj Srivastava
## Last Modified On : Thu Oct  9 15:11:12 2008
## Last Machine Used: anzu.internal.golden-gryphon.com
## Update Count     : 14
## Status           : Unknown, Use with caution!
## HISTORY          : 
## Description      : This file contains the targets responsible for third party
##                    module interaction. 
##
## arch-tag: 0c2c8a37-03da-48a2-9d87-27330c559025
##
## 
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
##
###############################################################################

define old_mod_inst_cmds
        @(                                                           \
        MODLIB=$(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE);           \
        cd modules;                                                  \
        MODULES="";                                                  \
        inst_mod() { These="$$(cat $$1)"; MODULES="$$MODULES $$These"; \
                mkdir -p $$MODLIB/$$2; cp $$These $$MODLIB/$$2;               \
                echo Installing modules under $$MODLIB/$$2; \
        }; \
                                                                               \
	if [ -f BLOCK_MODULES    ]; then inst_mod BLOCK_MODULES    block; fi; \
	if [ -f NET_MODULES      ]; then inst_mod NET_MODULES      net;   fi; \
	if [ -f IPV4_MODULES     ]; then inst_mod IPV4_MODULES     ipv4;  fi; \
	if [ -f IPV6_MODULES     ]; then inst_mod IPV6_MODULES     ipv6;  fi; \
         if [ -f ATM_MODULES      ]; then inst_mod ATM_MODULES      atm;   fi; \
	if [ -f SCSI_MODULES     ]; then inst_mod SCSI_MODULES     scsi;  fi; \
	if [ -f FS_MODULES       ]; then inst_mod FS_MODULES       fs;    fi; \
	if [ -f NLS_MODULES      ]; then inst_mod NLS_MODULES      fs;    fi;        \
	if [ -f CDROM_MODULES    ]; then inst_mod CDROM_MODULES    cdrom; fi;        \
	if [ -f HAM_MODULES      ]; then inst_mod HAM_MODULES      net;   fi;        \
	if [ -f SOUND_MODULES    ]; then inst_mod SOUND_MODULES    sound; fi;        \
	if [ -f VIDEO_MODULES    ]; then inst_mod VIDEO_MODULES    video; fi;        \
	if [ -f FC4_MODULES      ]; then inst_mod FC4_MODULES      fc4;   fi;        \
	if [ -f IRDA_MODULES     ]; then inst_mod IRDA_MODULES     net;   fi;        \
         if [ -f USB_MODULES      ]; then inst_mod USB_MODULES      usb;   fi;        \
         if [ -f SK98LIN_MODULES  ]; then inst_mod SK98LIN_MODULES  net;   fi;        \
         if [ -f SKFP_MODULES     ]; then inst_mod SKFP_MODULES     net;   fi;        \
         if [ -f IEEE1394_MODULES ]; then inst_mod IEEE1394_MODULES ieee1394; fi;     \
         if [ -f PCMCIA_MODULES   ]; then inst_mod PCMCIA_MODULES pcmcia;   fi;       \
         if [ -f PCMCIA_NET_MODULES ]; then inst_mod PCMCIA_NET_MODULES pcmcia; fi;   \
         if [ -f PCMCIA_CHAR_MODULES ]; then inst_mod PCMCIA_CHAR_MODULES pcmcia; fi; \
         if [ -f PCMCIA_SCSI_MODULES ]; then inst_mod PCMCIA_SCSI_MODULES pcmcia; fi; \
                                                                                      \
        for f in *.o; do [ -r $$f ] && echo $$f; done > .allmods; \
        echo $$MODULES | tr ' ' '\n' | sort | comm -23 .allmods - > .misc; \
        if [ -s .misc ]; then inst_mod .misc misc; fi; \
        rm -f .misc .allmods; \
        )
endef

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_MOD_STRIP:=1
endif

# only generate module image packages
modules-image modules_image: .config
ifeq ($(strip $(shell grep -E ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),)
	@echo Modules not configured, so not making $@
else
ifneq ($(strip $(HAVE_VERSION_MISMATCH)),)
	@(echo "The changelog says we are creating $(saved_version), but I thought the version is $(KERNELRELEASE)"; exit 1)
endif
	$(if $(subst $(strip $(UTS_RELEASE_VERSION)),,$(strip $(KERNELRELEASE))), \
		echo "The UTS Release version in $(UTS_RELEASE_HEADER)"; \
		echo "     \"$(strip $(UTS_RELEASE_VERSION))\" "; \
		echo "does not match current version:"; \
		echo "     \"$(strip $(KERNELRELEASE))\" "; \
		echo "Please correct this."; \
		exit 2,)
	-for module in $(valid_modules) ; do                       \
          if test -d  $$module; then                                \
	    (cd $$module;                                          \
              if ./debian/rules KVERS="$(KERNELRELEASE)" KSRC="$(SRCTOP)" \
                             KMAINT="$(pgp)" KEMAIL="$(email)"      \
                             KPKG_DEST_DIR="$(KPKG_DEST_DIR)"       \
                             KPKG_MAINTAINER="$(maintainer)"        \
                             KPKG_EXTRAV_ARG="$(EXTRAV_ARG)"        \
                             ARCH="$(KERNEL_ARCH)" $(CROSS_ARG)     \
                             KDREV="$(debian)" kdist_image; then    \
                  echo "Module $$module processed fine";            \
              else                                                  \
                   echo "Module $$module failed.";                  \
                   if [ "X$(strip $(ROOT_CMD))" != "X" ]; then      \
                      echo "Perhaps $$module does not understand --rootcmd?";  \
                      echo "If you see messages that indicate that it is not"; \
                      echo "in fact being built as root, please file a bug ";  \
                      echo "against $$module.";                     \
                   fi;                                              \
                   echo "Hit return to Continue";                   \
		 read ans;                                          \
              fi;                                                   \
	     );                                                     \
	  else                                                      \
               echo "Module $$module does not exist";               \
               echo "Hit return to Continue?";                      \
	  fi;                                                       \
        done
endif

# generate the modules packages and sign them
modules: .config
ifeq ($(strip $(shell grep -E ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),)
	@echo Modules not configured, so not making $@
else
ifneq ($(strip $(HAVE_VERSION_MISMATCH)),)
	@(echo "The changelog says we are creating $(saved_version), but I thought the version is $(KERNELRELEASE)"; exit 1)
endif
	$(if $(subst $(strip $(UTS_RELEASE_VERSION)),,$(strip $(KERNELRELEASE))), \
		echo "The UTS Release version in $(UTS_RELEASE_HEADER)"; \
		echo "     \"$(strip $(UTS_RELEASE_VERSION))\" "; \
		echo "does not match current version:"; \
		echo "     \"$(strip $(KERNELRELEASE))\" "; \
		echo "Please correct this."; \
		exit 2,)
	-for module in $(valid_modules) ; do                       \
          if test -d  $$module; then                                \
	    (cd $$module;                                          \
              if ./debian/rules KVERS="$(KERNELRELEASE)" KSRC="$(SRCTOP)" \
                             KMAINT="$(pgp)" KEMAIL="$(email)"      \
                             KPKG_DEST_DIR="$(KPKG_DEST_DIR)"       \
                             KPKG_MAINTAINER="$(maintainer)"        \
                             ARCH=$(KERNEL_ARCH) $(CROSS_ARG)       \
                             KPKG_EXTRAV_ARG="$(EXTRAV_ARG)"        \
                             KDREV="$(debian)" kdist; then          \
                  echo "Module $$module processed fine";            \
              else                                                  \
                   echo "Module $$module failed.";                  \
                   if [ "X$(strip $(ROOT_CMD))" != "X" ]; then      \
                      echo "Perhaps $$module does not understand --rootcmd?";  \
                      echo "If you see messages that indicate that it is not"; \
                      echo "in fact being built as root, please file a bug ";  \
                      echo "against $$module.";                     \
                   fi;                                              \
                   echo "Hit return to Continue?";                  \
		 read ans;                                          \
              fi;                                                   \
	     );                                                     \
	  else                                                      \
               echo "Module $$module does not exist";               \
               echo "Hit return to Continue?";                      \
	  fi;                                                       \
        done
endif

# configure the modules packages
modules-config modules_config: .config
ifeq ($(strip $(shell grep -E ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),)
	@echo Modules not configured, so not making $@
else
ifneq ($(strip $(HAVE_VERSION_MISMATCH)),)
	@(echo "The changelog says we are creating $(saved_version), but I thought the version is $(KERNELRELEASE)"; exit 1)
endif
	$(if $(subst $(strip $(UTS_RELEASE_VERSION)),,$(strip $(KERNELRELEASE))), \
		echo "The UTS Release version in $(UTS_RELEASE_HEADER)"; \
		echo "     \"$(strip $(UTS_RELEASE_VERSION))\" "; \
		echo "does not match current version:"; \
		echo "     \"$(strip $(KERNELRELEASE))\" "; \
		echo "Please correct this."; \
		exit 2,)
	-for module in $(valid_modules) ; do                       \
          if test -d  $$module; then                                \
	    (cd $$module;                                          \
              if ./debian/rules KVERS="$(KERNELRELEASE)" KSRC="$(SRCTOP)" \
                             KMAINT="$(pgp)" KEMAIL="$(email)"      \
                             KPKG_DEST_DIR="$(KPKG_DEST_DIR)"       \
                             KPKG_MAINTAINER="$(maintainer)"        \
                             ARCH=$(KERNEL_ARCH) $(CROSS_ARG)       \
                             KPKG_EXTRAV_ARG="$(EXTRAV_ARG)"        \
                             KDREV="$(debian)" kdist_configure; then\
                  echo "Module $$module configured fine";           \
              else                                                  \
                   echo "Module $$module failed to configure";      \
                   echo "Hit return to Continue?";                  \
		 read ans;                                          \
              fi;                                                   \
	     );                                                     \
	  else                                                      \
               echo "Module $$module does not exist";               \
               echo "Hit return to Continue?";                      \
	  fi;                                                      \
        done
endif

modules-clean modules_clean:
ifeq ($(strip $(shell if [ -e $(CONFIG_FILE) ]; then grep -E ^[^\#]*CONFIG_MODULES $(CONFIG_FILE); fi)),)
	@echo Modules not configured, so not making $@
else
	$(if $(subst $(strip $(UTS_RELEASE_VERSION)),,$(strip $(KERNELRELEASE))), \
		echo "The UTS Release version in $(UTS_RELEASE_HEADER)"; \
		echo "     \"$(strip $(UTS_RELEASE_VERSION))\" "; \
		echo "does not match current version:"; \
		echo "     \"$(strip $(KERNELRELEASE))\" "; \
		echo "Please correct this."; \
		exit 2,)
	-for module in $(valid_modules); do                        \
          if test -d  $$module; then                                \
	    (cd $$module;                                          \
              if ./debian/rules KVERS="$(KERNELRELEASE)" KSRC="$(SRCTOP)" \
                             KMAINT="$(pgp)" KEMAIL="$(email)"      \
                             KPKG_DEST_DIR="$(KPKG_DEST_DIR)"       \
                             KPKG_MAINTAINER="$(maintainer)"        \
                             ARCH=$(KERNEL_ARCH) $(CROSS_ARG)       \
                             KPKG_EXTRAV_ARG="$(EXTRAV_ARG)"        \
                             KDREV="$(debian)" kdist_clean; then    \
                  echo "Module $$module cleaned";                   \
              else                                                  \
                   echo "Module $$module failed to clean up";       \
                   echo "Hit return to Continue?";                  \
		 read ans;                                          \
              fi;                                                   \
	     );                                                     \
	  else                                                      \
               echo "Module $$module does not exist";               \
               echo "Hit return to Continue?";                      \
	  fi;                                                       \
        done
endif


# 		2.0.38	2.2.12	2.3.1
# BLOCK_MODULES	X	X	X
# NET_MODULES	X	X	X
# IPV4_MODULES	X	X	X
# IPV6_MODULES		X	X
# ATM_MODULES			X
# SCSI_MODULES	X	X	X
# FS_MODULES	X	X	X
# NLS_MODULES		X	X
# CDROM_MODULES	X	X	X
# HAM_MODULES		X	X
# SOUND_MODULES		X	X
# VIDEO_MODULES		X	X
# FC4_MODULES		X	X
# IRDA_MODULES		X	X
# USB_MODULES			X


#Local variables:
#mode: makefile
#End: