Hello Jia,
The question is on how to compile linux kernel module and write Makefile, Actually, it is not within our support range. Only give you some advice, help you correct your Makefile, see below, please!
---------------------------------------------Pay attention to correct path of your compiler----------------------------
obj-m := sema.o
sema-objs := sema.o
KDIR := /work/myandroid/kernel_imx/
PWD := $(shell pwd)
ARCH=arm
CROSS_COMPILE=arm-eabi-
CC=$(CROSS_COMPILE)gcc
LD=$(CROSS_COMPILE)ld
all:
make -C $(KDIR) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) M=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
--------------------------------------------------------------------------------------------------------------------------------------------
Try it , please!
Regards,
Weidong