makefile模板:

ifeq ($(KERNELRELEASE),)   //判断KERNELRELEASE是否为空,只有执行make的当前目录为内核源代码目录时,该变量才不为空。

KERNELDIR ?=/linux-2.6.29.4/linux-2.6.29.4

PWD := $(shell pwd)

modules:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules //make -C 内核路径 M=模块路径 modules modules_install:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions *.order Module* .PHONY: modules modules_install clean else
obj-m := hello.o
endif

makefile文件的执行过程如下:

Hello World 的makefile模板及其分析的更多相关文章

  1. 1、编写一个简单Makefile模板

    一.Makefile简介 一个工程中的源文件不计其数,其按类型.功能.模块分别放在若干个目录中,makefile定义了一系列的规则来指定,哪些文件需要先编译,哪些文件需要后编译,哪些文件需要重新编译, ...

  2. 我所使用的一个通用的Makefile模板

    话不多说,请看: 我的项目有的目录结构有: dirls/ ├── include │   └── apue.h ├── lib │   ├── error.c │   ├── error.o │   ...

  3. 引用 模块编译Makefile模板

    本文转载自geyingzhen<模块编译Makefile模板>   引用 geyingzhen 的 模块编译Makefile模板 ifneq ($(KERNELRELEASE), ) // ...

  4. linux: 几个常用makefile模板

    不才,总结个人常用makefile模板,以备后用. 1.编译动态库 ############################################################# # Ma ...

  5. 【原创】支持同时生成多个main函数 makefile 模板

    背景: 去年做项目的时候,由于有需要编译出多个可执行文件的需求,修改了Makefile使其支持生成多个结果(编译多个含有main函数的文件),但总觉得自己的实现不够完美. 今年又遇到这样需求的时候,可 ...

  6. g++编译的makefile模板库和脚本

    编译C++文件,特别是多文件的时候,经常要找模板,这里为了后面方便,就自己做了一个模板. makefile模板:Makefile # Object files to either reference ...

  7. makefile编写---.c .cpp 混合编译makefile 模板

    # c.cpp混合编译的makefile模板 # # BIN = client_system BASE_INSTALL_DIR := /opt/arm-2009q1 BUILD_TOOL_DIR := ...

  8. 万能makefile模板

    这里一份万能makefile模板,写opencv项目时候使用的. 前提是提前配置好 包管理工具 pkg 然后就不用每次都去 -lopencv_xxx了. ####################### ...

  9. C、C++的Makefile模板

    目录 Makefile模板 用法 编译C程序 编译C++程序 其他 Tips Makefile模板 CC = gcc LD = $(CC) TARGET = $(notdir $(CURDIR)) S ...

随机推荐

  1. C. Fox And Names

    C. Fox And Names time limit per test 2 seconds memory limit per test 256 megabytes input standard in ...

  2. Partitioning, Shuffle and sort

    Partitioning, Shuffle and sort  what happened? - Partitioning Partitioning is the process of determi ...

  3. java 类从哪个jar包加载的

    <%@page contentType="text/html; charset=GBK"%><%@page import="java.security. ...

  4. 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in

    php 5个版本,5.2.5.3.5.4.5.5,怕跟不上时代,新的服务器直接上5.5,但是程序出现如下错误:Deprecated: mysql_connect(): The mysql extens ...

  5. Mac下启动Apache

    1.启动 sudo apachectl -k start 2.重新启动 sudo apachectl -k restart     //-------------------------------- ...

  6. JS中获取table节点的tr或td的内容

    <table id="tb1" width="200" border="1" cellpadding="4" ce ...

  7. 区间求mex的两种方法

    区间求mex的两种方法 1.莫队+分块/莫队+二分+树状数组 2.线段树 预处理1-i的sg值(用一个vis数组,一个cur指针) 预处理nxt数组(a[nxt[i]]=a[i]) 枚举左端点l, 考 ...

  8. Angular 2.0 从0到1:Rx--隐藏在Angular 2.x中利剑

    第一节:Angular 2.0 从0到1 (一)第二节:Angular 2.0 从0到1 (二)第三节:Angular 2.0 从0到1 (三)第四节:Angular 2.0 从0到1 (四)第五节: ...

  9. HttpClient(4.3.5) - HTTP Execution Context

    Originally HTTP has been designed as a stateless, response-request oriented protocol. However, real ...

  10. 【AngularJs】---$sce 输出Html

    [问题描述] angular js的强大之处之一就是他的数据双向绑定功能----->ng-bind和针对form的ng-model 但在我们的项目当中会遇到这样的情况,后台返回的数据中带有各种各 ...