######################################## ######################################## @ File makefile # @ note Hangzhou hikvision Digital Technology Co ., ltd. all right reserved. # @ brief Linux Device Driver generic makefile ##@ author liuboyf1 # @ data 2012-09-28 # @ version v1.0.6 # @ note history: # @ note <author> <time> <version> <DESC> # @ note liuboyf1 2012-08-30 v1.0.0 create a file # @ note liuboyf1 2012-09-26 v1.0.1 repair Changed cflags to fuse # @ note liuboyf1 2012-09-26 v1.0.2 simplified debugging macro # @ note liuboyf1 2012-09-28 v1.0.3 changed RM to-RM # @ note liuboyf1 2012-10-08 v1.0.4 modified make clean # @ note liuboyf1 2012-10-10 v1.0.5 modify kerneldir # @ note liuboyf1 2012-10-15 v1.0.6 modify debugging parameters and layout ######################## ######################################## ############### the prefix to be added before the GNU Compiler tools (optionally including # Path), I. e. "arm-Linux-" or "/opt/bin/ARM-Linux -". # tool_dir =/opt/v5t_le-mv401_uc # Cross-compilation tool # tool_prefix = $ (tool_dir) /bin/arm_v5t_le-# comment/uncomment the following line to enable/disable debugging # DEBUG = yifeq ($ (Debug), Y) debflags =-o-g # "-o" is needed to expand inlinesdebflags + =-ddebug # control whether to print debugging and error information elsedebflags =-runtime + =-wallextra_cflags + = $ (debflags) # extra_cflags + = -I $ (lddinc) # tool chaincc = $ (tool_prefix) GCC # AR: = $ (tool_prefix) Ar-rvmodule_name = mycdevifneq ($ (kernelrelease),) obj-M: = $ (module_name ). O # $ (module_name)-objs: = file_opr.o mem_proc.o main. oelse # In my debian6 2.6.32kernelver? = $ (Shell uname-R) kerneldir? =/Lib/modules/$ (kernelver)/build # In my IPC 2.6.18 # kerneldir? =/Home/akagi201/kernel_steppwd: = $ (shell PWD) modules: $ (make)-C $ (kerneldir) M = $ (PWD) Modules # CP $ (module_name ). ko $ (PWD )/.. modules_install: $ (make)-C $ (kerneldir) M = $ (PWD) modules_installendifclean: $ (make)-C $ (kerneldir) M = $ (PWD) clean. phony: modules modules_install cleandepend. depend Dep: $ (CC) $ (extra_cflags)-M *. c>. dependifeq (. depend, $ (wildcard. depend) include. dependendif