Question 6: Make [10]
Suppose you have the files needed to compile and link two programs
organized as follows:
- The central directory is Q6code
- There are two header files, Q6code.h and ExamCode.h,
both located in directory Q6code/headers
- There are three source code files, Q6code.cpp, MoreCode.cpp,
and OtherCode.cpp, all located in directory Q6code/source
- Q6code.cpp #includes Q6code.h
- OtherCode.cpp #includes ExamCode.h and Q6code.h and calls functions
that are implemented in Q6code.cpp
- MoreCode.cpp #includes Q6code.h and calls functions that are
implented in Q6code.cpp
- Object files Q6code.o, MoreCode.o, and OtherCode.o
are stored in directory Q6code/objects, and are compiled
from their individual .cpp files.
- Executables MoreX and OtherX are stored in directory
Q6code/bin
- MoreX is the result of linking Q6code.o and MoreCode.o
- OtherX is the result of linking Q6code.o and OtherCode.o
- "g++ -Wall -Wextra -pedantic" is the desired compilation/linking command.
Write a makefile that correctly updates the object and executable files
as needed, without recompiling any files that have not been altered.