-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
33 lines (25 loc) · 1.02 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
OBJS = target/$(CROSS_TRIPLE)/java_generator.o target/$(CROSS_TRIPLE)/java_plugin.o
LDFLAGS := -static-libgcc -static-libstdc++ -Wl,-Bstatic
LDEXTRA := -s
ifneq ($(CROSS_TRIPLE), x86_64-w64-mingw32)
ifneq ($(CROSS_TRIPLE), i686-w64-mingw32)
LDEXTRA := -Wl,-Bdynamic -lpthread -s
endif
endif
ifeq ($(CROSS_TRIPLE), x86_64-apple-darwin14)
PATH := /usr/x86_64-apple-darwin14/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/osxcross/bin
CC := o64-clang
CXX := o64-clang++
CXXFLAGS := -std=c++11 -stdlib=libc++
LDFLAGS := -stdlib=libc++
LDEXTRA := -lc++ -lc++abi
endif
target/$(CROSS_TRIPLE)/protoc-gen-grpc-java.exe: init $(OBJS)
$(CXX) -W -o target/$(CROSS_TRIPLE)/protoc-gen-grpc-java.exe $(OBJS) $(LDFLAGS) -Ltarget/$(CROSS_TRIPLE)/protobuf-3.5.1 -lprotoc -lprotobuf $(LDEXTRA)
target/$(CROSS_TRIPLE)/%.o: src/main/cpp/%.cpp
$(CXX) -W -Itarget/protobuf-3.5.1/src -x c++ -c -DGRPC_VERSION=1.25.0 --std=c++0x -o $@ $< $(CXXFLAGS)
.PHONY: clean
init:
@mkdir -p target
clean:
@rm -f target