Lines Matching +full:foo +full:- +full:supply

5 This document describes how to build an out-of-tree kernel module.
11 --- 2.1 Command Syntax
12 --- 2.2 Options
13 --- 2.3 Targets
14 --- 2.4 Building Separate Files
16 --- 3.1 Shared Makefile
17 --- 3.2 Separate Kbuild file and Makefile
18 --- 3.3 Binary Blobs
19 --- 3.4 Building Multiple Modules
21 --- 4.1 Kernel Includes
22 --- 4.2 Single Subdirectory
23 --- 4.3 Several Subdirectories
24 --- 4.4 UAPI Headers Installation
26 --- 5.1 INSTALL_MOD_PATH
27 --- 5.2 INSTALL_MOD_DIR
29 --- 6.1 Symbols From the Kernel (vmlinux + modules)
30 --- 6.2 Symbols and External Modules
31 --- 6.3 Symbols From Another External Module
33 --- 7.1 Testing for CONFIG_FOO_BAR
43 both in-tree and out-of-tree is provided. The method for building
45 out-of-tree.
48 in building out-of-tree (or "external") modules. The author of an
49 external module should supply a makefile that hides most of the
78 $ make -C <path_to_kernel_src> M=$PWD
85 $ make -C /lib/modules/`uname -r`/build M=$PWD
90 $ make -C /lib/modules/`uname -r`/build M=$PWD modules_install
97 make -C $KDIR M=$PWD
99 -C $KDIR
116 make -C $KDIR M=$PWD [target]
152 Example (The module foo.ko, consist of bar.o and baz.o)::
154 make -C $KDIR M=$PWD bar.lst
155 make -C $KDIR M=$PWD baz.o
156 make -C $KDIR M=$PWD foo.ko
157 make -C $KDIR M=$PWD ./
169 obj-m := <module_name>.o
177 <module_name>-y := <src1>.o <src2>.o ...
191 -------------------
202 --> filename: Makefile
205 obj-m := 8123.o
206 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
210 KDIR ?= /lib/modules/`uname -r`/build
213 $(MAKE) -C $(KDIR) M=$$PWD
230 -------------------------------------
239 --> filename: Kbuild
240 obj-m := 8123.o
241 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
243 --> filename: Makefile
244 KDIR ?= /lib/modules/`uname -r`/build
247 $(MAKE) -C $(KDIR) M=$$PWD
262 --> filename: Kbuild
263 obj-m := 8123.o
264 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
266 --> filename: Makefile
273 KDIR ?= /lib/modules/`uname -r`/build
276 $(MAKE) -C $(KDIR) M=$$PWD
290 ----------------
303 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
313 file. For example, if you wanted to build two modules, foo.ko
316 obj-m := foo.o bar.o
317 foo-y := <foo_srcs>
318 bar-y := <bar_srcs>
343 -------------------
354 -----------------------
359 directory, use either ccflags-y or CFLAGS_<filename>.o.
365 --> filename: Kbuild
366 obj-m := 8123.o
368 ccflags-y := -Iinclude
369 8123-y := 8123_if.o 8123_pci.o 8123_bin.o
371 Note that in the assignment there is no space between -I and
376 --------------------------
394 --> filename: Kbuild
395 obj-m := complex.o
396 complex-y := src/complex_main.o
397 complex-y += src/hal/hardwareif.o
399 ccflags-y := -I$(src)/include
400 ccflags-y += -I$(src)/src/hal/include
409 root of the kernel tree (the argument to "-C") and therefore an
415 -----------------------------
418 fashion to the in-tree counterpart drivers. kbuild supports
419 running headers_install target in an out-of-tree. The location
439 --------------------
450 calling "make." This has effect when installing both in-tree
451 and out-of-tree modules.
454 -------------------
462 $ make INSTALL_MOD_DIR=gandalf -C $KDIR \
481 -----------------------------------------------
492 0xe1cc2a05 usb_stor_suspend drivers/usb/storage/usb-storage EXPORT_SYMBOL_GPL USB_STORAGE
506 --------------------------------
516 ----------------------------------------
523 NOTE: The method with a top-level kbuild file is recommended
526 Use a top-level kbuild file
527 If you have two modules, foo.ko and bar.ko, where
528 foo.ko needs symbols from bar.ko, you can use a
529 common top-level kbuild file so both modules are
533 ./foo/ <= contains foo.ko
536 The top-level kbuild file would then look like::
539 obj-m := foo/ bar/
543 $ make -C $KDIR M=$PWD
549 If it is impractical to add a top-level kbuild file,
560 ------------------------------
568 obj-$(CONFIG_EXT2_FS) += ext2.o
570 ext2-y := balloc.o bitmap.o dir.o
571 ext2-$(CONFIG_EXT2_FS_XATTR) += xattr.o
577 in-tree modules when testing for `CONFIG_` definitions.