EmbLogic's Blog

Makefile

INSTALL_DIR=modules
ifneq (${KERNELRELEASE},)
obj-m := new.o

new_mod-objs := new.o

else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE)  -C $(KERNELDIR) M=$(PWD) modules
@rm -rf ${INSTALL_DIR}
@mkdir ${INSTALL_DIR}
@mv -f *.o *.ko *.mod.c .*.cmd ${INSTALL_DIR}
clean:
rm -rf ${INSTALL_DIR}
endif

One Response to Makefile

  1. Ankit.e1 says:

    * just replace “new” with your module name.

Leave a Reply to Ankit.e1 Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>