亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪問(wèn)板塊 發(fā)新帖
查看: 2760 | 回復(fù): 0
打印 上一主題 下一主題

我的Linux驅(qū)動(dòng)以及應(yīng)用的通用Makefile,請(qǐng)幫忙挑bug [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2012-09-28 11:58 |只看該作者 |倒序?yàn)g覽
本帖最后由 Akagi201 于 2012-09-28 19:22 編輯

放在博客里沒(méi)人看啊, 最近一直在修改,調(diào)試,不知道還有沒(méi)有可以改進(jìn)和修改的地方了,與大家新人們一起分享下。

希望高手們可以指點(diǎn)下。

博客地址:(不斷修改完善)
http://blog.csdn.net/akagi201/article/details/8019809
http://blog.csdn.net/akagi201/article/details/8014704
http://blog.csdn.net/akagi201/article/details/8014697

代碼的目錄結(jié)構(gòu)
|
|-project/
  |----app/
  |-----Makefile(app Makefile)
  |----dev/
  |-----Makefile(dev Makefile)
  |----Makefile(Top Makefile)

  1. ###############################################################################
  2. # @file Makefile
  3. # @note HangZhou Hikvision Digital Technology Co., Ltd. All Right Reserved.
  4. # @brief Top Generic Mkefile
  5. #
  6. # @author   liuboyf1
  7. # @data     2012-09-26
  8. # @version  V1.0.0
  9. # @note     History:
  10. # @note     <author>    <time>       <version>    <desc>
  11. # @note     liuboyf1    2012-09-11   V1.0.0       創(chuàng)建文件
  12. # @note     liuboyf1    2012-09-26   V1.0.1       添加make app make dev分別編譯功能
  13. ###############################################################################

  14. PWD = $(shell pwd)
  15. all: app dev
  16. app:
  17.         make -C $(PWD)/app
  18. dev:
  19.         make -C $(PWD)/dev
  20. clean:
  21.         make clean -C $(PWD)/app
  22.         make clean -C $(PWD)/dev
  23. .PHONY: all app dev clean
復(fù)制代碼

  1. ###############################################################################
  2. # @file Makefile
  3. # @note HangZhou Hikvision Digital Technology Co., Ltd. All Right Reserved.
  4. # @brief    Linux Device Driver Generic Makefile
  5. #
  6. # @author   liuboyf1
  7. # @data     2012-09-28
  8. # @version  V1.0.2
  9. # @note     History:
  10. # @note     <author>    <time>       <version>    <desc>
  11. # @note     liuboyf1    2012-08-30   V1.0.0       創(chuàng)建文件
  12. # @note     liuboyf1    2012-09-26   V1.0.1       修改了CFLAGS為EXTRA_CFLAGS
  13. # @note     liuboyf1    2012-09-26   V1.0.2       簡(jiǎn)化了調(diào)試宏部分
  14. # @note     liuboyf1    2010-09-28   V1.0.3       修改rm為-rm
  15. ###############################################################################

  16. # Comment/uncomment the following line to enable/disable debugging
  17. #DEBUG = y
  18. ifeq ($(DEBUG),y)
  19.         DEBFLAGS = -O -g # "-O" is needed to expand inlines
  20.         DEBFLAGS += -DDEBUG # 控制是否打印調(diào)試和錯(cuò)誤信息
  21. else
  22.         DEBFLAGS = -O2
  23. endif

  24. # The prefix to be added before the GNU compiler tools (optionally including
  25. # path), i.e. "arm-linux-" or "/opt/bin/arm-linux-".
  26. #TOOL_DIR = /opt/v5t_le-mv401_uc
  27. # 交叉編譯工具
  28. #TOOL_PREFIX = $(TOOL_DIR)/bin/arm_v5t_le-

  29. CC = $(TOOL_PREFIX)gcc
  30. #AR:= $(TOOL_PREFIX)ar -rv
  31. EXTRA_CFLAGS += $(DEBFLAGS)
  32. #EXTRA_CFLAGS += -I$(LDDINC)

  33. MODULE_NAME = mycdev
  34. ifneq ($(KERNELRELEASE),)


  35. obj-m := $(MODULE_NAME).o
  36. #$(MODULE_NAME)-objs := file_opr.o mem_proc.o main.o

  37. else

  38. # in my Debian6 2.6.32
  39. KERNELDIR ?=/lib/modules/2.6.32/build
  40. # in my IPC 2.6.18
  41. #KERNELDIR ?= /home/akagi201/kernel_step

  42. PWD := $(shell pwd)

  43. modules:
  44.         $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
  45.         cp $(MODULE_NAME).ko $(PWD)/..

  46. modules_install:
  47.         $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
  48. endif

  49. clean:
  50.         -rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.* .*.o.cmd .*.ko.cmd .tmp_versions Module.symvers modules.order
  51. # 減號(hào)忽略部分文件出現(xiàn)的問(wèn)題,繼續(xù)后面的工作
  52. .PHONY: modules modules_install clean

  53. depend .depend dep:
  54.         $(CC) $(EXTRA_CFLAGS) -M *.c > .depend


  55. ifeq (.depend,$(wildcard .depend))
  56. include .depend
  57. endif
