Linux kernel & device driver programming

Cross-Referenced Linux and Device Driver Code

[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ]
Version: [ 2.6.11.8 ] [ 2.6.25 ] [ 2.6.25.8 ] [ 2.6.31.13 ] Architecture: [ i386 ]
  1 
  2 # To build modules outside of the kernel tree, we run "make"
  3 # in the kernel source tree; the Makefile these then includes this
  4 # Makefile once again.
  5 # This conditional selects whether we are being included from the
  6 # kernel Makefile or not.
  7 ifeq ($(KERNELRELEASE),)
  8 
  9     # Assume the source tree is where the running kernel was built
 10     # You should set KERNELDIR in the environment if it's elsewhere
 11     KERNELDIR ?= /lib/modules/$(shell uname -r)/build
 12     # The current directory is passed to sub-makes as argument
 13     PWD := $(shell pwd)
 14 
 15 modules:
 16         $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
 17 
 18 modules_install:
 19         $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
 20 
 21 clean:
 22         rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
 23 
 24 .PHONY: modules modules_install clean
 25 
 26 else
 27     # called from kernel build system: just declare what our modules are
 28     obj-m := hello.o hellop.o seq.o jit.o jiq.o sleepy.o complete.o \
 29              silly.o faulty.o kdatasize.o kdataalign.o
 30 endif
 31 
 32 
  This page was automatically generated by the LXR engine.