So I have this make file
#makefile to build a program
#program depends on components: name and main
myname: main.o name.o
g++ -c -g name.cpp
# name.cpp has it's own header file
name.o: name.cpp name.h
g++ -c -g name.cpp
# main.cpp also user the header file name.h
main.o: main.cpp name.h
g++ -c -g main.cpp
clean:
/bin/rm -f myname *.o
I need to modify the makefile to include a rule that creates a backup of the source files, makefile, and readme in an archive directory. This rule needs to create a tar.gz file containing the files I mentioned. The.tar.gz file should be placed in a directory named backup within my current working directory. This backup rule should be executed by 'make backup' and the output should be a .tar.gz file in the backup directory. This backup rule should create the directory if it does not already exist.
Any help would be greatly appreciated
EDIT: the makefile already works as intended as is, I just need to figure out how to add this rule.