I'm attempting to do an assignment which utilizes a "makefile", a "readme", and also a C++ source program (.cpp file) and all of this should be in a compressed tar file. I was told that my makefile should have a clean and backup rule also, I don't know how to do the rest properly.
I attempted to turn in my assignment but I was told "Your makefile does not have a default rule that compiles this program."
This is my makefile:
# makefile to build a program clean: /bin/rm -f myname *.o backup: tar czf cm25.assignment4_1.tar.gz readme Makefile
Obviously I am missing something but here's an old makefile from an old assignment that can be used as reference but I don't know what I need to include and don't need to include:
# makefile to build a program # program depends on components: name and main myname: main.o name.o g++ -g main.o name.o -o myname # name.cpp has it's own header file name.o: name.cpp name.h g++ -c -g name.cpp # main.cpp also uses the header file name.h main.o: main.cpp name.h g++ -c -g main.cpp clean: /bin/rm -f myname *.o backup: tar czf cm25.assignment4_1.tar.gz *.cpp readme Makefile
All my compressed tar file has is a single .cpp file, a readme and a makefile, I don't have headers or anything.