target: dependencies commandNote that a tab must precede the command
all: alpha.o gamma.o g++ alpha.o gamma.o -o theta alpha.o: alpha.cpp beta.o g++ -c alpha.cpp beta.o: beta.cpp beta.h gamma.o g++ -c beta.cpp g++ beta.o gamma.o -o betaGamma gamma.o: gamma.cpp g++ -c gamma.cppIf the files "beta.h", "gamma.cpp" have changed what sequence of commands are execute when the command "make alpha.o" is used? Hint: if in doubt, try the programs below...
// alpha.cpp #include <iostream.h> #include "beta.h" void foo(void) { cout << 42 << endl; } // beta.h const int a = 42; void foo(void); // beta.cpp #include <iostream.h> #include "beta.h" void foo(void) { cout << a << " is the answer" << endl; } // gamma.cpp #include "beta.h" void main(void) { foo(); }
# gunzip backup.tar.gz # tar tf backup.tar