1# PLEASE NOTE: This Makefile is provided as a convenience for those
2# who do not wish to interact with CMake. It is NOT SUPPORTED by the
3# Couchbase build team, and the production builds do NOT make use of
4# it, so bugs filed against it will need to be handled by those devs
5# who care to use it.
6
7ROOT:=$(CURDIR)
8PREFIX:=$(ROOT)/install
9MAKEFLAGS=--no-print-directory
10
11PASSTHRU_TARGETS=all analytics-install analyze clean clean-all clean-xfd clean-xfd-hard \
12  e2etest e2eviewtests geocouch-build-for-testing install reset run-mats test build/Makefile
13
14$(PASSTHRU_TARGETS):
15	@$(MAKE) -f Makefile \
16            MAKETYPE="Unix Makefiles" \
17            PREFIX="$(PREFIX)" CHMODCMD="chmod u+w" CP=cp \
18            SEPARATOR=/ RM=rm RMOPTS=-rf $@
19
20ICU_OPT=
21UNAME := $(shell uname -s)
22ifeq ($(UNAME),Darwin)
23    # MB-11442
24    ICU_OPT=-mmacosx-version-min=10.7
25endif
26
27icu4c/source/Makefile:
28	(cd icu4c/source && \
29	CFLAGS=$(ICU_OPT) CXXFLAGS=$(ICU_OPT) LDFLAGS=$(ICU_OPT) \
30	  ./configure "--prefix=$(PREFIX)")
31
32make-install-icu4c: icu4c/source/Makefile
33	$(MAKE) -C icu4c/source install
34
35make-install-couchdb-deps: make-install-icu4c
36
37DEPS_DIR := $(ROOT)/tlm/deps/packages
38
39# it's a little wasteful to call cmake all the time, but the code path taken
40# there might depend on the presence/absence of downloaded dependencies
41.PHONY: build_deps deps-all
42build_deps:
43	mkdir -p build_deps
44	(cd build_deps && cmake $(DEPS_DIR))
45
46dep-%: build_deps
47	$(MAKE) -C "build_deps" $(@:dep-%=build-and-cache-%)
48
49deps-all: build_deps
50	$(MAKE) -C "build_deps" build-and-cache-all
51