anjana_sreekumar@infosys.com | 991c206 | 2020-01-08 11:42:57 +0530 | [diff] [blame^] | 1 | # |
| 2 | # Copyright (c) 2019, Infosys Ltd. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
| 17 | include ../../Makefile.common |
| 18 | |
| 19 | CFLAGS := -Wall -I$(GRPC_ROOT)/include -I$(GRPC_ROOT)/third_party/protobuf/src -std=c++11 |
| 20 | LDFLAGS := -L$(GRPC_ROOT)/libs/opt -lgrpc++ -lgrpc -lgpr -L$(GRPC_ROOT)/libs/opt/protobuf -lprotobuf |
| 21 | |
| 22 | SRCDIR := . |
| 23 | SRCS := ./mmeGrpcClient.cpp |
| 24 | OBJS := $(patsubst $(SRCDIR)/%,$(OBJDIR)/mmeGrpcClient/%,$(SRCS:.cpp=.o)) |
| 25 | |
| 26 | TARGET := $(BINDIR)/mme-grpc-client |
| 27 | |
| 28 | all: $(TARGET) |
| 29 | |
| 30 | $(TARGET) : $(OBJS) |
| 31 | @mkdir -p $(BINDIR) |
| 32 | g++ -o $(TARGET) $(OBJS) $(LIB_PATH) -lmmeGrpcProtoBuf $(LDFLAGS) |
| 33 | |
| 34 | $(OBJS) : $(OBJDIR)/mmeGrpcClient/%.o : $(SRCDIR)/%.cpp |
| 35 | -@mkdir -p $(OBJDIR)/mmeGrpcClient |
| 36 | g++ $(CFLAGS) $(INC_DIRS) -c -o $@ $< |
| 37 | |
| 38 | install : |
| 39 | -@mkdir -p $(TARGET_DIR)/bin |
| 40 | -@cp $(TARGET) $(TARGET_DIR)/bin |
| 41 | |
| 42 | clean: |
| 43 | -@rm -rf $(OBJDIR)/mmeGrpcClient $(TARGET) |