Cross compiling a kernel module

后端 未结 6 2016
囚心锁ツ
囚心锁ツ 2020-12-04 18:22

I\'m trying to cross compile a helloworld kernel (2.6.x) module for ARM architecture on my intel x86 host.

The codesourcery tool chain for ARM is located at: /ho

6条回答
  •  無奈伤痛
    2020-12-04 18:50

    adding export at the end of your Makefile variable declarations will make them available to subshells. and add the dash to the CROSS_COMPILE prefix as JayM pointed out, and M instead of SUBDIRS as user502515 answered.

    and it's generally a good idea to use := rather than = in a Makefile, so the variable only gets interpolated once. really doesn't matter in this particular case though.

    ARCH := arm
    CROSS_COMPILE := arm-none-linux-gnueabi-
    obj-m := Hello.o
    KDIR := /home/ravi/workspace/hawk/linux-omapl1
    PWD := $(shell pwd)
    export
    default:
              $(MAKE) -C $(KDIR) M=$(PWD) modules
    clean:
              $(MAKE) -C $(KDIR) M=$(PWD) clean
    

提交回复
热议问题