ak-lab-4/Makefile

19 lines
330 B
Makefile

ifneq ($(KERNELRELEASE),)
# kbuild part of makefile
obj-m := hello1.o hello2.o
ccflags-y := -I$(obj)/inc -g
else
# normal makefile
KDIR ?= /lib/modules/`uname -r`/build
default:
$(MAKE) -C $(KDIR) M=$$PWD
cp hello1.ko hello1.ko.unstripped
$(CROSS_COMPILE)strip -g hello1.ko
clean:
$(MAKE) -C $(KDIR) M=$$PWD clean
endif