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:
[list]
]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++.)
[list]
Run the command
flex cppscanner.l
to produce the file lex.yy.c from the language description in cppscanner.l.
[list]
Compile lex.yy.c to produce lex.yy.o. (This often produces a warning message about extra tokens. Ignore it.)
[list]
Link the the .o files to produce an executable program named cpp2html
[list]
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:
just unix commands -
The attempts at a solution (include all code and scripts):
my makefile
cpp2html.o: cpp2html.c
gcc -g -DDEBUG -c cpp2html.c
lex.yy.o: lex.yy.c
gcc -g -DDEBUG -c lex.yy.c
cpp2html: cpp2html.o lex.yy.o
gcc -g -DDEBUG -o cpp2html.o lex.yy.o
mv a.out cpp2html
The error given is your makefile does not build 'cpp2htm' when invoked:
gcc -g -DDEBUG -c cpp2html.c
Ive tried calling the flex command in the 'make' command line, is that the right process?
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Old Dominion University,Norfolk(VA), USA, Mr. Zeil, CS 252
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).