New to the idea of makefiles. Here is my Makefile:
.PHONY: all homework1
CFLAGS= -g -O0 -Wall -Werror -Wno-unused-function
LDFLAGS= -lm
all : homework1
homework1 : program.tab.o program.lex.o
%.o : %.c
gcc -o$@ -c $(CFLAGS) $<
%.lex.c : %.lex %.tab.h
flex -o$@ $<
%.tab.c %.tab.h : %.y
bison --verbose -o$@ -d $<
Whenever I try to compile, I get the warning make: Circular program.lex <- program.lex.o dependency dropped.
I don't see how program.lex
is dependent on program.lex.o
at all in the makefile. I see how the dependency tree is about 4 layers deep, but it doesn't look circular.
How can I better write my makefile?