Thinking in C and *nix (CSC 282 2015S) : EBoards

CSC282 2015S, Class 10: Improved Make


Overview

Preliminaries

Admin

Questions

A quick review of Make

Goals

Format

Learned from writing your own

Variables in Make

Some standard variables for C programs

Make has a lot of standard rules (e.g., for building .o files from .c files). We can customize using variables.

Another example: Document development

Sam's web sites

Automatic variables

Rules are often almost identical. So we want patterns that will work with anything that follows some standard naming conventions.

Two mechansisms for doing this: Original Make and GNU Make.

Two stages: Automatic variables

Generic rules

Standard make rules

    make -p

Other useful techniques

    VAR = $(shell COMMAND)

Miscellaneous tools and techniques