Class DependencyGraph

Summary


 make is organized around a dependency graph. The nodes are labeled by targets.

Package:
(main)
File:
umake.icn
Methods:
add_dependency, add_node, get_targets, ismarked, make, mark, node

Fields:
initialtarget, marked, targets

Source code.

Details
Constructor

DependencyGraph(filename)

 for version 0, just break on spaces

Methods:

add_dependency(source, target)

 if \targets[target] then {

 Target already exists.  Under some circumstances this ought to
 be an error/fail/warning, but by default we replace silently.

	 write(&errout, "replacing ", image(target))
 }


add_node(target, dependencies, buildrules)

  Add a new target to the graph.  Example call:

 ufiles := ""
 every targ := !targets do {
   if targ.target[-2:0]==".u" then ufiles ||:= targ[target]
   }
 dg.add_node("clean", [], ["rm "|| ufiles ||" uniclass.*"])


get_targets(target)

 first, check for matching extensions
 instantiate the generic rule
 last, try a global


ismarked(s)


make(targ)


mark(s)


node(s)

 produce a dependency graph node corresponding to a named file


Fields:
initialtarget

marked

targets


This page produced by UniDoc on 2021/04/15 @ 23:59:53.