復(fù)制代碼


  1. ###############################################################################
  2. # @file Makefile
  3. # @note HangZhou Hikvision Digital Technology Co., Ltd. All Right Reserved.
  4. # @brief    Linux Application Generic Makefile
  5. #
  6. # @author   liuboyf1
  7. # @data     2012-09-28
  8. # @version  V1.0.3
  9. # @note     History:
  10. # @note     <author>    <time>       <version>    <desc>
  11. # @note     liuboyf1    2012-09-03   V1.0.0       創(chuàng)建文件
  12. # @note     liuboyf1    2012-09-26   V1.0.1       修復(fù)了DEBFLAGS調(diào)試
  13. # @note     liuboyf1    2012-09-28   V1.0.2       修改rm為-rm更健壯
  14. # @note     liuboyf1    2010-09-28   V1.0.3       修改了部分注釋
  15. ###############################################################################

  16. SRCS = $(wildcard *.c) # 當(dāng)前目錄下所有以.c結(jié)尾的源文件,wildcard 擴(kuò)展通配符
  17. OBJS = $(SRCS:.c = .o) # .c=.o是做一個(gè)替換,把變量$(sources)所有[.c]的字串都替換成.o

  18. # The prefix to be added before the GNU compiler tools (optionally including
  19. # path), i.e. "arm-linux-" or "/opt/bin/arm-linux-".
  20. #TOOL_DIR = /opt/v5t_le-mv401_uc
  21. # 交叉編譯工具
  22. #TOOL_PREFIX = $(TOOL_DIR)/bin/arm_v5t_le-

  23. CC = $(TOOL_PREFIX)gcc

  24. # 包含的頭文件,和非系統(tǒng)鏈接庫(kù)
  25. #INCLUDES = -I/xxx
  26. #LIBS = -lpthread

  27. CFLAGS = -g -Wall -O2

  28. # Comment/uncomment the following line to enable/disable debugging
  29. DEBUG = y
  30. ifeq ($(DEBUG),y)
  31.         DEBFLAGS = -O -g # "-O" is needed to expand inlines
  32.         DEBFLAGS += -DDEBUG # 控制是否打印調(diào)試和錯(cuò)誤信息
  33. else
  34.         DEBFLAGS = -O2
  35. endif

  36. PWD := $(shell pwd)

  37. # 生成的可執(zhí)行文件名稱(chēng)
  38. TARGET = test
  39. $(TARGET) : $(OBJS)
  40.         $(CC) $^ -o $@ $(CFLAGS) $(DEBFLAGS) $(INCLUDES) $(LIBS)
  41.         cp $(TARGET) $(PWD)/..

  42. %.o : %.c
  43.         $(CC) -c $< $(CFLAGS) $(DEBFLAGS)

  44. clean :
  45.         -rm -f *.o $(TARGET) # 忽略某些文件問(wèn)題,繼續(xù)做后面的事情

  46. .PHONY : clean

復(fù)制代碼
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專(zhuān)區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過(guò)ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP