Using make with lex
The
make(CP)
utility can be used to maintain programs that
involve lex. make assumes that
a file that has an extension of .l is a lex
source file. It knows how such a file
must be processed to create an object file.
Suppose that a list of dependencies in a makefile contains a filename x.o, and there exists a file x.l. If x.l was modified later than the file x.o (or if x.o does not exist), then make will cause lex to be run on x.l, and then cause the object file x.o to be created from the resulting lex.yy.c. The make internal macro LFLAGS can be used to specify lex options to be invoked automatically by make. For more information, see Chapter 10, ``make''.