uva-cs / pdr

A repo for a Program and Data Representation university-level course
Other
91 stars 227 forks source link

Makefile for in-lab 11 shouldn't require only one target #84

Closed adeet1 closed 8 months ago

adeet1 commented 4 years ago

I think that there are 2 issues with requiring the makefile to have only 1 target that compiles and links all of the .cpp and .h files:

1) It seems that every time we run make, it will compile all of the .cpp files instead of only the .cpp files that have changed since make was last run. This is almost equivalent to running clang++ middleearth.cpp traveling.cpp (which compiles and links both files regardless of any changes made), and so it seems that having only 1 target would defeat the purpose of a makefile.

2) The makefile will look a bit disorganized. It's more readable if the first target only links the .o files, and if the other targets create these .o files by compiling the necessary .cpp files.

Thus, I've changed the in-lab makefile requirements to match those of the pre-lab (whose makefile does not require only 1 target).