Recitation R5 - 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 R5.
- Copy R5.tar to the R5 directory.
- Extract the archive file into this directory and remove the archive:
tar -xvf R5.tar
rm R5.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)!