Question 1
Purpose of a make file:
fdfd
Multiple purposes:
fdfd
How does make know which files to compile?
make stores the timestamp of files and checks if files have been modified after their timestamps. If so, their respective commands are executed. If not, nothing is executed for the file.
MyPorject: main.o module1.o module2.o
gcc -o MyProject main.c module1.c module2.c
main.o: main.h module1.h
gcc -c main.c
module1.o: module1.h String.h module2.h
gcc -c module1.c
module2.o: module2.h String.h
gcc -c module2.c
archive:
tar -cvf *.c *.h String.o MyPorject.tzg
clean:
mv String.o String.tmp
rm *.o
mv String.tmp String.o