title: simple makefile for lex yacc and C
body: <p>I am trying to compile my program which has a lex file and a yacc file and a couple of C files.I came across this example in <a href="http://westes.github.io/flex/manual/Makefiles-and-Flex.html" rel="nofollow noreferrer">the Flex manual</a>.</p>
  
  <p>I have a couple of questions regarding this makefile.It doesn't specify a compiler such as <code>gcc</code> how does the makefile know how to create the targets such as <code>scan.o</code> and <code>parse.o</code> and <code>myprogram.o</code>? </p>
  
  <pre><code>     # Makefile example -- scanner and parser.
       # Creates "myprogram" from "scan.l", "parse.y", and "myprogram.c"
       #
       LEX     = flex
       YACC    = bison -y
       YFLAGS  = -d
       objects = scan.o parse.o myprogram.o
  
       myprogram: $(objects)
       scan.o: scan.l parse.c
       parse.o: parse.y
       myprogram.o: myprogram.c
  </code></pre>