Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
The problem statement, all variables and given/known data:
Compile cpp2html.c to produce cpp2html.o.
( Important: the source code in these files is C, not C++, and so must be compiled and linked with gcc, not g++.)
Run the command
flex cppscanner.l
to produce the file lex.yy.c from the language description in cppscanner.l.
Compile lex.yy.c to produce lex.yy.o. (This often produces a warning message about extra tokens. Ignore it.)
Link the the .o files to produce an executable program named cpp2html
Write a makefile that will carry out these steps. Your makefile should result in only the minimum required amount of steps when any input file to this process is changed.
Relevant commands, code, scripts, algorithms:
Nothing outside of the UNIX command library
The attempts at a solution (include all code and scripts):
My makefile
Your makefile contains rules for creating cpp2html.o from cpp2html.c, lex.yy.o from lex.yy.c, and cpp2html from cpp2html.o and lex.yy.o.
The second bullet in your problem statement talks about creating lex.yy.c. Do you have a rule that builds lex.yy.c if the contents of its dependencies have changed since the last time you ran make?
When you ran make, did it produce any error messages?
I removed this line "flex cppscanner.l" from the makefile and ran it through the shell and it produced the lex.yy.c file. So then I save and do "make" to update everything and then "make cpp2html" to produce the program which after doing "ls" in shell I see it produced but when I run the checker I get the same error:
Your makefile does not build 'cpp2html' when invoked:
gcc -g -DDEBUG -c cpp2html.c
I guess I need to do a command to make lex.yy.c in the makefile but just typing flex cppscanner.l in the makefile and running doesn't do it.
EDIT: I was able to solve and complete this task. Thanks for you help.
If you look at the 1st message in this thread, you will see that the way to solve this problem is taught in a classroom at Old Dominion University, in Norfolk (Virginia), in the USA, in a class taught by Mr. Zeil. The name of the class is CS 252. From that name, I assume it is a computer science class at the sophomore level.