make和msbuild学习笔记

1. make

Wikipedia: make

>In software development, Make is a utility that automatically builds executable programs andlibraries from source code by reading files called makefiles witch specify how to derive the target program.

Make最初是由Stuart Feldman于1976年4月在贝尔实验室创造出来的。2003年,Feldman博士以这个广泛传播的工具的作者身份获得ACM软件系统奖。

#Q: 那么他开发make的动机是什么?

#A: Theart of Unix programming: make:Automating Your Recipes

Make originated with a visit from Steve Johnson (author ofyacc, etc.), storming into my office, cursing the Fates that had caused him towaste a morning debugging a correct program (bug had been fixed, file hadn’tbeen compiled, cc *.o was therefore unaffected). As I had spent a part of theprevious evening coping with the same disaster on a project I was working on,the idea of a tool to solve it came up. It began with an elaborate idea of adependency analyzer, boiled down to something much simpler, and turned intoMake that weekend. Use of tools that ware still wet was part of the cultureMakefiles ware text files, not magically encoded binaries, because that was theUnix ethos: printable, debuggable, understandable stuff.

这是Stuart Feldman的自述,创造Make的想法是来自于Steve Johnson(yacc的作者)的一次到访。Make的主要思想是依赖编译

在写makefile时,最主要的是建立依赖关系

Wikipedia:build automation

Historically, developers used build automationto call compilers and linkers from inside a build script versus attempting tomake the compiler calls from the command line. It is simple to use the commandline to pass a single source module to a compiler and then to a linker tocreate the final deployable object. However, when attempting to compile andlink many source code modules, in a particular order, using the command lineprocess is not a reasonable solution. The make scripting language offered a better alternative. It allowed abuild script to be written to call, in a series, the needed compile and linksteps to build a software application.

现在我差不多能够理解automatically build的含义了,在make没出现之前,对文件的编译时一个一个进行编译的,手动性太大,make出现之后,依赖性的编译使得自动化程度提高了很多。

除了make,其他的基于make的工具有:


2. MSBuild

Wikipedia: MSBuild

MSBuild (Microsoft Build Engine),是代码的编译平台,也是.NETFramework的一部分。Visual Studio 依赖MSBuild,但是MSBuild不依赖Visual Studio。MSBuild是nmake的替代平。MSBuild所管理的工程文件(*.sln,*.vcxprj)使用的是xml语法。

Wikipedia:.NET Framework

.NET Framework是由微软开发的主要在微软操作系统上运行的软件框架,起源于20世纪九十年代末,在2000年.NET 1.0发布。主要有两部分组成:FCL (Framework Class Library)和CLR (Common LanguageRuntime)。FCL是大型的类库提供诸如用户接口、数据访问、数据库链接、加密、web应用开发、数值计算和网络通信,开发人员通过将他们自己的代码和.NET Framewrork还有其他库相连来生成软件;CLR是一个应用虚拟机提供诸如安全、内存管理和异常处理的服务,为.NET Framework写的程序就运行CLR这个软件环境中。

MSBuildis now part of visual studio

#Q: Visual studio依赖MSBuild,所以MSBuild相对nmake更加实用,那么MSBuild为什么会得到Visualstudio的重要呢,要知道在linux下面make是主流的编译工具?

MSBuild其实也跟makenmake一样,都是解释器,只是MSBuild解释的格式是XML格式的文件,makenmake解释的是makefile语法的文件,它们最终都会使用到编译器和链接器,学习哪种解释器其实就是学习它的语法,MSBuildmakenmake都是工程管理工具,具有编译打包功能MSBuild (VC++)Overview

那么问题来了,编译器和链接器其实是整个工程编译的性能瓶颈。


  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值