Makefile Quiz 1

This quiz tests your knowledge of material described in the 'What is a Makefile?' and 'Building Makefiles' webpages of this tutorial.

1. A Makefile is created by typing the make command.

True False

2. A Makefile is a shorthand way of recompiling files.
True False

3. Make keeps track of when files were last compiled and only recompiles those target files for which source files were changed since make was last executed.
True False

4. Macros are defined by the operating system.
True False

5. If an action line requires more than one line, you will tab twice on the second line so make knows it is a continuation of the previous line.
True False


Given the following lines of code from a makefile, answer questions 6-8:
RM = rm
LIBRARY = libutil

clean:
[tab]$(RM) *.o *.out $(LIBRARY) core

6. Identify the macro(s).
core clean LIBRARY RM and LIBRARY *.o and *.out RM, LIBRARY, *.o and *.out

7. In the code given, clean is:
a source file a target file an action part of a macro definition

8. In the code given, libutil is:
a source file a target file an action part of a macro definition


S. M. Garver, Spring 1998