- Why do we need header guards?
- What is the difference between compiling and linking?
- What compiler flag do we use to create object files and what extension do those files have?
- What is a
target
in a Makefile? - What are the advantages of using Makefiles?
- You are given the following two C source files where both files include the header
math_utils.h
:
- main.c (contains the main() function)
- math_utils.c (contains helper functions on basic math operations)
Task: Write a simple Makefile that:
- Compiles main.c and math_utils.c into object files.
- Links them together into an executable called program.
- Supports a clean rule that removes all object files and the executable.