summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--Makefile.rules17
-rw-r--r--Makefile.toolchain2
3 files changed, 16 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index cc3a773e10..232f0cd6de 100644
--- a/Makefile
+++ b/Makefile
@@ -240,7 +240,7 @@ $(eval $(call get_sources,y))
$(eval $(call get_sources,ro))
dirs=core/$(CORE) chip/$(CHIP) $(BASEDIR) $(BDIR) common fuzz power test \
- cts/common cts/$(CTS_MODULE)
+ cts/common cts/$(CTS_MODULE) $(out)/gen
dirs+= private $(PDIR)
dirs+=$(shell find common -type d)
dirs+=$(shell find driver -type d)
diff --git a/Makefile.rules b/Makefile.rules
index d6150a5c47..e3d6e3164a 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -25,10 +25,9 @@ _common_dir_create := $(foreach d,$(common_dirs),$(shell [ -d $(out)/$(d) ] || \
mkdir -p $(out)/$(d)))
_sharedlib_dir_create := $(foreach d,$(dirs),$(shell \
[ -d $(out)/$(SHOBJLIB)/$(d) ] || mkdir -p $(out)/$(SHOBJLIB)/$(d)))
-_dir_create := $(foreach d,$(dirs),$(shell [ -d $(out)/$(BLD)/$(d) ] || \
- mkdir -p $(out)/RO/$(d); mkdir -p $(out)/RW/$(d)))
-_dir_y_create := $(foreach d,$(dirs-y),$(shell [ -d $(out)/$(BLD)/$(d) ] || \
- mkdir -p $(out)/RO/$(d); mkdir -p $(out)/RW/$(d)))
+_dir_create := $(foreach d,$(dirs) $(dirs-y),\
+ $(shell [ -d $(out)/$(BLD)/$(d) ] || mkdir -p $(out)/RO/$(d); \
+ mkdir -p $(out)/RW/$(d); mkdir -p $(out)/gen/$(d)))
# V unset for normal output, V=1 for verbose output, V=0 for silent build
# (warnings/errors only). Use echo thus: $(call echo,"stuff to echo")
@@ -109,6 +108,7 @@ cmd_c_to_taskinfo = $(BUILDCC) \
-MMD -MF $@.d -c $< -flto -o $@
cmd_link_taskinfo = $(BUILDCC) $(BUILD_CFLAGS) --shared -fPIC $^ \
$(BUILD_LDFLAGS) -flto -o $@
+cmd_proto_to_cxx = $(PROTOC) -I. --cpp_out=$(out)/gen $^
cmd_tp_hash = $(out)/util/gen_touchpad_hash \
$(if $(TOUCHPAD_FW),-f $(TOUCHPAD_FW)) -o $@
@@ -451,6 +451,15 @@ $(out)/RO/%.o:%.cc
$(out)/RW/%.o:%.cc
$(call quiet,cxx_to_o,CXX )
+$(out)/RO/%.pb.o:$(out)/gen/%.pb.cc
+ $(call quiet,cxx_to_o,CXX )
+$(out)/RW/%.pb.o:$(out)/gen/%.pb.cc
+ $(call quiet,cxx_to_o,CXX )
+$(out)/gen/%.pb.cc:%.proto
+ $(call quiet,proto_to_cxx,PROTOC )
+$(out)/gen/%.pb.h:%.proto
+ $(call quiet,proto_to_cxx,PROTOC )
+
$(out)/$(SHOBJLIB)/%.o: override LATE_CFLAGS_DEFINE:=-DSHAREDLIB_IMAGE
$(out)/$(SHOBJLIB)/%.o:%.c
$(call quiet,c_to_o,CC )
diff --git a/Makefile.toolchain b/Makefile.toolchain
index 1da81d3461..20a01ebb43 100644
--- a/Makefile.toolchain
+++ b/Makefile.toolchain
@@ -42,6 +42,7 @@ PKG_CONFIG?=pkg-config
BUILDCC?=$(CCACHE) gcc
HOSTCC?=$(CCACHE) $(HOST_CROSS_COMPILE)gcc
HOSTCXX?=$(CCACHE) $(HOST_CROSS_COMPILE)g++
+PROTOC?=protoc
C_WARN = -Wstrict-prototypes -Wdeclaration-after-statement -Wno-pointer-sign
COMMON_WARN = -Wall -Werror -Wundef -Wno-trigraphs -fno-strict-aliasing \
@@ -93,6 +94,7 @@ CFLAGS+= -fno-delete-null-pointer-checks
CFLAGS+= -fconserve-stack
endif
CFLAGS+= -DCHROMIUM_EC
+CXXFLAGS+=-DPROTOBUF_INLINE_NOT_IN_HEADERS=0
FTDIVERSION=$(shell $(PKG_CONFIG) --modversion libftdi1 2>/dev/null)
ifneq ($(FTDIVERSION),)