Makefile 523 B

1234567891011121314151617181920212223242526
  1. # compiler
  2. CC = g++
  3. # compiler flags
  4. CFLAGS = -Wall -Werror
  5. # make first entry first
  6. all: main
  7. run: all
  8. ./main
  9. main: address.o date.o student.o
  10. $(CC) $(CFLAGS) -o main Main.cpp address.o date.o student.o
  11. address.o: Address.cpp Address.h
  12. $(CC) $(CFLAGS) -c Address.cpp -o address.o
  13. date.o: Date.cpp Date.h
  14. $(CC) $(CFLAGS) -c Date.cpp -o date.o
  15. student.o: Student.cpp Student.h
  16. $(CC) $(CFLAGS) -c Student.cpp -o student.o
  17. clean:
  18. rm main address.o date.o student.o fullReport.txt shortReport.txt alphaReport.txt