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 the Flex manual.
I have a couple of questions regarding this makefile.It doesn't specify a compiler such as gcc
how does the makefile know how to create the targets such as scan.o
and parse.o
and myprogram.o
?
# 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
.o
s is still a better idea though. – Gratify