Skip to content

Commit 0972a04

Browse files
committed
Makefile: bail out on invalid HAVE_RULES value
1 parent 058dced commit 0972a04

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ifndef VERBOSE
55
endif
66
# To compile with rules, use 'make HAVE_RULES=yes'
77
ifndef HAVE_RULES
8-
HAVE_RULES=no
8+
HAVE_RULES=
99
endif
1010

1111
ifndef MATCHCOMPILER
@@ -160,6 +160,8 @@ ifeq ($(HAVE_RULES),yes)
160160
else
161161
LIBS=$(shell $(PCRE_CONFIG) --libs)
162162
endif
163+
else ifneq ($(HAVE_RULES),)
164+
$(error invalid HAVE_RULES value '$(HAVE_RULES)')
163165
endif
164166

165167
ifndef PREFIX

tools/dmake/dmake.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ int main(int argc, char **argv)
584584
<< "endif\n";
585585

586586
fout << "# To compile with rules, use 'make HAVE_RULES=yes'\n";
587-
makeConditionalVariable(fout, "HAVE_RULES", "no");
587+
makeConditionalVariable(fout, "HAVE_RULES", "");
588588

589589
makeMatchcompiler(fout, emptyString, emptyString);
590590

@@ -743,6 +743,8 @@ int main(int argc, char **argv)
743743
<< " else\n"
744744
<< " LIBS=$(shell $(PCRE_CONFIG) --libs)\n"
745745
<< " endif\n"
746+
<< "else ifneq ($(HAVE_RULES),)\n"
747+
<< " $(error invalid HAVE_RULES value '$(HAVE_RULES)')\n"
746748
<< "endif\n\n";
747749

748750
makeConditionalVariable(fout, "PREFIX", "/usr");

0 commit comments

Comments
 (0)