1630 DEBUG_open <<
"Reading rule for target " << first <<
"... ";
1635 std::cerr <<
"Failed to load rules: syntax error" << std::endl;
1642 if (!first.empty()) targets.push_front(first);
1643 else if (targets.empty())
goto error;
1644 else DEBUG <<
"actual target: " << targets.front() << std::endl;
1645 bool generic =
false;
1647 for (string_list::const_iterator i = targets.begin(),
1648 i_end = targets.end(); i != i_end; ++i)
1650 if (i->empty())
goto error;
1651 if ((i->find(
'%') != std::string::npos) !=
generic)
1653 if (i == targets.begin())
generic =
true;
1658 if (in.get() !=
':')
goto error;
1660 bool assignment =
false, static_pattern =
false;
1694 if (rule.
targets.empty())
goto error;
1695 for (string_list::const_iterator i = rule.
targets.begin(),
1696 i_end = rule.
targets.end(); i != i_end; ++i)
1698 if (i->find(
'%') == std::string::npos)
goto error;
1701 static_pattern =
true;
1714 if (!
skip_eol(in,
true))
goto error;
1717 std::ostringstream buf;
1721 if (!in.good())
break;
1722 if (c ==
'\t' || c ==
' ')
1724 in.get(*buf.rdbuf());
1725 if (in.fail() && !in.eof()) in.clear();
1727 else if (c ==
'\r' || c ==
'\n')
1738 if (rule.
targets.front() ==
".PHONY")
1740 for (string_list::const_iterator i = rule.
deps.begin(),
1741 i_end = rule.
deps.end(); i != i_end; ++i)
1751 if (assignment)
goto error;
1756 if (!static_pattern)
1758 if (!rule.
script.empty() && assignment)
goto error;
1763 for (string_list::const_iterator i = targets.begin(),
1764 i_end = targets.end(); i != i_end; ++i)
static bool skip_eol(std::istream &in, bool multi=false)
static int expect_token(std::istream &in, int mask)
static std::string read_word(std::istream &in, bool detect_equal=true)
static void skip_spaces(std::istream &in)
static void register_rule(rule_t const &rule)
static void normalize_list(string_list &l, std::string const &w, std::string const &p)
static void instantiate_rule(std::string const &target, rule_t const &src, rule_t &dst)
static bool read_words(input_generator &in, string_list &res)
static rule_list generic_rules
std::list< std::string > string_list
@ Todo
Target is missing or obsolete.
assign_map assigns
Assignment of variables.
string_list wdeps
Like deps, except that they are not registered as dependencies.
std::string script
Shell script for building the targets.
string_list targets
Files produced by this rule.
std::string stem
Stem used to instantiate the rule, if any.
string_list deps
Dependencies used for an implicit call to remake at the start of the script.