Skip to main content.

5.2.3. Linux kernel makefiles

Makefile:

#
# Slightly more advanced Makefile for building the hello world module
#

ifneq ($(KERNELRELEASE),)
      obj-m       := hello.o
else
   KDIR        := /home/mk/git/linux-denx
   PWD         := $(shell pwd)

default:
   $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
endif

clean:
   rm -rf .*.cmd .tmp* *.ko *~ *.o *.mod.c *.symvers
5.2.2. A first hello_world module 1. Denx Training Topics 5.2.4. Kernel message logging and printk
Prev Home Next