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工具可以自动完成编译工作,这些工作包括: 如果修改了某几个源文件,则只重新编译这几个源文件 如果某个头文件被修改了,则重新编译所有包含该头文件的源文件 利用这种自动编译 ...
随机推荐
- Java编程思想读书笔记之一切皆对象
一切皆对象 Java程序运行时,数据保存到哪里 寄存器 这是最快的保存区域,因为它位于和其他所有保存方式不同的地方:处理器内部.然而,寄存器的数量十分有限,所以寄存器是根据需要由编译器分配.我们对此没 ...
- HttpRunner 探索 HttpRunner 最佳体现形式_安装篇
基于HttpRunner的一款小而美的测试工具--FasterRunner, 由于还是V1.0初版,很多功能还没来得及实现,已有功能还得拜托大家多多帮忙测试FasterRunner:https://g ...
- ubuntu安装软件-笔记
手动安装过程 下载 - 配置文件 常用命令: sudo dpkg -i ******.deb 问题&解决思路 问题1:依赖项 - 缺少某一个依赖包 解决尝试: 1 . sudo apt-ge ...
- JS字符串替换(jQuery)
①自己封装的一个方法String.format String.format = function() { var s = arguments[0]; for (var i = 0; i < ar ...
- ios配置xmpp即时聊天-服务器端
一.安装 到MySQL官网上http://dev.mysql.com/downloads/mysql/,下载mysql可安装dmg版本 比如:Mac OS X ver. 10.7 (x86, 64-b ...
- springboot整合dubbo注解方式(三)
笔者用自己代码测试时候发现这个版本信息,可以没有,也可以制定一个就可以了,没有太大的问题,只是需要注意引入的依赖问题,两个jar与一个jar的问题, 然后就是接口公共依赖问题,案例是把我找的几个案例进 ...
- excel测试数据导入
需求背景:测试数据的导入一般在dataprovider中写入对应的测试数据,当参数较多,组合测试或者接口参数测试的测试数据都需要逐一写数据驱动类,数据准备消耗了大量时间.前一篇博客中介绍了对偶测试的小 ...
- GUI JFrame窗体介绍:
GUI JFrame窗体介绍: https://www.cnblogs.com/-ksz/p/3422074.html
- HDU-Fibonacci Again(打表找规律)
There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2). ...
- void类型指针的基本用法
void作为指针时可以用任意类型的的指针值都可以给它进行赋值和传递,但是输出时必须时显性输出 代码如下: #include<cstdio> #include<iostream> ...