Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 637 Bytes

File metadata and controls

23 lines (16 loc) · 637 Bytes

Makefile Automatic Variables

Back{: .button}

  • DEPS: This is used to specify a dependency list; ie headers
  • $@: Tells to take the name of the file to the left of :
  • $^: Takes the content from the right of the :
  • $<: Takes the first item of dependency list
  • $(@D): Directory the target should go into
  • $?: List of all dependencies that are newer than the target

Example

out/test: test.c
  mkdir $(@D)
  $(CXX) -o $@ $^

References