Wildcard and newline characters are used in makefile __makefile

Source: Internet
Author: User

Describes other makefile rules, such as using wildcard characters in commands, and writing commands and dependencies on the same line, and using line breaks. See Example test006, in addition to makefile file is not the same, test006 and test005 other files are the same.

#执行方式:
#make-F Test006.mk
#################################################################
#说明:
#1. Introduction of other Makefile rules
#################################################################
#不能把 OBJ changed to *.O
OBJ = MATH.O MAIN.O
To separate from the middle by [;] #命令与依赖关系在同一行
Test.exe: $ (obj); cc-o test.exe $ (obj)

MATH.O:MATH.H Common.h
#[/] is the meaning of a newline character, makefile has no limit on how many characters are on the same line
Main.o:main.h MATH.H/
Common.h

#用 phony show that clean is a pseudo target
. Phony:clean
Clean
#在命令中使用通配符
-RM Test.exe *.O

Please download this example from http://u.115.com/file/f47a68b727

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.