@@ -152,7 +152,6 @@ module 8123.ko, which is built from the following files::
152
152
8123_if.c
153
153
8123_if.h
154
154
8123_pci.c
155
- 8123_bin.o_shipped <= Binary blob
156
155
157
156
Shared Makefile
158
157
---------------
@@ -170,7 +169,7 @@ Shared Makefile
170
169
ifneq ($(KERNELRELEASE),)
171
170
# kbuild part of makefile
172
171
obj-m := 8123.o
173
- 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
172
+ 8123-y := 8123_if.o 8123_pci.o
174
173
175
174
else
176
175
# normal makefile
@@ -179,10 +178,6 @@ Shared Makefile
179
178
default:
180
179
$(MAKE) -C $(KDIR) M=$$PWD
181
180
182
- # Module specific targets
183
- genbin:
184
- echo "X" > 8123_bin.o_shipped
185
-
186
181
endif
187
182
188
183
The check for KERNELRELEASE is used to separate the two parts
@@ -204,43 +199,19 @@ Separate Kbuild File and Makefile
204
199
205
200
--> filename: Kbuild
206
201
obj-m := 8123.o
207
- 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
202
+ 8123-y := 8123_if.o 8123_pci.o
208
203
209
204
--> filename: Makefile
210
205
KDIR ?= /lib/modules/`uname -r`/build
211
206
212
207
default:
213
208
$(MAKE) -C $(KDIR) M=$$PWD
214
209
215
- # Module specific targets
216
- genbin:
217
- echo "X" > 8123_bin.o_shipped
218
-
219
210
The split in example 2 is questionable due to the simplicity of
220
211
each file; however, some external modules use makefiles
221
212
consisting of several hundred lines, and here it really pays
222
213
off to separate the kbuild part from the rest.
223
214
224
- Binary Blobs
225
- ------------
226
-
227
- Some external modules need to include an object file as a blob.
228
- kbuild has support for this, but requires the blob file to be
229
- named <filename>_shipped. When the kbuild rules kick in, a copy
230
- of <filename>_shipped is created with _shipped stripped off,
231
- giving us <filename>. This shortened filename can be used in
232
- the assignment to the module.
233
-
234
- Throughout this section, 8123_bin.o_shipped has been used to
235
- build the kernel module 8123.ko; it has been included as
236
- 8123_bin.o::
237
-
238
- 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
239
-
240
- Although there is no distinction between the ordinary source
241
- files and the binary file, kbuild will pick up different rules
242
- when creating the object file for the module.
243
-
244
215
Building Multiple Modules
245
216
-------------------------
246
217
@@ -301,7 +272,7 @@ Single Subdirectory
301
272
obj-m := 8123.o
302
273
303
274
ccflags-y := -I $(src)/include
304
- 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
275
+ 8123-y := 8123_if.o 8123_pci.o
305
276
306
277
Several Subdirectories
307
278
----------------------
0 commit comments