12 #define TM_TEMPORARY 1
13 #define TM_PERMANENT 2
17 typedef struct tm_rule
{
19 struct target_list
*deps
;
25 typedef struct target_list
{
27 struct target_list
*next
;
30 typedef struct tm_rule_list
{
32 struct tm_rule_list
*next
;
35 tm_rule
*new_rule(const char *target
, target_list
*deps
, const char *recipe
);
36 tm_rule
*new_filename(const char *target
);
38 target_list
*target_cons(const char *name
, target_list
*next
);
39 tm_rule_list
*rule_cons(tm_rule
*rule
, tm_rule_list
*next
);
41 target_list
*target_list_copy(target_list
*targets
);
43 int target_exists(const char *target
, target_list
*targets
);
44 tm_rule
*find_rule(const char *name
, tm_rule_list
*rules
);
45 tm_rule_list
*find_rules(target_list
*targets
, tm_rule_list
*rules
);
46 void find_files(tm_rule_list
**rules
);
48 tm_rule_list
*topsort(const char *target
, tm_rule_list
*rules
);
50 tm_rule_list
*rule_list_reverse(tm_rule_list
*rules
);
51 target_list
*target_list_reverse(target_list
*targets
);
53 void free_rule(tm_rule
*rule
);
54 void free_target_list(target_list
*targets
);
55 void free_rule_list(tm_rule_list
*rules
);
57 char *target_list_to_string(target_list
*targets
);
58 void print_rule_list(tm_rule_list
*rules
);
61 extern tm_rule_list
*tm_rules
;