added hello kernel module
[my-code/kernel.git] / hello / Makefile
1 # Makefile of hello.o - my first kernel module.
2
3 INCLUDEDIR = /usr/include
4
5 CFLAGS = -D__KERNEL__ -DMODULE -O -Wall -I$(INCLUDEDIR)
6
7 # findout kernel version.
8 VER = $(shell awk -F\" '/REL/ {print $$2}' $(INCLUDEDIR)/linux/version.h)
9
10 OBJS = hello.o
11
12 all: $(OBJS)
13
14 #hello.o: hello.o
15 #       $(LD) -r $^ -o $@
16
17 install:
18         install -d /lib/modules/$(VER)/misc
19         install -c hello.o /lib/modules/$(VER)/misc
20
21 clean:
22         rm -f *.o *~ core
23
24 uninstall:
25         rm -f /lib/modules/$(VER)/misc/hello.o
26