2.4 Rules

A rule tells omake both when and how to make a file. For example, suppose your project involves compiling source files main.c and io.c, and linking them to produce the executable project.exe. The following makefile manages the task of making project.exe:

project.exe : main.obj io.obj
link /out:project.exe main.obj io.obj

main.obj : main.c
cl /c main.c

io.obj : io.c
cl /c io.c

This makefile shows three rules, one each to make project.exe, main.obj, and io.obj. These rules are called explicit rules because they are supplied in the makefile. omake also has inference rules that generalize the make process. Inference rules are discussed in Inference Rules.