Can anybody please explain the meaning of $<
and $@
in a Makefile
?
相关问题
- CMakeList file to generate LLVM bitcode file from
- Makefile to compile lists of source files
- Have make fail if unit tests fail
- C++ - Compiling multiple files
- Undefined symbols for architecture x86_64: (Mac OS
相关文章
- How to arrange a Makefile to compile a kernel modu
- Makefile and use of $$
- Makefile: all vs default targets
- Automake Variables to tidy up Makefile.am
- How do I check the exit status of a Makefile shell
- Marking a makefile dependency as optional or other
- How to instruct Makefile to use different compiler
- Why does this makefile execute a target on 'ma
$<
evaluates to the first "prerequisite" in the make rule, and$@
evaluates to the "target" in the make rule.Here's an example:
In this case,
$<
will be replaced withfile.c
and$@
will befile.o
.These are more useful in generic rules like this:
See this manual for more info.
$@
is the target of the current rule.$<
is the name of the first prerequisite ("source") of the current rule.So for example:
This will expand to a command something like:
See also the GNU make manual § 10.5.3, "Automatic Variables".