Makefile (二)
生活随笔
收集整理的這篇文章主要介紹了
Makefile (二)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、line1的源碼
- ?line1.h
- line1.cpp
二、line2的源碼
- line2.h
- line2.cpp
三、main的源碼
- main.cpp
Makefile一般的格式是:
target:components rule二、$@、$^、$<
這三個分別表示:
- $@??????????--代表目標文件(target)
- $^????????????--代表所有的依賴文件(components)
- $<???????????--代表第一個依賴文件(components中最左邊的那個)。
簡化的Makefile文件為:
main.out:main.o line1.o line2.og++ -o $@ $^ main.o:main.c line1.h line2.hg++ -c $< line1.o:line1.c line1.hg++ -c $< line2.o:line2.c line2.hg++ -c $<- Makefile的編寫
總結
以上是生活随笔為你收集整理的Makefile (二)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 苹果官网新款mbp介绍页touchbar
- 下一篇: 亮色人生剧情介绍