心理

当前位置 /首页/完美生活/心理/列表

linux加载驱动的两种makefile文件

linux加载驱动的两种makefile文件

二 Makefile文件有两种写法:

一种是:

# Add your debugging flag (or not) to CFLAGS

ifneq ($(KERNELRELEASE),)

obj-m := boot.o

else

KERNELDIR ?= /lib/modules/$(shell uname -r)/build

PWD := $(shell pwd)

default:

$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

endif

另外一种是:

# Add your debugging flag (or not) to CFLAGS

ifneq ($(KERNELRELEASE),)

obj-m := boot.o

else

KERNELDIR ?= /usr/src/linux-headers-2.6.38-8-generic

PWD := $(shell pwd)

default:

$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

endif

比较两者可以发现,该两个Makefi二 Makefile文件有两种写法:

一种是:

# Add your debugging flag (or not) to CFLAGS

ifneq ($(KERNELRELEASE),)

obj-m := boot.o

else

KERNELDIR ?= /lib/modules/$(shell uname -r)/build

PWD := $(shell pwd)

default:

$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

endif

另外一种是:

# Add your debugging flag (or not) to CFLAGS

ifneq ($(KERNELRELEASE),)

obj-m := boot.o

else

KERNELDIR ?= /usr/src/linux-headers-2.6.38-8-generic

PWD := $(shell pwd)

default:

$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

endif

比较两者可以发现,该两个Makefi二 Makefile文件有两种写法:

一种是:

# Add your debugging flag (or not) to CFLAGS

ifneq ($(KERNELRELEASE),)

obj-m := boot.o

else

KERNELDIR ?= /lib/modules/$(shell uname -r)/build

PWD := $(shell pwd)

default:

$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

endif

另外一种是:

# Add your debugging flag (or not) to CFLAGS

ifneq ($(KERNELRELEASE),)

obj-m := boot.o

else

KERNELDIR ?= /usr/src/linux-headers-2.6.38-8-generic

PWD := $(shell pwd)

default:

$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

endif

比较两者可以发现,该两个Makefile的唯一差别是KERNELDIR的不同

le的唯一差别是KERNELDIR的不同

le的唯一差别是KERNELDIR的不同