1581 DEBUG_open <<
"Reading rule for target " << first <<
"... ";
1586 std::cerr <<
"Failed to load rules: syntax error" << std::endl;
1594 if (!first.empty()) targets.push_front(first);
1595 else if (targets.empty())
goto error;
1596 else DEBUG <<
"actual target: " << targets.front() << std::endl;
1597 bool generic =
false;
1599 for (string_list::const_iterator i = targets.begin(),
1600 i_end = targets.end(); i != i_end; ++i)
1602 if (i->empty())
goto error;
1603 if ((i->find(
'%') != std::string::npos) !=
generic)
1605 if (i == targets.begin())
generic =
true;
1609 std::swap(rule.
targets, targets);
1611 if (in.get() !=
':')
goto error;
1613 bool assignment =
false;
1647 if (!
skip_eol(in,
true))
goto error;
1650 std::ostringstream buf;
1654 if (!in.good())
break;
1655 if (c ==
'\t' || c ==
' ')
1657 in.get(*buf.rdbuf());
1658 if (in.fail() && !in.eof()) in.clear();
1660 else if (c ==
'\r' || c ==
'\n')
1671 if (rule.
targets.front() ==
".PHONY")
1673 for (string_list::const_iterator i = rule.
deps.begin(),
1674 i_end = rule.
deps.end(); i != i_end; ++i)
1684 if (assignment)
goto error;
1689 if (!rule.
script.empty())
1691 if (assignment)
goto error;
1698 std::swap(rule.
targets, targets);
1700 std::swap(rule.
targets, targets);
std::list< std::string > string_list
string_list wdeps
Like deps, except that they are not registered as dependencies.
static std::string first_target
static std::string read_word(std::istream &in, bool detect_equal=true)
string_list deps
Dependencies used for an implicit call to remake at the start of the script.
static bool skip_eol(std::istream &in, bool multi=false)
static bool read_words(input_generator &in, string_list &res)
static void register_scripted_rule(rule_t const &rule)
assign_map assigns
Assignment of variables.
Target is missing or obsolete.
string_list targets
Files produced by this rule.
std::string script
Shell script for building the targets.
static void skip_spaces(std::istream &in)
static void normalize_list(string_list &l, std::string const &w, std::string const &p)
static int expect_token(std::istream &in, int mask)
static void register_transparent_rule(rule_t const &rule, string_list const &targets)
static rule_list generic_rules