move caffe.proto.v0 -> deprecated/caffe.v0.proto and add separate target
authorJeff Donahue <jeff.donahue@gmail.com>
Sat, 15 Mar 2014 05:24:12 +0000 (22:24 -0700)
committerJeff Donahue <jeff.donahue@gmail.com>
Fri, 28 Mar 2014 06:42:28 +0000 (23:42 -0700)
makefile target for it

Makefile
src/caffe/proto/deprecated/caffe.v0.proto [moved from src/caffe/proto/caffe.proto.v0 with 100% similarity]

index acef07d..26d3776 100644 (file)
--- 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