Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Computer Science · Glosarium

Apa itu Makefile, target, prerequisite, recipe?

Dikenal juga sebagai: makefile · target (of a rule) · prerequisite · recipe

Definition 7.5 University Computer Science — Year 1 · Bab 7 — Modular Programs, Makefiles and Tests

A makefile is a file of rules read by make. Each rule names a target, usually a file to build; its prerequisites, the files it is built from; and a recipe, the shell commands that build it, each line starting with a tab character. make builds a target when it does not exist or when one of its prerequisites, after being brought up to date itself, was modified more recently than the target.

The dependency graph that  describes, arrows from prerequisite to target. A change to a file must reach every file downstream of it, and only those.
The dependency graph that Listing 7.4 describes, arrows from prerequisite to target. A change to a file must reach every file downstream of it, and only those.
make after touch ratio_demo.c. Visiting the graph from the target down, it finds ratio_demo.o older than one of its prerequisites and rebuilds it; ratio_demo, now older than that new object file, is linked again; ratio.o is left alone. Shaded: the two commands of the third run.
make after touch ratio_demo.c. Visiting the graph from the target down, it finds ratio_demo.o older than one of its prerequisites and rebuilds it; ratio_demo, now older than that new object file, is linked again; ratio.o is left alone. Shaded: the two commands of the third run.
Baca dalam konteks →