-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
executable file
·84 lines (66 loc) · 2.59 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
PROJECT_DIR := $(shell pwd)
USER ?= $(shell id -un)
JOBS ?= $$(( $$(grep processor /proc/cpuinfo|tail -1|cut -d: -f2) + 1))
VERBOSE ?= 0
SRC_DIR ?= ${PROJECT_DIR}/src
EXTERNAL_DIR ?= ${PROJECT_DIR}/external
BSD_DIR ?= ${EXTERNAL_DIR}/bsd
MIT_DIR ?= ${EXTERNAL_DIR}/mit
APACHE_DIR ?= ${EXTERNAL_DIR}/apache
INSTALL_DIR ?= ${PROJECT_DIR}/opt
BUILD_DIR ?= ${PROJECT_DIR}/build
CMAKE ?= ${INSTALL_DIR}/bin/cmake
CPACK ?= ${INSTALL_DIR}/bin/cpack
# If clang is found, we prefer it, to build our own clang.
ifeq ($(shell if command -v clang 1> /dev/null; then echo clang; else echo ""; fi),clang)
CC := clang
CXX := clang++
CPP := 'clang -E'
export CC CPP CXX
endif
# List of all the projects / repositories
PROJECTS:= cmake llvm avatica
all: cmake llvm
@echo "-----------------------------------------------------------------------"
@echo ""
# Deprecated: run proteus-cli-server from Proteus reposistory.
#run-server: all
# cd ${INSTALL_DIR}/pelago && \
# java -jar ${INSTALL_DIR}/lib/clotho.jar \
# --server inputs/plans/schema.json
#
# Deprecated: run proteus-planner from Proteus reposistory.
#run-client: avatica
# JAVA_CLASSPATH=${INSTALL_DIR}/lib/avatica-1.13.0.jar \
# sqlline --color=true \
# -u "jdbc:avatica:remote:url=http://localhost:8081;serialization=PROTOBUF"
#######################################################################
# top-level targets, checks if a call to make is required before
# calling it.
#######################################################################
.PHONY: avatica
avatica: .avatica.install_done
.PHONY: external-libs
external-libs: cmake llvm
#######################################################################
# Package targets
#######################################################################
.PHONY: do-package-llvm
#######################################################################
# Install targets
#######################################################################
.PHONY: do-install-avatica
do-install-avatica:
[ -d ${INSTALL_DIR}/lib ] || mkdir -p ${INSTALL_DIR}/lib
cd ${INSTALL_DIR}/lib && curl -O https://repo1.maven.org/maven2/org/apache/calcite/avatica/avatica/1.13.0/avatica-1.13.0.jar
# As we just download the binary, there is no point in checking for all
# the preceding steps.
do-build-avatica do-conf-avatica:
true
#######################################################################
# Clean targets
#######################################################################
.PHONY: clean
#######################################################################
# Retrieve common definitions and targets.
include Makefile.common