[prev] 39 [next]

Multi-module C Programs and Makefiles (cont)

Within a large software system ...
  • dependencies exist between files, e.g.
    • main.o depends on main.c and Stack.h
  • actions state how to produce targets from sources, e.g.
    • can create main.o from main.c and Stack.h using gcc
  • rules combine dependencies and actions
    • if main.c or Stack.h changes, rebuild main.o with gcc
A  Makefile  contains definitions and rules

The  make  command uses a Makefile to rebuild a system