Akagi201的Linux驅動通用Makefile

來源:互聯網
上載者:User
################################################################################ @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       建立檔案# @note     liuboyf1    2012-09-26   V1.0.1       修改了CFLAGS為EXTRA_CFLAGS# @note     liuboyf1    2012-09-26   V1.0.2       簡化了調試宏部分# @note     liuboyf1    2012-09-28   V1.0.3       修改rm為-rm# @note     liuboyf1    2012-10-08   V1.0.4       修改make clean# @note     liuboyf1    2012-10-10   V1.0.5       修改KERNELDIR# @note     liuboyf1    2012-10-15   V1.0.6       修改了調試參數和布局################################################################################ 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# 交叉編譯工具#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 # 控制是否列印調試和錯誤資訊elseDEBFLAGS = -O2endifEXTRA_CFLAGS += -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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.