From c25122e33993b6634280bd1babef4b329c112921 Mon Sep 17 00:00:00 2001
From: the6p4c <me@doggirl.gay>
Date: Fri, 17 Sep 2021 13:36:37 +1000
Subject: [PATCH] Fix protobuf backend build dependencies

backends/protobuf/protobuf.cc depends on the source and header files
generated by protoc, but this dependency wasn't explicitly declared. Add
a rule to the Makefile to fix intermittent build failures when the
protobuf header/source file isn't built before protobuf.cc.
---
 backends/protobuf/Makefile.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/backends/protobuf/Makefile.inc b/backends/protobuf/Makefile.inc
index 834cad42c..9cac9dcaa 100644
--- a/backends/protobuf/Makefile.inc
+++ b/backends/protobuf/Makefile.inc
@@ -3,6 +3,8 @@ ifeq ($(ENABLE_PROTOBUF),1)
 backends/protobuf/yosys.pb.cc backends/protobuf/yosys.pb.h: misc/yosys.proto
 	$(Q) cd misc && protoc --cpp_out "../backends/protobuf" yosys.proto
 
+backends/protobuf/protobuf.cc: backends/protobuf/yosys.pb.h
+
 OBJS += backends/protobuf/protobuf.o backends/protobuf/yosys.pb.o
 
 endif