hoelz.ro - Makefile Tips and Tricks

Makefile Tips and Tricks

Makefile Variables

I always have trouble remembering these.

$@ - Your target
$^ - All of your dependencies
$< - Your first dependency
$? - All dependencies newer than the target
$* - The stem of an implicit rule match (a.c -> a)

Prefix Rules

  1. %.pdf : %.dvi
  2. dvipdf $^ $@
  3.  
  4. %.dvi : %.tex
  5. latex $^

Escaping '$'

Use $$:

  echo $$bash_variable

Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki ipv6 ready