This is a linux assignment: Using one of the following source programs: ex2.cpp
ID: 3786188 • Letter: T
Question
This is a linux assignment:
Using one of the following source programs:
ex2.cpp , ex4.cpp (provided below)
Create a compressed tar file that contains one of the above, a Makefile and a readme explaining what the program accomplishes.
Makefile must contain a clean and backup rule (take a look at templates.tar for examples)
executable name must be : ex2, or ex4
example:
$ tar xvfz <userid>.ex2.tar.gz
$ make
$ ,/ex2
output from compiled program goes here
readme must be accurate. You may find this link helpful:
https://www.codeproject.com/Articles/11560/Pointers-Usage-in-C-Beginners-to-Advanced
ex2.cpp
ex4.cpp
Explanation / Answer
save ex2.cpp and ex4.cpp.
-------------------------------------------------------------------------------------
at command prompt type vi Makefile and paste below code and save.
//makefile
ex2:ex2.o
g++ -o ex2 ex2.o
ex2.o:ex2.cpp
g++ -c ex2.cpp
ex4:ex4.o
g++ -o ex4 ex4.o
ex4.o:ex4.cpp
g++ -c ex4.cpp
clean:
rm *.o ex2 ex4 -rf backup
backup:
mkdir backup
cp ex2.cpp ex4.cpp backup
----------------------------------------------------------
crate tar in present directory where ex2.cpp , ex4.cpp and Makefile present
tar -cvf ex2.tar.gz *.cpp Makefile
then if you type below command , it works
$ tar xvfz <userid>.ex2.tar.gz
$ make
$ ,/ex2
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.