Recitation R14 - Makefiles
CS270: Computer Organization
Goals
- Learn the basics of Makefiles
- Create a Makefile template from scratch that you can use in your projects
Getting Started
- Make a subdirectory called R14.
- Copy R14.tar to the R14 directory.
- Extract the archive file into this directory and remove the archive:
tar -xvf R14.tar
rm R14.tar
Experimenting with Makefiles
Your TA will start with an initial (minimalistic) Makefile and will teach you
more sophisticated Makefile features progressively. Here is the list of
Makefiles used in the recitation in order of complexity:
- Makefile: Minimalistic Makefile
- Makefile-1: Introduces dependencies
- Makefile-2: Introduces multiple rules
- Makefile-3: Recompiles everything if headers
change
- Makefile-4: Introduces pattern rules and
variables
- Makefile-5: Introduces phony targets
- Makefile-6: Some decorations (final version)!