2

Here's my sample makefile content:

CC=g++
CFLAGS=-c -Wall
...
$(CC) $(CFLAGS) $< -o $@

What does the $< mean here?

OneZero
  • 11,556
  • 15
  • 55
  • 92

1 Answers1

3

Read the documentation of GNU make. It is explained in the automatic variable section.

$<

The name of the first prerequisite. If the target got its recipe from an implicit rule, this will be the first prerequisite added by the implicit rule

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
  • 2
    Please consider marking as duplicate instead of answering when it's clear that the question has been asked and answered before. Thanks. – tripleee Dec 15 '15 at 07:20