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

5 This document describes how to build an out-of-tree kernel module.
13 both in-tree and out-of-tree is provided. The method for building
15 out-of-tree.
18 in building out-of-tree (or "external") modules. The author of an
19 external module should supply a makefile that hides most of the
44 --------------
48 $ make -C <path_to_kernel_dir> M=$PWD
55 $ make -C /lib/modules/`uname -r`/build M=$PWD
60 $ make -C /lib/modules/`uname -r`/build M=$PWD modules_install
63 -------
69 make -C $KDIR M=$PWD
71 -C $KDIR
84 -------
89 make -C $KDIR M=$PWD [target]
116 -----------------------
122 Example (The module foo.ko, consist of bar.o and baz.o)::
124 make -C $KDIR M=$PWD bar.lst
125 make -C $KDIR M=$PWD baz.o
126 make -C $KDIR M=$PWD foo.ko
127 make -C $KDIR M=$PWD ./
139 obj-m := <module_name>.o
147 <module_name>-y := <src1>.o <src2>.o ...
160 ---------------
171 --> filename: Makefile
174 obj-m := 8123.o
175 8123-y := 8123_if.o 8123_pci.o
179 KDIR ?= /lib/modules/`uname -r`/build
182 $(MAKE) -C $(KDIR) M=$$PWD
195 ---------------------------------
203 --> filename: Kbuild
204 obj-m := 8123.o
205 8123-y := 8123_if.o 8123_pci.o
207 --> filename: Makefile
208 KDIR ?= /lib/modules/`uname -r`/build
211 $(MAKE) -C $(KDIR) M=$$PWD
219 -------------------------
222 file. For example, if you wanted to build two modules, foo.ko
225 obj-m := foo.o bar.o
226 foo-y := <foo_srcs>
227 bar-y := <bar_srcs>
252 ---------------
263 -------------------
268 directory, use either ccflags-y or CFLAGS_<filename>.o.
274 --> filename: Kbuild
275 obj-m := 8123.o
277 ccflags-y := -I $(src)/include
278 8123-y := 8123_if.o 8123_pci.o
281 ----------------------
299 --> filename: Kbuild
300 obj-m := complex.o
301 complex-y := src/complex_main.o
302 complex-y += src/hal/hardwareif.o
304 ccflags-y := -I$(src)/include
305 ccflags-y += -I$(src)/src/hal/include
314 root of the kernel tree (the argument to "-C") and therefore an
333 ----------------
344 calling "make." This has effect when installing both in-tree
345 and out-of-tree modules.
348 ---------------
356 $ make INSTALL_MOD_DIR=gandalf -C $KDIR \
375 -------------------------------------------
386 0xe1cc2a05 usb_stor_suspend drivers/usb/storage/usb-storage EXPORT_SYMBOL_GPL USB_STORAGE
400 ----------------------------
410 ------------------------------------
417 NOTE: The method with a top-level kbuild file is recommended
420 Use a top-level kbuild file
421 If you have two modules, foo.ko and bar.ko, where
422 foo.ko needs symbols from bar.ko, you can use a
423 common top-level kbuild file so both modules are
427 ./foo/ <= contains foo.ko
430 The top-level kbuild file would then look like::
433 obj-m := foo/ bar/
437 $ make -C $KDIR M=$PWD
443 If it is impractical to add a top-level kbuild file,
454 --------------------------
462 obj-$(CONFIG_EXT2_FS) += ext2.o
464 ext2-y := balloc.o bitmap.o dir.o
465 ext2-$(CONFIG_EXT2_FS_XATTR) += xattr.o