So I have to create a makefile that would generate the application described below and make sure each generated file has its own rule.
For the makefile: The first tool is flex, which takes a file called spec.l and generates a file called lex.yy.c. Another tool called bison expects a file calledspec.y and will generate the file spec.tab.c. If bison is called using the directives -vd, it will also generate a file called spec.tab.h (which is needed when compiling lex.yy.c). The two C files can be compiled into object files and then linked together with the yacc (-ly) and lex (-ll) libraries to generate the compiler (a.out. The makefile you describe must generate the following commands if you were starting just with spec.l and spec.y:
flex spec.l bison -vd spec.y gcc -c lex.yy.c gcc -c spec.tab.c gcc spec.tab.o lex.yy.o -ly -ll i am not sure where to start with this problem
edit: what i have so far
compiler: spec.tab.o lex.yy.o gcc spec.tab.o lex.yy.o -ly –ll lex.yy.c: spec.l flex spec.l spec.tab.c: spec.y bison -vd spec.y spec.tab.o: spec.tab.c gcc -c spec.tab.c lex.yy.o: lex.yy.c spec.tab.h gcc –c lex.yy.c clean: rm –f *.c *.o a.out