Makefile Learning (02)

Source: Internet
Author: User

File name of 1.Makefile

You can use other filenames to write makefile, such as Make.linux, if you want to specify a specific makefile, you can use the "-F" and "--file" parameters of make, such as

Make-f make.linux or make--file make.linux

2. Using the Include keyword in makefile can include other makefile,

Include <filename>//filename can be the file mode of the current operating system shell (can be guaranteed with path and wildcard characters)

There can be some empty characters in front of the include, but never the tap key to start. Include and <filename> can be separated by one and more spaces

Example: For example, you have a few makefile:a.mk, B.mk, C.mk, and a file called Foo.make, and a variable $ (bar) that contains e.mk and F.MK

Include Foo.make *.mk $ (bar)
Equivalent to:
Include Foo.make a.mk b.mk c.mk e.mk f.mk

3.LPR and LP to generate print jobs

LPR [-P printer queue] [-# print copies]-u [Username] File

Specify HP_P2015 this printer to print/etc/passwd this file

[Email protected] ~]# lpr-p hp_p2015/etc/passwd

Multi-target in 4.Makefile

"[Email protected]" Automation variable, which represents a collection of multiple targets in the current rule

Bigoutput LITTLEOUTPUT:TEXT.G
Generate TEXT.G-$ (subst output,,[email protected]) > [email protected]

The "$" in-$ (subst Output,,[email protected]) represents a function that performs a makefile, the function is named subst, followed by a parameter.

"[email protected]" represents a collection of targets, just like an array, "[email protected]" takes out the target and executes the command

5.subst This is a replacement function with three parameters, the first parameter is the replacement string, the second argument is the replacement string, and the third parameter is the string that the substitution operation acts on.

Comma:=,
empty:=
Space:= $ (empty) $ (empty)
Foo:= a b C
Bar:= $ (subst $ (space), $ (comma), $ (foo))

$ (subst $ (space), $ (comma), $ (foo))//This function is to replace the space in $ (foo) with a comma,

Makefile Learning (02)

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.