jvr/Makefile
2019-04-10 08:39:14 -04:00

40 lines
759 B
Makefile

# global definitions
CC := clang++
LD := $(CC)
PROC := protoc
INC_COMMON := inc
MK := mk
OUT := out
# global c and ld flags
CFLAGS = -c\
-Wall \
-Wextra \
-Wno-unused-parameter\
-std=c++17\
-g \
-O2 \
-I inc \
$(CFLAGS_$(MOD)) \
$(CFLAGS_$(d)_$<)
LDFLAGS = $(LDFLAGS_$(MOD)) \
$(LDFLAGS_$(d)_$<)
PROCFLAGS = -I $(d) --cpp_out=$(OUT)/$(d)
GRPC_CPP_PLUGIN = grpc_cpp_plugin
GRPC_CPP_PLUGIN_PATH ?= `which $(GRPC_CPP_PLUGIN)`
GRPCFLAGS = -I $(d) --plugin=protoc-gen-grpc=$(GRPC_CPP_PLUGIN_PATH) --grpc_out=$(OUT)/$(d)
PROTCOMP = $(PROC) $(PROCFLAGS) $<
GRPCCOMP = $(PROC) $(GRPCFLAGS) $<
COMP = $(CC) $(CFLAGS) -o $@ $<
MKDIR = mkdir -p $(dir $@)
LINK = $(LD) $^ $(LDFLAGS) $(LDFLAGS_TMP) -o $@
include Rules.top