next up previous
Next: Using patterns Up: A simple Makefile Previous: Let make do

Using macro's

Although this Makefile works, it is not very flexible. A Makefile may contain macros that contain some common definitions.

  
Figure 8: A Makefile with macros.

Figure 8 shows a Makefile that starts with some macro definitions. A macro can be expanded by surrounding its name with parenthesis or curly brackets gif and prepending a dollar sign. Note that $$ expands to a literal dollar sign.

CC is commonly used to denote the name of the C compiler. If its definition is omitted, the default cc is used instead. CFLAGS is used to express the compiler options; it defaults to an empty string.



Megens SA
Thu Jun 20 11:26:28 MET DST 1996