aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eval.cc22
-rw-r--r--testcase/empty_target_specific_var.mk2
-rw-r--r--testcase/empty_target_specific_var2.mk2
3 files changed, 5 insertions, 21 deletions
diff --git a/eval.cc b/eval.cc
index aaad21f..3772763 100644
--- a/eval.cc
+++ b/eval.cc
@@ -300,26 +300,10 @@ void Evaluator::EvalRule(const RuleStmt* stmt) {
return;
}
- // "test: =foo" is questionable but a valid rule definition (not a
- // target specific variable).
- // See https://github.com/google/kati/issues/83
- string buf;
if (!separator_pos) {
- KATI_WARN_LOC(loc_,
- "defining a target which starts with `=', "
- "which is not probably what you meant");
- buf = after_targets.as_string();
- if (stmt->sep == RuleStmt::SEP_SEMICOLON) {
- buf += ';';
- } else if (stmt->sep == RuleStmt::SEP_EQ ||
- stmt->sep == RuleStmt::SEP_FINALEQ) {
- buf += '=';
- }
- if (stmt->rhs) {
- buf += stmt->rhs->Eval(this);
- }
- after_targets = buf;
- separator_pos = string::npos;
+ // We used to make this a warning and otherwise accept it, but Make 4.1
+ // calls this out as an error, so let's follow.
+ Error("*** empty variable name.");
}
Rule* rule = new Rule();
diff --git a/testcase/empty_target_specific_var.mk b/testcase/empty_target_specific_var.mk
index fd9e6c1..5683eb2 100644
--- a/testcase/empty_target_specific_var.mk
+++ b/testcase/empty_target_specific_var.mk
@@ -4,4 +4,4 @@ test: =foo
var==foo
$(var):
- echo PASS
+ echo FAIL
diff --git a/testcase/empty_target_specific_var2.mk b/testcase/empty_target_specific_var2.mk
index 6defb52..960a615 100644
--- a/testcase/empty_target_specific_var2.mk
+++ b/testcase/empty_target_specific_var2.mk
@@ -8,4 +8,4 @@ $(call var)
eq_one:==1
$(eq_one):
- echo PASS
+ echo FAIL