-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (29 loc) · 1.16 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
curdir:=$(shell pwd)
out:=$(curdir)/bin
hdfs_java_sources:=$(curdir)/src/ds/hdfs
classpath:=$(curdir)/lib/*:$(curdir)/bin/
proto_sources:=$(curdir)/src/ds/hdfs/protos
protoc_plugin_path:=$(curdir)/plugins
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
protoc_grpc_plugin_exe=protoc-gen-grpc-java-1.28.0-linux-x86_64.exe
protoc_exe=protoc-3.11.4-linux-x86_64/bin/protoc
endif
ifeq ($(UNAME_S),Darwin)
protoc_grpc_plugin_exe+=protoc-gen-grpc-java-1.28.0-osx-x86_64.exe
protoc_exe=protoc-3.11.4-osx-x86_64/bin/protoc
endif
all: proto hdfs mapreduce default_config
hdfs:
mkdir -p $(curdir)/bin
javac -d $(out) -cp $(classpath) $(hdfs_java_sources)/generated/*.java $(hdfs_java_sources)/*.java
mapreduce:
proto: clean
chmod +x $(protoc_plugin_path)/$(protoc_grpc_plugin_exe)
chmod +x $(protoc_plugin_path)/$(protoc_exe)
$(protoc_plugin_path)/$(protoc_exe) --plugin=protoc-gen-grpc-java=$(protoc_plugin_path)/$(protoc_grpc_plugin_exe) --grpc-java_out=src --proto_path=$(proto_sources) --java_out=src $(proto_sources)/hdfsformat.proto
default_config:
java -cp $(classpath) ds.hdfs.Config
clean:
rm -rf $(curdir)/bin/* $(curdir)/persist $(curdir)/src/ds/hdfs/generated/*
test: