1Makefile::AST(3) User Contributed Perl Documentation Makefile::AST(3)
2
3
4
6 Makefile::AST - AST for (GNU) makefiles
7
9 The structure of this (GNU) makefile AST is designed based on GNU
10 make's data base listing output produced by "--print-data-base".
11
12 This AST library provides the following classes:
13
14 Makefile::AST
15 The primary class for ASTs. Provides interface for node adding and
16 querying, such as "add_implicit_rule", "apply_implicit_rules",
17 "add_explicit_rule", "apply_explicit_rules", "add_var",
18 "add_auto_var", "get_var", as well as lots of other utility
19 functions, like method "eval_var_value" for computing the ultimate
20 values of makefile variables, method "enter_pad" and "leave_pad"
21 for local variable's scoping pad.
22
23 Makefile::AST::Rule::Base
24 This is the base class for the rule nodes in the AST. It has
25 properties like "normal_prereqs", "order_prereqs", "commands", and
26 "colon".
27
28 Makefile::AST::Rule
29 This class represents the de-sugared form of simple rules and
30 implicite rules after application. It inherits from
31 Makefile::AST::Rule::Base, and adds new properties "target" and
32 "other_targets".
33
34 Makefile::AST::Rule::Implicit
35 This class represents the implicit rule nodes in the AST. It
36 inherits from Makefile::AST::Rule::Base, and adds new properties
37 "targets", "match_anything", and "is_terminal".
38
39 Makefile::AST::StemMatch
40 This class encapsulates the file pattern matching (file names
41 containing "%") and stem substitution algorithms.
42
43 Makefile::AST::Variable
44 It represents the makefile variable nodes in the AST, including
45 "name", "value", "flavor", and "origin".
46
47 Makefile::AST::Command
48 Used to encapsulate information regarding makefile rule commands
49 (e.g. command body, command modifiers "@", "-", "+", and etc.) as a
50 whole.
51
53 Adding support for other flavors' makes into this AST libary should
54 make a huge amount of sense. The most interesting candiate is
55 Microsoft's NMAKE.
56
58 For the very latest version of this script, check out the source from
59
60 http://svn.openfoundry.org/makefileparser/branches/gmake-db
61 <http://svn.openfoundry.org/makefileparser/branches/gmake-db>.
62
63 There is anonymous access to all.
64
66 Agent Zhang "<agentzh@yahoo.cn>"
67
69 Copyright (c) 2007-2008 by Agent Zhang (agentzh).
70
71 This library is free software; you can redistribute it and/or modify it
72 under the same terms as Perl itself.
73
75 Makefile::AST::Evaluator, Makefile::Parser::GmakeDB, makesimple,
76 pgmake-db, Makefile::DOM.
77
78
79
80perl v5.12.0 2008-03-16 Makefile::AST(3)