Get the App
SLTechnology News&Howtos  ›  Servers  › 

The use of predefined variables (V)

Shulou Source: shulou.com Published: 2022-06-03 09:09:04 12月06日 Update

There are some predefined variables in the makefile, such as automatic variables: $@,$^,$ $@ refers to the target in the current rule that triggers the command to be executed;b> $^refers to all dependencies in the current rule;c> $

< 是指当前规则中的第一个依赖。关于自动变量的使用如下

Let's take the code as an example to analyze and explain

.PHONY : all first second thirdall : first second third @echo "\$$@ => $@" @echo "$$^ => $^" @echo "$$

< =>

$

Tags: Variables times interpretations commands files targets interpreters special that is directories compilations code parameters effects file names versions rules development meaning environment Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Docker vpn Redmi Linux