Question
Unix Assignment 10 Help! Create a directory ~/UnixCourse/makeAsst . Within that directory, create a pair of subdirectories, project1 and project2 Copy the .h and .cpp
Unix Assignment 10 Help!
Create a directory ~/UnixCourse/makeAsst. Within that directory, create a pair of subdirectories, project1and project2
Copy the .h and .cpp files from your earlier Compilation assignment (should be in ~/UnixCourse/compileAsst) into your project1 directory. (~/UnixCourse/compileAsst/guess.cpp ~/UnixCourse/compileAsst/yesno.h ~/UnixCourse/compileAsst/yesno.cpp)
Copy all files in the ~cs252/Assignments/cookie/ directory into your project2 directory. (~cs252/Assignments/cookie/chompt.adt ~cs252/Assignments/cookie/mainProg.cpp)
3.The code in project2 is for a program that plays a simple game called Chomp.
The programmers of this project have opted to package some of their code in a module called chomp.adt, from which the related files cookie.h and cookie.cpp files can be generated.
The steps necessary to produce this program are:
A. Run the command : csplit chomp.adt "/Split Here/"
and copy the resulting file xx00 to cookie.h
B. Run the command: csplit chomp.adt "/Split Here/"
and copy the resulting file xx001 to cookie.cpp
C.Compile cookie.cpp to produce cookie.o.
D.Compile mainProg.cpp to produce mainProg.o
E.Link the the .o files to produce an executable program named playChomp
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. (Note: you will probably not be able to base this makefile upon my self-updating makefile as in the earlier part of the assignment. Instead, you will probably find it necessary to write this one from scratch.
What I need help with:
Okay so I have done most of this but I keep getting an error. I have copied the right files and have given these commands:
g++ -g -DDEBUG -c cookie.cpp cookie.h
g++ -g -DDEBUG -c mainProg.cpp cookie.h
then I typed a Makefile like this:
all: playChomp
playChomp: mainProg.o cookie.o
g++ -o playChomp mainProg.o cookie.o
cookie.o: cookie.cpp cookie.h
g++ -g -DDEBUG -c cookie.cpp cookie.h
mainProg.o: mainProg.cpp cookie.h
g++ -g -DDEBUG -c mainProg.cpp
clean:
rm *.o playChomp
compiled the program:
g++ -o playChomp mainProg.o cookie.o
and then typed "make Makefile" and I keep getting an error of make: Nothing to be done for `Makefile'.
When I try to turn in I get this error:
make: *** No rule to make target `cookie.h', needed by `mainProg.o'. Stop.
Your makefile does not build 'chomp' when invoked:
Can anyone tell me what I'm doing wrong or help me?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started