1588 DEBUG_open <<
"Reading rule for target " << first <<
"... ";
1593 std::cerr <<
"Failed to load rules: syntax error" << std::endl;
1601 if (!first.empty()) targets.push_front(first);
1602 else if (targets.empty())
goto error;
1603 else DEBUG <<
"actual target: " << targets.front() << std::endl;
1604 bool generic =
false;
1606 for (string_list::const_iterator i = targets.begin(),
1607 i_end = targets.end(); i != i_end; ++i)
1609 if (i->empty())
goto error;
1610 if ((i->find(
'%') != std::string::npos) !=
generic)
1612 if (i == targets.begin())
generic =
true;
1616 std::swap(rule.
targets, targets);
1618 if (in.get() !=
':')
goto error;
1620 bool assignment =
false;
1654 if (!
skip_eol(in,
true))
goto error;
1657 std::ostringstream buf;
1661 if (!in.good())
break;
1662 if (c ==
'\t' || c ==
' ')
1664 in.get(*buf.rdbuf());
1665 if (in.fail() && !in.eof()) in.clear();
1667 else if (c ==
'\r' || c ==
'\n')
1678 if (rule.
targets.front() ==
".PHONY")
1680 for (string_list::const_iterator i = rule.
deps.begin(),
1681 i_end = rule.
deps.end(); i != i_end; ++i)
1691 if (assignment)
goto error;
1696 if (!rule.
script.empty())
1698 if (assignment)
goto error;
1705 std::swap(rule.
targets, targets);
1707 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