Coder Social home page Coder Social logo

makefile's Introduction

v6.0

  1. 引入static Pattern Rule
targets:target-pattern:prereq-patterns
# targets不是一个目标文件,而是一组目标文件
# target-pattern表示目标文件的特征%.o
# prereq-patterns表示依赖文件的特征%.cpp

v5.0

  1. 引入wildcard函数,patsubst函数
  2. wildcard用于获取符合特定规则的文件名
$(wildcard ****.cpp)  # 过来所有的.cpp文件
  1. patsubst用于文本处理
$(patsubst %.cpp, %.o, $(SOURCES))  # 将SOURCE表示的所有.cpp文件替换为同名的.o文件

v4.0

  1. 引入特殊符号,精简makefile
  2. all:library.cpp main.cpp

$@指代all,即target $<指代library.cpp, 即第一个dependency $^指代library.cpp和main.cpp,即所有的dependency

v3.0

  1. 使用变量,变量名允许自定义(抽象功能)

v2.0

  1. 语法规则::
  2. 有选择性的编译源文件:即增量编译

v1.0

  1. makefile文件名敏感,可以为makefile或者Makefile(仅两种写法),不能为其他版本(MakeFile, Make_File, makeFile,...)
  2. makefile缩进敏感,在行首为,不能随便打空格
  3. all, clean为target,名称可自定义,真正编译的是他们下面的命令
  4. 执行为make target,默认第一个target

makefile's People

Contributors

faithlocus avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.