MakeFile基本使用
MakeFile Making
makefile demo
# Run this line when useing `make` command
# default is the target which is an output id in this makefile
# name after `:` are the dependent targets, when run this line `make` command will check if this target already exists in the makefile
# if not exists, `make` will run the dependent target line to create the target
# the second line is command area, in this area, you can run any valid command yout like, but because of it's target, we put the clang or
# gcc in the area
default: makefile
clang main.c tools.c
# tools.o is an output target which is an global in this makefile
tools.o: default makefile
clang tools.c -c
# app is an output target which is an global in this makefile
app: default tools.o
clang main.o tools.o
# I'm sure if you use Linux or Unix now and then, and install some applications by source code, you must be familiar with this `clean`
# We often some clean action is the area, such as `rm -rf someconffile` and so on.
# There are three brothers named `clean`, `mrproper` and 'disclean' in a single makefile
clean:
rm -rf main.o tools.o
disclean: clean
rm -rf a.out
MakeFile基本使用的更多相关文章
- 说说Makefile那些事儿
说说Makefile那些事儿 |扬说|透过现象看本质 工作至今,一直对Makefile半知半解.突然某天幡然醒悟,觉得此举极为不妥,只得洗心革面从头学来,以前许多不明觉厉之处顿时茅塞顿开,想想好记性不 ...
- 编写一个通用的Makefile文件
1.1在这之前,我们需要了解程序的编译过程 a.预处理:检查语法错误,展开宏,包含头文件等 b.编译:*.c-->*.S c.汇编:*.S-->*.o d.链接:.o +库文件=*.exe ...
- 编写简单的Makefile文件
makefile中的编写内容如下: www:hello.c x.h gcc hello.c -o hello clean: rm hello www:hello.c x.h 表示生成www这个文件需 ...
- 简单编写Makefile
相信很多朋友都有过这样的经历,看着开源项目中好几页的makefile文件,不知所云.在日常学习和工作中,也有意无意的去回避makefile,能改就不写,能用ide就用ide.其实makefile并没有 ...
- [转]Linux中configure/makefile
本文教你如何使用autoconf.automake等来制作一个以源代码形式(.tar.gz)发布的软件.并可在执行configure时使用自定义参数. 一.概述和基础知识 在Linux下得到一个以源代 ...
- Linux内核配置、编译及Makefile简述
Hi,大家好!我是CrazyCatJack.最近在学习Linux内核的配置.编译及Makefile文件.今天总结一下学习成果,分享给大家^_^ 1.解压缩打补丁 首先是解压缩你获取到的Linux内核. ...
- make 查找的文件名顺序为:“GNUmakefile”、“makefile”、“Makefile”
默认的情况下,make会在工作目录(执行make的目录)下按照文件名顺序寻找makefile文件读取并执行,查找的文件名顺序为:“GNUmakefile”.“makefile”.“Makefile”. ...
- 实例:对2个Makefile的备注
实例1:Makefile编译链接简单.c函数 example.c Makefile exe: example.c gcc example.c -o exe clean: rm exe 执行效果: 实例 ...
- Linux中C程序调试、makefile
gcc基本语法格式:gcc [-选项] 源文件 [-选项] 目标文件,GCC编译C程序的过程: 预处理:gcc -E hello.c hello.i.-E指定执行到预处理结束,下面类似. 编译:gcc ...
- Linux工具入门:make工具与Makefile文件
1. make工具 利用make工具可以自动完成编译工作,这些工作包括: 如果修改了某几个源文件,则只重新编译这几个源文件 如果某个头文件被修改了,则重新编译所有包含该头文件的源文件 利用这种自动编译 ...
随机推荐
- Python 中 os.path 模块的运用
官网文档链接: https://docs.python.org/3/library/os.path.html 概念: 该模块在路径名上实现了一些有用的功能,主要用于文件的属性获取 代码实现: os.p ...
- Python flask虚拟环境安装
1.安装virtualenv 2.在当前路径下创建文件夹,启动虚拟环境 3.在使用虚拟环境前需激活,前面出现(env说明在虚拟环境中).虚拟环境中默认安装了pip,所以直接pip安装flask 4.在 ...
- Ubuntu1804登录界面闪退
目前主力机操作系统已经由Ubuntu 16.04 lts升级到Ubuntu 18.04 lts.由于是跨版本升级过来,而且由unity(个人觉得挺好)替换成了gnome3,经常出点小问题.这次由于安装 ...
- Linux安装vim编辑器
1.ubuntu系统:普通用户下输入命令:sudo apt-get install vim-gtk (注:出现E: Unable to locate package则将命令改成sudo apt-get ...
- list与str互转
import stringstr = 'abcde' list = list(str)list['a', 'b', 'c', 'd', 'e']str'abcde'str_convert = ''.j ...
- POJ1051 P,MTHBGWB
题目来源:http://poj.org/problem?id=1051 题目大意: Morse密码里每个字母用长度不定的点和线来表示,一条信息中字母的编码之间用空隙隔开.下表为Morse密码的编码表: ...
- sublime 配置主题
默认主题可能看不清楚: 安装 PackageResourceViewer 安装Soda 主题 setting中加入 "theme": "Soda Light 3.subl ...
- nodejs創建目錄命令mkdir失敗
Windows系統 學習nodejs創建目錄命令:mkdir var fs = require('fs'); fs.mkdir('./tmp/test',function (err) { if(err ...
- Applese 涂颜色(python解法)
链接:https://ac.nowcoder.com/acm/contest/330/E 来源:牛客网 题目描述 精通程序设计的 Applese 叕写了一个游戏. 在这个游戏中,有一个 n 行 m 列 ...
- TreeMap读源码总结
红黑树: 定义 A red–black tree is a kind of self-balancing binary search tree in computer science. Each no ...