From 1614d0848f6a1dc183d64abea792a4d0274e6aa6 Mon Sep 17 00:00:00 2001 From: dsavvinov Date: Fri, 12 Aug 2016 19:43:43 +0300 Subject: [PATCH] Protobuf: added generation of symlink to build script --- proto/compiler/Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/proto/compiler/Makefile b/proto/compiler/Makefile index 3e74e4a603d..862536be967 100644 --- a/proto/compiler/Makefile +++ b/proto/compiler/Makefile @@ -2,19 +2,22 @@ CXX = g++ CXXFLAGS = -O2 -std=c++11 LDFLAGS = -lprotoc -lprotobuf +# Generated artifacts BUILDDIR = build EXE = $(BUILDDIR)/protoc JAR = $(BUILDDIR)/protokot-runtime.jar +SYMLINK = $(BUILDDIR)/sources # C++ part -PROTOC_DIR = compiler/google/src/google/protobuf/compiler/kotlin +PROTOC_DIR = google/src/google/protobuf/compiler/kotlin PROTOC_EXE = $(PROTOC_DIR)/protoc # Kotlin part -RUNTIME_DIR = compiler/runtime +RUNTIME_DIR = runtime +RUNTIME_SRC = $(RUNTIME_DIR)/src/main/kotlin RUNTIME_JAR = $(RUNTIME_DIR)/build/libs/protokot-runtime.jar -all: $(EXE) $(JAR) +all: $(EXE) $(JAR) $(SYMLINK) # Place protoc* into build directory $(EXE): $(BUILDDIR) $(PROTOC_EXE) @@ -32,6 +35,9 @@ $(JAR): $(BUILDDIR) gradle_invoke gradle_invoke: cd $(RUNTIME_DIR); gradle build +$(SYMLINK): + ln -nsf ../$(RUNTIME_SRC) $(SYMLINK) + # Create auxillary directories $(BINDIR): mkdir -p $(BINDIR)