|
117 | 117 |
|
118 | 118 | disable_backtrace :- assertz(no_backtrace).
|
119 | 119 |
|
| 120 | +% ---------------------------------------- |
| 121 | +% MESSAGE PASSING |
| 122 | +% ---------------------------------------- |
| 123 | + |
| 124 | +:- multifile intercept_message_hook/1. |
| 125 | +fire_message(M) :- |
| 126 | + findall(M,intercept_message_hook(M),_). |
| 127 | + |
120 | 128 |
|
121 | 129 | % ----------------------------------------
|
122 | 130 | % TOP-LEVEL
|
|
175 | 183 | dep_bindrule(Rule,Opts,Rule2,Opts2), % test dependencies goal
|
176 | 184 | debug_report(build,'Post-dependency rule: ~w',[Rule2],SL),
|
177 | 185 | ( rebuild_required(T,DL,SL,Opts2) % test if target is stale
|
178 |
| - -> run_execs_and_update(Rule2,SL,Opts2) % (re)build |
| 186 | + -> run_execs_and_update(Rule2,SL,Opts2), % (re)build |
| 187 | + fire_message(was_derived_from(T,DL,Rule2)) |
179 | 188 | ; verbose_report('~w is up to date',[T],SL,Opts)),
|
180 | 189 | !.
|
181 | 190 | build(T,SL,Opts) :-
|
|
458 | 467 | rule_dependencies(Rule,DL,Opts),
|
459 | 468 | format(string(Cmd),"touch ~w",[T]),
|
460 | 469 | shell(Cmd),
|
| 470 | + fire_message(was_generated_by(T,Cmd)), |
461 | 471 | (running_silent(T,Opts) -> true; report('~w',[Cmd],SL,Opts)),
|
462 | 472 | update_hash(T,DL,Opts).
|
463 | 473 | dispatch_run_execs(Rule,SL,Opts) :-
|
|
545 | 555 | shell(Exec,Err),
|
546 | 556 | get_time(T2),
|
547 | 557 | DT is T2-T1,
|
| 558 | + fire_message(was_generated_by(T,Exec,Err,T1,T2)), |
548 | 559 | debug_report(build,' Return: ~w Time: ~w',[Err,DT],SL),
|
549 | 560 | handle_exec_error(Exec,Err,T,SL,Opts),
|
550 | 561 | !.
|
|
0 commit comments