From dbd616b74831d6efff3401c99e309017e3112627 Mon Sep 17 00:00:00 2001 From: Jeff Donahue Date: Fri, 14 Mar 2014 22:24:12 -0700 Subject: [PATCH] move caffe.proto.v0 -> deprecated/caffe.v0.proto and add separate target makefile target for it --- Makefile | 16 +++++++++++++++- .../proto/{caffe.proto.v0 => deprecated/caffe.v0.proto} | 0 2 files changed, 15 insertions(+), 1 deletion(-) rename src/caffe/proto/{caffe.proto.v0 => deprecated/caffe.v0.proto} (100%) diff --git a/Makefile b/Makefile index acef07d..26d3776 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,9 @@ TOOL_SRCS := $(shell find tools -name "*.cpp") EXAMPLE_SRCS := $(shell find examples -name "*.cpp") # PROTO_SRCS are the protocol buffer definitions PROTO_SRCS := $(wildcard src/$(PROJECT)/proto/*.proto) +# DEPRECATED_PROTO_SRCS are protobuf definitions we no longer officially +# support, but keep around for upgrades etc. +DEPRECATED_PROTO_SRCS := $(wildcard src/$(PROJECT)/proto/deprecated/*.proto) # NONGEN_CXX_SRCS includes all source/header files except those generated # automatically (e.g., by proto). NONGEN_CXX_SRCS := $(shell find \ @@ -60,6 +63,10 @@ MAT$(PROJECT)_SO := matlab/$(PROJECT)/$(PROJECT) PROTO_GEN_HEADER := ${PROTO_SRCS:.proto=.pb.h} PROTO_GEN_CC := ${PROTO_SRCS:.proto=.pb.cc} PROTO_GEN_PY := ${PROTO_SRCS:.proto=_pb2.py} +# The generated files for deprecated protocol buffers +DEPRECATED_PROTO_GEN_HEADER := ${DEPRECATED_PROTO_SRCS:.proto=.pb.h} +DEPRECATED_PROTO_GEN_CC := ${DEPRECATED_PROTO_SRCS:.proto=.pb.cc} +DEPRECATED_PROTO_GEN_PY := ${DEPRECATED_PROTO_SRCS:.proto=_pb2.py} # The objects corresponding to the source files # These objects will be linked into the final shared library, so we # exclude the tool, example, and test objects. @@ -244,7 +251,7 @@ $(PROTO_GEN_PY): $(PROTO_SRCS) protoc --proto_path=src --python_out=python $(PROTO_SRCS) @echo -proto: $(PROTO_GEN_CC) +proto: $(PROTO_GEN_CC) $(DEPRECATED_PROTO_GEN_CC) $(PROTO_GEN_CC): $(PROTO_SRCS) protoc --proto_path=src --cpp_out=src $(PROTO_SRCS) @@ -252,9 +259,16 @@ $(PROTO_GEN_CC): $(PROTO_SRCS) cp $(PROTO_GEN_HEADER) include/$(PROJECT)/proto/ @echo +$(DEPRECATED_PROTO_GEN_CC): $(DEPRECATED_PROTO_SRCS) + protoc --proto_path=src --cpp_out=src $(DEPRECATED_PROTO_SRCS) + mkdir -p include/$(PROJECT)/proto/deprecated + cp $(DEPRECATED_PROTO_GEN_HEADER) include/$(PROJECT)/proto/deprecated/ + @echo + clean: @- $(RM) $(NAME) $(STATIC_NAME) @- $(RM) $(PROTO_GEN_HEADER) $(PROTO_GEN_CC) $(PROTO_GEN_PY) + @- $(RM) $(DEPRECATED_PROTO_GEN_HEADER) $(DEPRECATED_PROTO_GEN_CC) @- $(RM) include/$(PROJECT)/proto/$(PROJECT).pb.h @- $(RM) python/$(PROJECT)/proto/$(PROJECT)_pb2.py @- $(RM) python/$(PROJECT)/*.so diff --git a/src/caffe/proto/caffe.proto.v0 b/src/caffe/proto/deprecated/caffe.v0.proto similarity index 100% rename from src/caffe/proto/caffe.proto.v0 rename to src/caffe/proto/deprecated/caffe.v0.proto -- 2.7.4