makefile

来自「linux下面5*5按键驱动以及测试程序」· 代码 · 共 37 行

TXT
37
字号
#Makefile for buttons
mod_dest = $(addsuffix .o,s3c24xx_buttons)bin_dest = button_testifneq ($(KERNELRELEASE),)
	obj-m :=$(mod_dest)else	bin_dest_c = $(addsuffix .c,$(bin_dest))	CROSS=arm-linux-	KERNELDIR ?= /home/kevin/armsystem/linux-2.6.26.8
	#KERNELDIR=/lib/modules/$(shell uname -r)/build
	PWD := $(shell pwd)default:$(bin_dest)	@echo  'make the bin file: $(bin_dest) from $(bin_dest_c)'	@echo  'make the module:  $(mod_dest)'	$(MAKE) -C $(KERNELDIR) M=$(PWD) modulesmodules:	$(MAKE) -C $(KERNELDIR) M=$(PWD) modulesbin:$(bin_dest)%: %.c	$(CROSS)gcc -o $@ $< -statichelp:	@echo  'Cleaning targets:'	@echo  '  clean		  - Remove most generated files'	@echo  ''	@echo  'Other generic targets:'	@echo  '  all		  - Build all targets marked with [*]'	@echo  'bin	  - Build the bare kernel'	@echo  'modules	  - Build all modules'	@echo  ''	@echo  'Documentation targets:'clean:
	rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c $(bin_dest)
endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?