Update HTML doc template.
[tmk.git] / tm_target.h
blob6faf4904c8acb5d4634c7a6909558e06c854acdf
1 #ifndef TM_TARGET_H
2 #define TM_TARGET_H
4 #include "tmake.h"
6 #define TM_EXPLICIT 0
7 #define TM_IMPLICIT 1
8 #define TM_FILENAME 2
9 #define TM_UPDATED 3
11 #define TM_UNMARKED 0
12 #define TM_TEMPORARY 1
13 #define TM_PERMANENT 2
15 struct target_list;
17 typedef struct tm_rule {
18 char *target;
19 struct target_list *deps;
20 char *recipe;
21 unsigned char type;
22 unsigned char mark;
23 } tm_rule;
25 typedef struct target_list {
26 char *name;
27 struct target_list *next;
28 } target_list;
30 typedef struct tm_rule_list {
31 struct tm_rule *rule;
32 struct tm_rule_list *next;
33 } tm_rule_list;
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);
60 extern char *tm_goal;
61 extern tm_rule_list *tm_rules;
63 #endif