4472
|
1 KERNEL_INCLUDES = /usr/src/linux/include
|
|
2 INCLUDES = -I$(KERNEL_INCLUDES)
|
|
3 CFLAGS = -g -O2 -Wall -D__KERNEL__ -DMODULE -include $(KERNEL_INCLUDES)/linux/modversions.h
|
|
4 VERSION = $(shell grep UTS_RELEASE $(KERNEL_INCLUDES)/linux/version.h | cut -d '"' -f2)
|
|
5 MDIR = /lib/modules/$(VERSION)/misc
|
|
6
|
|
7 all: dhahelper.o test
|
|
8
|
|
9 dhahelper.o: dhahelper.c dhahelper.h
|
|
10 $(CC) $(CFLAGS) $(INCLUDES) -c $(basename $@).c
|
|
11
|
|
12 test: test.c
|
|
13 $(CC) -g -O -Wall $(INCLUDES) -o $@ $@.c
|
|
14
|
|
15 install: dhahelper.o
|
|
16 if test ! -d $(MDIR) ; then mkdir -p $(MDIR) ; fi
|
|
17 install -m 644 dhahelper.o $(MDIR)/dhahelper.o
|
|
18 depmod -a
|
|
19
|
|
20 dep:
|
|
21
|
|
22 clean:
|
|
23 rm -f *.o *~
|
|
24
|
|
25 distclean: clean
|
|
26 rm -f test
|