blob: ab137a865770c25f82cd3240d7519eddbc0df841 [file] [log] [blame]
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001# GRPC global makefile
2# This currently builds C and C++ code.
Nicolas "Pixel" Nobled49893d2015-04-21 04:57:45 +02003# This file has been automatically generated from a template file.
4# Please look at the templates directory instead.
Craig Tiller3b935482015-02-16 12:15:48 -08005
Craig Tillerd7f33352015-02-20 15:18:45 -08006# Copyright 2015, Google Inc.
Craig Tiller3b935482015-02-16 12:15:48 -08007# All rights reserved.
8#
9# Redistribution and use in source and binary forms, with or without
10# modification, are permitted provided that the following conditions are
11# met:
12#
13# * Redistributions of source code must retain the above copyright
14# notice, this list of conditions and the following disclaimer.
15# * Redistributions in binary form must reproduce the above
16# copyright notice, this list of conditions and the following disclaimer
17# in the documentation and/or other materials provided with the
18# distribution.
19# * Neither the name of Google Inc. nor the names of its
20# contributors may be used to endorse or promote products derived from
21# this software without specific prior written permission.
22#
23# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -080034<%!
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -080035 import re
Craig Tillerf5371ef2015-01-12 16:40:18 -080036 import os
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -080037
nnoblec87b1c52015-01-05 17:15:18 -080038 proto_re = re.compile('(.*)\\.proto')
nnoble72309c62014-12-12 11:42:26 -080039
nnoble72309c62014-12-12 11:42:26 -080040 def proto_to_cc(filename):
41 m = proto_re.match(filename)
42 if not m:
43 return filename
Nicolas "Pixel" Noble0caebbf2015-04-09 23:08:51 +020044 return '$(GENDIR)/' + m.group(1) + '.pb.cc $(GENDIR)/' + m.group(1) + '.grpc.pb.cc'
Nicolas "Pixel" Noble010f1e72015-04-23 02:23:49 +020045
46 sources_that_need_openssl = set()
47 sources_that_don_t_need_openssl = set()
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -080048%>
49
Craig Tiller96b49552015-01-21 16:29:01 -080050
51# Basic platform detection
52HOST_SYSTEM = $(shell uname | cut -f 1 -d_)
53ifeq ($(SYSTEM),)
54SYSTEM = $(HOST_SYSTEM)
55endif
Nicolas Noblef8681182015-03-18 14:25:44 -070056ifeq ($(SYSTEM),MSYS)
57SYSTEM = MINGW32
58endif
Craig Tiller96b49552015-01-21 16:29:01 -080059
60
Craig Tiller61b910f2015-02-15 10:54:07 -080061ifndef BUILDDIR
62BUILDDIR = .
63endif
64
Nicolas Noblef8681182015-03-18 14:25:44 -070065HAS_GCC = $(shell which gcc > /dev/null 2> /dev/null && echo true || echo false)
66HAS_CC = $(shell which cc > /dev/null 2> /dev/null && echo true || echo false)
67HAS_CLANG = $(shell which clang > /dev/null 2> /dev/null && echo true || echo false)
68
69ifeq ($(HAS_CC),true)
70DEFAULT_CC = cc
71DEFAULT_CXX = c++
72else
73ifeq ($(HAS_GCC),true)
74DEFAULT_CC = gcc
75DEFAULT_CXX = g++
76else
77ifeq ($(HAS_CLANG),true)
78DEFAULT_CC = clang
79DEFAULT_CXX = clang++
80else
81DEFAULT_CC = no_c_compiler
82DEFAULT_CXX = no_c++_compiler
83endif
84endif
85endif
86
87
Craig Tiller61b910f2015-02-15 10:54:07 -080088BINDIR = $(BUILDDIR)/bins
89OBJDIR = $(BUILDDIR)/objs
90LIBDIR = $(BUILDDIR)/libs
91GENDIR = $(BUILDDIR)/gens
92
ctiller8cfebb92015-01-06 15:02:12 -080093# Configurations
94
95VALID_CONFIG_opt = 1
Nicolas Noblef8681182015-03-18 14:25:44 -070096CC_opt = $(DEFAULT_CC)
97CXX_opt = $(DEFAULT_CXX)
98LD_opt = $(DEFAULT_CC)
99LDXX_opt = $(DEFAULT_CXX)
ctiller8cfebb92015-01-06 15:02:12 -0800100CPPFLAGS_opt = -O2
101LDFLAGS_opt =
102DEFINES_opt = NDEBUG
103
Vijay Paibc171132015-04-13 10:58:06 -0700104VALID_CONFIG_latprof = 1
105CC_latprof = $(DEFAULT_CC)
106CXX_latprof = $(DEFAULT_CXX)
107LD_latprof = $(DEFAULT_CC)
108LDXX_latprof = $(DEFAULT_CXX)
109CPPFLAGS_latprof = -O2 -DGRPC_LATENCY_PROFILER
110LDFLAGS_latprof =
111DEFINES_latprof = NDEBUG
112
ctiller8cfebb92015-01-06 15:02:12 -0800113VALID_CONFIG_dbg = 1
Nicolas Noblef8681182015-03-18 14:25:44 -0700114CC_dbg = $(DEFAULT_CC)
115CXX_dbg = $(DEFAULT_CXX)
116LD_dbg = $(DEFAULT_CC)
117LDXX_dbg = $(DEFAULT_CXX)
ctiller8cfebb92015-01-06 15:02:12 -0800118CPPFLAGS_dbg = -O0
119LDFLAGS_dbg =
120DEFINES_dbg = _DEBUG DEBUG
121
Vijay Paidc7110f2015-04-02 13:59:05 -0700122VALID_CONFIG_mutrace = 1
123CC_mutrace = $(DEFAULT_CC)
124CXX_mutrace = $(DEFAULT_CXX)
125LD_mutrace = $(DEFAULT_CC)
126LDXX_mutrace = $(DEFAULT_CXX)
127CPPFLAGS_mutrace = -O0
128LDFLAGS_mutrace = -rdynamic
129DEFINES_mutrace = _DEBUG DEBUG
130
Craig Tillerec0b8f32015-01-15 07:30:00 -0800131VALID_CONFIG_valgrind = 1
Craig Tillerc4da6b72015-01-15 08:01:14 -0800132REQUIRE_CUSTOM_LIBRARIES_valgrind = 1
Nicolas Noblef8681182015-03-18 14:25:44 -0700133CC_valgrind = $(DEFAULT_CC)
134CXX_valgrind = $(DEFAULT_CXX)
135LD_valgrind = $(DEFAULT_CC)
136LDXX_valgrind = $(DEFAULT_CXX)
Craig Tillerec0b8f32015-01-15 07:30:00 -0800137CPPFLAGS_valgrind = -O0
138OPENSSL_CFLAGS_valgrind = -DPURIFY
139LDFLAGS_valgrind =
Craig Tillerf6901be2015-02-27 09:12:58 -0800140DEFINES_valgrind = _DEBUG DEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=20
Craig Tillerec0b8f32015-01-15 07:30:00 -0800141
ctiller8cfebb92015-01-06 15:02:12 -0800142VALID_CONFIG_tsan = 1
Craig Tillerc4da6b72015-01-15 08:01:14 -0800143REQUIRE_CUSTOM_LIBRARIES_tsan = 1
ctiller8cfebb92015-01-06 15:02:12 -0800144CC_tsan = clang
145CXX_tsan = clang++
146LD_tsan = clang
147LDXX_tsan = clang++
148CPPFLAGS_tsan = -O1 -fsanitize=thread -fno-omit-frame-pointer
149LDFLAGS_tsan = -fsanitize=thread
Craig Tillerf6901be2015-02-27 09:12:58 -0800150DEFINES_tsan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=10
ctiller8cfebb92015-01-06 15:02:12 -0800151
152VALID_CONFIG_asan = 1
Craig Tillerc4da6b72015-01-15 08:01:14 -0800153REQUIRE_CUSTOM_LIBRARIES_asan = 1
ctiller8cfebb92015-01-06 15:02:12 -0800154CC_asan = clang
155CXX_asan = clang++
156LD_asan = clang
157LDXX_asan = clang++
Craig Tiller6902ad22015-04-16 08:01:49 -0700158CPPFLAGS_asan = -O0 -fsanitize=address -fno-omit-frame-pointer
ctiller8cfebb92015-01-06 15:02:12 -0800159LDFLAGS_asan = -fsanitize=address
Craig Tiller6902ad22015-04-16 08:01:49 -0700160DEFINES_asan = GRPC_TEST_SLOWDOWN_BUILD_FACTOR=5
ctiller8cfebb92015-01-06 15:02:12 -0800161
162VALID_CONFIG_msan = 1
Craig Tillerc4da6b72015-01-15 08:01:14 -0800163REQUIRE_CUSTOM_LIBRARIES_msan = 1
ctiller8cfebb92015-01-06 15:02:12 -0800164CC_msan = clang
Nicolas "Pixel" Nobled66cba22015-02-14 02:59:12 +0100165CXX_msan = clang++-libc++
ctiller8cfebb92015-01-06 15:02:12 -0800166LD_msan = clang
Nicolas "Pixel" Nobled66cba22015-02-14 02:59:12 +0100167LDXX_msan = clang++-libc++
Craig Tiller6902ad22015-04-16 08:01:49 -0700168CPPFLAGS_msan = -O0 -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1
Craig Tillerec0b8f32015-01-15 07:30:00 -0800169OPENSSL_CFLAGS_msan = -DPURIFY
Nicolas "Pixel" Nobled66cba22015-02-14 02:59:12 +0100170LDFLAGS_msan = -fsanitize=memory -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1
Craig Tillerf6901be2015-02-27 09:12:58 -0800171DEFINES_msan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=20
ctiller8cfebb92015-01-06 15:02:12 -0800172
Craig Tiller96bd5f62015-02-13 09:04:13 -0800173VALID_CONFIG_ubsan = 1
174REQUIRE_CUSTOM_LIBRARIES_ubsan = 1
175CC_ubsan = clang
176CXX_ubsan = clang++
177LD_ubsan = clang
178LDXX_ubsan = clang++
179CPPFLAGS_ubsan = -O1 -fsanitize=undefined -fno-omit-frame-pointer
180OPENSSL_CFLAGS_ubsan = -DPURIFY
Craig Tiller96bd5f62015-02-13 09:04:13 -0800181LDFLAGS_ubsan = -fsanitize=undefined
Craig Tillerf6901be2015-02-27 09:12:58 -0800182DEFINES_ubsan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=10
Craig Tiller96bd5f62015-02-13 09:04:13 -0800183
Craig Tiller699ba212015-01-13 17:02:20 -0800184VALID_CONFIG_gcov = 1
185CC_gcov = gcc
186CXX_gcov = g++
187LD_gcov = gcc
188LDXX_gcov = g++
189CPPFLAGS_gcov = -O0 -fprofile-arcs -ftest-coverage
190LDFLAGS_gcov = -fprofile-arcs -ftest-coverage
191DEFINES_gcov = NDEBUG
192
Nicolas Noble047b7272015-01-16 13:55:05 -0800193
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800194# General settings.
195# You may want to change these depending on your system.
196
197prefix ?= /usr/local
198
199PROTOC = protoc
yangg102e4fe2015-01-06 16:02:50 -0800200CONFIG ?= opt
ctiller8cfebb92015-01-06 15:02:12 -0800201CC = $(CC_$(CONFIG))
202CXX = $(CXX_$(CONFIG))
203LD = $(LD_$(CONFIG))
204LDXX = $(LDXX_$(CONFIG))
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800205AR = ar
Nicolas "Pixel" Nobled7631a42015-02-27 07:52:39 +0100206ifeq ($(SYSTEM),Linux)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800207STRIP = strip --strip-unneeded
Nicolas "Pixel" Nobled7631a42015-02-27 07:52:39 +0100208else
209ifeq ($(SYSTEM),Darwin)
210STRIP = strip -x
211else
212STRIP = strip
213endif
214endif
Nicolas "Pixel" Noble932d5d32015-02-21 02:15:34 +0100215INSTALL = install
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800216RM = rm -f
217
yangg102e4fe2015-01-06 16:02:50 -0800218ifndef VALID_CONFIG_$(CONFIG)
219$(error Invalid CONFIG value '$(CONFIG)')
220endif
221
Nicolas "Pixel" Noblee758ed12015-03-11 22:51:39 +0100222ifeq ($(SYSTEM),Linux)
223TMPOUT = /dev/null
224else
225TMPOUT = `mktemp /tmp/test-out-XXXXXX`
226endif
Nicolas Noble047b7272015-01-16 13:55:05 -0800227
Craig Tillercf133f42015-02-26 14:05:56 -0800228# Detect if we can use C++11
Nicolas "Pixel" Noblee758ed12015-03-11 22:51:39 +0100229CXX11_CHECK_CMD = $(CXX) -std=c++11 -o $(TMPOUT) -c test/build/c++11.cc
Craig Tillercf133f42015-02-26 14:05:56 -0800230HAS_CXX11 = $(shell $(CXX11_CHECK_CMD) 2> /dev/null && echo true || echo false)
231
Nicolas Noble047b7272015-01-16 13:55:05 -0800232# The HOST compiler settings are used to compile the protoc plugins.
233# In most cases, you won't have to change anything, but if you are
234# cross-compiling, you can override these variables from GNU make's
235# command line: make CC=cross-gcc HOST_CC=gcc
236
nnoble72309c62014-12-12 11:42:26 -0800237HOST_CC = $(CC)
238HOST_CXX = $(CXX)
239HOST_LD = $(LD)
240HOST_LDXX = $(LDXX)
241
ctillercab52e72015-01-06 13:10:23 -0800242CPPFLAGS += $(CPPFLAGS_$(CONFIG))
Nicolas "Pixel" Noble72743822015-02-20 20:59:29 +0100243DEFINES += $(DEFINES_$(CONFIG)) INSTALL_PREFIX=\"$(prefix)\"
ctiller8cfebb92015-01-06 15:02:12 -0800244LDFLAGS += $(LDFLAGS_$(CONFIG))
ctillercab52e72015-01-06 13:10:23 -0800245
Craig Tiller86fa1c52015-02-27 09:57:58 -0800246ifdef EXTRA_DEFINES
Craig Tillerf5065c52015-02-27 16:17:39 -0800247DEFINES += $(EXTRA_DEFINES)
Craig Tiller86fa1c52015-02-27 09:57:58 -0800248endif
249
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800250CFLAGS += -std=c89 -pedantic
Craig Tillercf133f42015-02-26 14:05:56 -0800251ifeq ($(HAS_CXX11),true)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800252CXXFLAGS += -std=c++11
Craig Tillercf133f42015-02-26 14:05:56 -0800253else
254CXXFLAGS += -std=c++0x
Craig Tillercf133f42015-02-26 14:05:56 -0800255endif
Nicolas Noblef8681182015-03-18 14:25:44 -0700256CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter
257LDFLAGS += -g
258
259ifneq ($(SYSTEM),MINGW32)
260PIC_CPPFLAGS = -fPIC
261CPPFLAGS += -fPIC
262LDFLAGS += -fPIC
263endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800264
Craig Tillerda224d62015-02-15 11:01:58 -0800265INCLUDES = . include $(GENDIR)
Craig Tiller96b49552015-01-21 16:29:01 -0800266ifeq ($(SYSTEM),Darwin)
Nicolas "Pixel" Noblee758ed12015-03-11 22:51:39 +0100267ifneq ($(wildcard /usr/local/ssl/include),)
268INCLUDES += /usr/local/ssl/include
269endif
270ifneq ($(wildcard /opt/local/include),)
271INCLUDES += /opt/local/include
272endif
273ifneq ($(wildcard /usr/local/include),)
274INCLUDES += /usr/local/include
275endif
Craig Tiller96b49552015-01-21 16:29:01 -0800276LIBS = m z
Nicolas "Pixel" Noblee758ed12015-03-11 22:51:39 +0100277ifneq ($(wildcard /usr/local/ssl/lib),)
278LDFLAGS += -L/usr/local/ssl/lib
279endif
280ifneq ($(wildcard /opt/local/lib),)
281LDFLAGS += -L/opt/local/lib
282endif
283ifneq ($(wildcard /usr/local/lib),)
284LDFLAGS += -L/usr/local/lib
285endif
Nicolas Noblef8681182015-03-18 14:25:44 -0700286endif
287
288ifeq ($(SYSTEM),Linux)
ctillerc008ae52015-01-07 15:33:00 -0800289LIBS = rt m z pthread
Craig Tiller96b49552015-01-21 16:29:01 -0800290LDFLAGS += -pthread
291endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800292
Nicolas Noblef8681182015-03-18 14:25:44 -0700293ifeq ($(SYSTEM),MINGW32)
294LIBS = m z pthread
295LDFLAGS += -pthread
296endif
297
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800298ifneq ($(wildcard /usr/src/gtest/src/gtest-all.cc),)
299GTEST_LIB = /usr/src/gtest/src/gtest-all.cc -I/usr/src/gtest
300else
301GTEST_LIB = -lgtest
302endif
chenwa8fd44a2014-12-10 15:13:55 -0800303GTEST_LIB += -lgflags
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800304ifeq ($(V),1)
305E = @:
306Q =
307else
308E = @echo
309Q = @
310endif
311
312VERSION = ${settings.version.major}.${settings.version.minor}.${settings.version.micro}.${settings.version.build}
313
314CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
315CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
316
317LDFLAGS += $(ARCH_FLAGS)
318LDLIBS += $(addprefix -l, $(LIBS))
319LDLIBSXX += $(addprefix -l, $(LIBSXX))
nnoble72309c62014-12-12 11:42:26 -0800320
321HOST_CPPFLAGS = $(CPPFLAGS)
322HOST_CFLAGS = $(CFLAGS)
323HOST_CXXFLAGS = $(CXXFLAGS)
324HOST_LDFLAGS = $(LDFLAGS)
325HOST_LDLIBS = $(LDLIBS)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800326
nnoble69ac39f2014-12-12 15:43:38 -0800327
328# These are automatically computed variables.
329# There shouldn't be any need to change anything from now on.
330
nnoble5b7f32a2014-12-22 08:12:44 -0800331ifeq ($(SYSTEM),MINGW32)
332SHARED_EXT = dll
333endif
334ifeq ($(SYSTEM),Darwin)
335SHARED_EXT = dylib
336endif
337ifeq ($(SHARED_EXT),)
338SHARED_EXT = so.$(VERSION)
339endif
340
nnoble69ac39f2014-12-12 15:43:38 -0800341ifeq ($(wildcard .git),)
342IS_GIT_FOLDER = false
343else
344IS_GIT_FOLDER = true
345endif
346
Nicolas Noblef8681182015-03-18 14:25:44 -0700347ifeq ($(SYSTEM),Linux)
348OPENSSL_REQUIRES_DL = true
349endif
350
351ifeq ($(SYSTEM),Darwin)
352OPENSSL_REQUIRES_DL = true
353endif
354
355ifeq ($(SYSTEM),MINGW32)
356OPENSSL_LIBS = ssl32 eay32
357else
358OPENSSL_LIBS = ssl crypto
359endif
360
361OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c $(addprefix -l, $(OPENSSL_LIBS)) $(LDFLAGS)
Nicolas "Pixel" Noblee758ed12015-03-11 22:51:39 +0100362ZLIB_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/zlib.c -lz $(LDFLAGS)
363PERFTOOLS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/perftools.c -lprofiler $(LDFLAGS)
364PROTOBUF_CHECK_CMD = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/protobuf.cc -lprotobuf $(LDFLAGS)
Nicolas Noblef8681182015-03-18 14:25:44 -0700365PROTOC_CMD = which protoc > /dev/null
Nicolas Noble53830622015-02-12 16:56:38 -0800366PROTOC_CHECK_CMD = protoc --version | grep -q libprotoc.3
Craig Tiller297fafa2015-01-15 15:46:39 -0800367
Nicolas Noblef8681182015-03-18 14:25:44 -0700368ifeq ($(OPENSSL_REQUIRES_DL),true)
369OPENSSL_ALPN_CHECK_CMD += -ldl
370endif
371
Craig Tiller50524cc2015-01-29 23:00:00 -0800372ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG)
Craig Tiller297fafa2015-01-15 15:46:39 -0800373HAS_SYSTEM_PERFTOOLS = $(shell $(PERFTOOLS_CHECK_CMD) 2> /dev/null && echo true || echo false)
374ifeq ($(HAS_SYSTEM_PERFTOOLS),true)
375DEFINES += GRPC_HAVE_PERFTOOLS
376LIBS += profiler
377endif
Craig Tiller50524cc2015-01-29 23:00:00 -0800378endif
nnoble69ac39f2014-12-12 15:43:38 -0800379
Nicolas "Pixel" Noble98ab9982015-02-21 04:22:16 +0100380HAS_SYSTEM_PROTOBUF_VERIFY = $(shell $(PROTOBUF_CHECK_CMD) 2> /dev/null && echo true || echo false)
Craig Tillerc4da6b72015-01-15 08:01:14 -0800381ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG)
nnoble60825402014-12-15 14:43:51 -0800382HAS_SYSTEM_OPENSSL_ALPN = $(shell $(OPENSSL_ALPN_CHECK_CMD) 2> /dev/null && echo true || echo false)
383HAS_SYSTEM_ZLIB = $(shell $(ZLIB_CHECK_CMD) 2> /dev/null && echo true || echo false)
Nicolas "Pixel" Noble98ab9982015-02-21 04:22:16 +0100384HAS_SYSTEM_PROTOBUF = $(HAS_SYSTEM_PROTOBUF_VERIFY)
Craig Tillerc4da6b72015-01-15 08:01:14 -0800385else
386# override system libraries if the config requires a custom compiled library
387HAS_SYSTEM_OPENSSL_ALPN = false
388HAS_SYSTEM_ZLIB = false
Nicolas Noble53830622015-02-12 16:56:38 -0800389HAS_SYSTEM_PROTOBUF = false
Craig Tillerc4da6b72015-01-15 08:01:14 -0800390endif
nnoble69ac39f2014-12-12 15:43:38 -0800391
Nicolas Noblef8681182015-03-18 14:25:44 -0700392HAS_PROTOC = $(shell $(PROTOC_CMD) 2> /dev/null && echo true || echo false)
Nicolas "Pixel" Noble98ab9982015-02-21 04:22:16 +0100393ifeq ($(HAS_PROTOC),true)
Nicolas Noble53830622015-02-12 16:56:38 -0800394HAS_VALID_PROTOC = $(shell $(PROTOC_CHECK_CMD) 2> /dev/null && echo true || echo false)
Nicolas "Pixel" Noble98ab9982015-02-21 04:22:16 +0100395else
396HAS_VALID_PROTOC = false
397endif
Nicolas Noble53830622015-02-12 16:56:38 -0800398
nnoble69ac39f2014-12-12 15:43:38 -0800399ifeq ($(wildcard third_party/openssl/ssl/ssl.h),)
400HAS_EMBEDDED_OPENSSL_ALPN = false
401else
402HAS_EMBEDDED_OPENSSL_ALPN = true
403endif
404
405ifeq ($(wildcard third_party/zlib/zlib.h),)
406HAS_EMBEDDED_ZLIB = false
407else
408HAS_EMBEDDED_ZLIB = true
409endif
410
Nicolas Noble53830622015-02-12 16:56:38 -0800411ifeq ($(wildcard third_party/protobuf/src/google/protobuf/descriptor.pb.h),)
412HAS_EMBEDDED_PROTOBUF = false
413ifneq ($(HAS_VALID_PROTOC),true)
414NO_PROTOC = true
415endif
416else
417HAS_EMBEDDED_PROTOBUF = true
418endif
419
nnoble69ac39f2014-12-12 15:43:38 -0800420ifeq ($(HAS_SYSTEM_ZLIB),false)
421ifeq ($(HAS_EMBEDDED_ZLIB),true)
Craig Tiller61b910f2015-02-15 10:54:07 -0800422ZLIB_DEP = $(LIBDIR)/$(CONFIG)/zlib/libz.a
nnoble69ac39f2014-12-12 15:43:38 -0800423CPPFLAGS += -Ithird_party/zlib
Craig Tillerda224d62015-02-15 11:01:58 -0800424LDFLAGS += -L$(LIBDIR)/$(CONFIG)/zlib
nnoble69ac39f2014-12-12 15:43:38 -0800425else
426DEP_MISSING += zlib
427endif
428endif
429
430ifeq ($(HAS_SYSTEM_OPENSSL_ALPN),false)
431ifeq ($(HAS_EMBEDDED_OPENSSL_ALPN),true)
Craig Tiller61b910f2015-02-15 10:54:07 -0800432OPENSSL_DEP = $(LIBDIR)/$(CONFIG)/openssl/libssl.a
433OPENSSL_MERGE_LIBS += $(LIBDIR)/$(CONFIG)/openssl/libssl.a $(LIBDIR)/$(CONFIG)/openssl/libcrypto.a
Craig Tillerec043032015-02-20 17:24:41 -0800434# need to prefix these to ensure overriding system libraries
435CPPFLAGS := -Ithird_party/openssl/include $(CPPFLAGS)
436LDFLAGS := -L$(LIBDIR)/$(CONFIG)/openssl $(LDFLAGS)
Nicolas Noblef8681182015-03-18 14:25:44 -0700437ifeq ($(OPENSSL_REQUIRES_DL),true)
nnoble5b7f32a2014-12-22 08:12:44 -0800438LIBS_SECURE = dl
Nicolas Noblef8681182015-03-18 14:25:44 -0700439endif
nnoble69ac39f2014-12-12 15:43:38 -0800440else
441NO_SECURE = true
442endif
nnoble5b7f32a2014-12-22 08:12:44 -0800443else
Nicolas Noblef8681182015-03-18 14:25:44 -0700444LIBS_SECURE = $(OPENSSL_LIBS)
445ifeq ($(OPENSSL_REQUIRES_DL),true)
446LIBS_SECURE += dl
447endif
nnoble69ac39f2014-12-12 15:43:38 -0800448endif
449
nnoble5b7f32a2014-12-22 08:12:44 -0800450LDLIBS_SECURE += $(addprefix -l, $(LIBS_SECURE))
451
Nicolas Noble53830622015-02-12 16:56:38 -0800452ifeq ($(HAS_SYSTEM_PROTOBUF),false)
453ifeq ($(HAS_EMBEDDED_PROTOBUF),true)
Craig Tiller61b910f2015-02-15 10:54:07 -0800454PROTOBUF_DEP = $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a
Craig Tiller9ec95fa2015-02-20 20:36:21 -0800455CPPFLAGS := -Ithird_party/protobuf/src $(CPPFLAGS)
456LDFLAGS := -L$(LIBDIR)/$(CONFIG)/protobuf $(LDFLAGS)
Craig Tiller61b910f2015-02-15 10:54:07 -0800457PROTOC = $(BINDIR)/$(CONFIG)/protobuf/protoc
Nicolas Noble53830622015-02-12 16:56:38 -0800458else
459NO_PROTOBUF = true
460endif
461else
462endif
463
464LIBS_PROTOBUF = protobuf
465LIBS_PROTOC = protoc protobuf
466
467LDLIBS_PROTOBUF += $(addprefix -l, $(LIBS_PROTOBUF))
468HOST_LDLIBS_PROTOC += $(addprefix -l, $(LIBS_PROTOC))
469
Craig Tiller12c82092015-01-15 08:45:56 -0800470ifeq ($(MAKECMDGOALS),clean)
nnoble69ac39f2014-12-12 15:43:38 -0800471NO_DEPS = true
472endif
473
Nicolas "Pixel" Noble98ab9982015-02-21 04:22:16 +0100474INSTALL_OK = false
475ifeq ($(HAS_VALID_PROTOC),true)
476ifeq ($(HAS_SYSTEM_PROTOBUF_VERIFY),true)
477INSTALL_OK = true
478endif
479endif
480
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800481.SECONDARY = %.pb.h %.pb.cc
482
Nicolas "Pixel" Noble522d7122015-02-19 01:28:02 +0100483PROTOC_PLUGINS =\
Craig Tillerf58b9ef2015-01-15 09:09:12 -0800484% for tgt in targets:
485% if tgt.build == 'protoc':
Craig Tiller61b910f2015-02-15 10:54:07 -0800486 $(BINDIR)/$(CONFIG)/${tgt.name}\
Craig Tillerf58b9ef2015-01-15 09:09:12 -0800487% endif
488% endfor
489
nnoble69ac39f2014-12-12 15:43:38 -0800490ifeq ($(DEP_MISSING),)
Nicolas "Pixel" Noble522d7122015-02-19 01:28:02 +0100491all: static shared plugins\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800492% for tgt in targets:
493% if tgt.build == 'all':
Craig Tiller61b910f2015-02-15 10:54:07 -0800494 $(BINDIR)/$(CONFIG)/${tgt.name}\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800495% endif
496% endfor
497
nnoble69ac39f2014-12-12 15:43:38 -0800498dep_error:
499 @echo "You shouldn't see this message - all of your dependencies are correct."
500else
501all: dep_error git_update stop
502
503dep_error:
504 @echo
505 @echo "DEPENDENCY ERROR"
506 @echo
507 @echo "You are missing system dependencies that are essential to build grpc,"
508 @echo "and the third_party directory doesn't have them:"
509 @echo
510 @echo " $(DEP_MISSING)"
511 @echo
512 @echo "Installing the development packages for your system will solve"
513 @echo "this issue. Please consult INSTALL to get more information."
514 @echo
515 @echo "If you need information about why these tests failed, run:"
516 @echo
517 @echo " make run_dep_checks"
518 @echo
519endif
520
521git_update:
522ifeq ($(IS_GIT_FOLDER),true)
523 @echo "Additionally, since you are in a git clone, you can download the"
524 @echo "missing dependencies in third_party by running the following command:"
525 @echo
ctiller64f29102014-12-15 10:40:59 -0800526 @echo " git submodule update --init"
nnoble69ac39f2014-12-12 15:43:38 -0800527 @echo
528endif
529
530openssl_dep_error: openssl_dep_message git_update stop
531
Nicolas Noble53830622015-02-12 16:56:38 -0800532protobuf_dep_error: protobuf_dep_message git_update stop
533
534protoc_dep_error: protoc_dep_message git_update stop
535
nnoble69ac39f2014-12-12 15:43:38 -0800536openssl_dep_message:
537 @echo
538 @echo "DEPENDENCY ERROR"
539 @echo
540 @echo "The target you are trying to run requires OpenSSL with ALPN support."
541 @echo "Your system doesn't have it, and neither does the third_party directory."
542 @echo
543 @echo "Please consult INSTALL to get more information."
544 @echo
545 @echo "If you need information about why these tests failed, run:"
546 @echo
547 @echo " make run_dep_checks"
548 @echo
549
Nicolas Noble53830622015-02-12 16:56:38 -0800550protobuf_dep_message:
551 @echo
552 @echo "DEPENDENCY ERROR"
553 @echo
554 @echo "The target you are trying to run requires protobuf 3.0.0+"
555 @echo "Your system doesn't have it, and neither does the third_party directory."
556 @echo
557 @echo "Please consult INSTALL to get more information."
558 @echo
559 @echo "If you need information about why these tests failed, run:"
560 @echo
561 @echo " make run_dep_checks"
562 @echo
563
564protoc_dep_message:
565 @echo
566 @echo "DEPENDENCY ERROR"
567 @echo
568 @echo "The target you are trying to run requires protobuf-compiler 3.0.0+"
569 @echo "Your system doesn't have it, and neither does the third_party directory."
570 @echo
571 @echo "Please consult INSTALL to get more information."
572 @echo
573 @echo "If you need information about why these tests failed, run:"
574 @echo
575 @echo " make run_dep_checks"
576 @echo
577
nnoble69ac39f2014-12-12 15:43:38 -0800578stop:
579 @false
580
ctiller09cb6d52014-12-19 17:38:22 -0800581% for tgt in targets:
Craig Tiller61b910f2015-02-15 10:54:07 -0800582${tgt.name}: $(BINDIR)/$(CONFIG)/${tgt.name}
ctiller09cb6d52014-12-19 17:38:22 -0800583% endfor
584
nnoble69ac39f2014-12-12 15:43:38 -0800585run_dep_checks:
nnoble69ac39f2014-12-12 15:43:38 -0800586 $(OPENSSL_ALPN_CHECK_CMD) || true
587 $(ZLIB_CHECK_CMD) || true
Nicolas Noble53830622015-02-12 16:56:38 -0800588 $(PERFTOOLS_CHECK_CMD) || true
589 $(PROTOBUF_CHECK_CMD) || true
590 $(PROTOC_CHECK_CMD) || true
nnoble69ac39f2014-12-12 15:43:38 -0800591
Craig Tiller61b910f2015-02-15 10:54:07 -0800592$(LIBDIR)/$(CONFIG)/zlib/libz.a:
Nicolas "Pixel" Noble17f2b592015-01-16 07:09:10 +0100593 $(E) "[MAKE] Building zlib"
Nicolas Noblef8681182015-03-18 14:25:44 -0700594 $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="$(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG))" ./configure --static)
Nicolas "Pixel" Noble17f2b592015-01-16 07:09:10 +0100595 $(Q)$(MAKE) -C third_party/zlib clean
596 $(Q)$(MAKE) -C third_party/zlib
Craig Tiller61b910f2015-02-15 10:54:07 -0800597 $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/zlib
598 $(Q)cp third_party/zlib/libz.a $(LIBDIR)/$(CONFIG)/zlib
nnoble69ac39f2014-12-12 15:43:38 -0800599
Craig Tiller61b910f2015-02-15 10:54:07 -0800600$(LIBDIR)/$(CONFIG)/openssl/libssl.a:
Craig Tillerb4ee3b52015-01-21 16:22:50 -0800601 $(E) "[MAKE] Building openssl for $(SYSTEM)"
602ifeq ($(SYSTEM),Darwin)
Nicolas Noblef8681182015-03-18 14:25:44 -0700603 $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./Configure darwin64-x86_64-cc)
Craig Tillerb4ee3b52015-01-21 16:22:50 -0800604else
Nicolas Noblef8681182015-03-18 14:25:44 -0700605ifeq ($(SYSTEM),MINGW32)
606 @echo "We currently don't have a good way to compile OpenSSL in-place under msys."
607 @echo "Please provide an ALPN-capable OpenSSL in your mingw32 system."
608 @echo
609 @echo "Note that you can find a compatible version of the libraries here:"
610 @echo
611 @echo "http://slproweb.com/products/Win32OpenSSL.html"
612 @echo
613 @echo "If you decide to install that one, take the full version. The light"
614 @echo "version only contains compiled DLLs, without the development files."
615 @echo
616 @echo "When installing, chose to copy the OpenSSL dlls to the OpenSSL binaries"
617 @echo "directory. This way we'll link to them directly."
618 @echo
619 @echo "You can then re-start the build the following way:"
620 @echo
621 @echo " CPPFLAGS=-I/c/OpenSSL-Win64/include LDFLAGS=-L/c/OpenSSL-Win64 make"
622 @false
623else
624 $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./config no-asm $(OPENSSL_CONFIG_$(CONFIG)))
625endif
Craig Tillerb4ee3b52015-01-21 16:22:50 -0800626endif
Nicolas "Pixel" Noble17f2b592015-01-16 07:09:10 +0100627 $(Q)$(MAKE) -C third_party/openssl clean
628 $(Q)$(MAKE) -C third_party/openssl build_crypto build_ssl
Craig Tiller61b910f2015-02-15 10:54:07 -0800629 $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/openssl
630 $(Q)cp third_party/openssl/libssl.a third_party/openssl/libcrypto.a $(LIBDIR)/$(CONFIG)/openssl
nnoble69ac39f2014-12-12 15:43:38 -0800631
Nicolas Noble53830622015-02-12 16:56:38 -0800632third_party/protobuf/configure:
633 $(E) "[AUTOGEN] Preparing protobuf"
634 $(Q)(cd third_party/protobuf ; autoreconf -f -i -Wall,no-obsolete)
635
Craig Tiller61b910f2015-02-15 10:54:07 -0800636$(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure
Nicolas Noble53830622015-02-12 16:56:38 -0800637 $(E) "[MAKE] Building protobuf"
Craig Tillercf133f42015-02-26 14:05:56 -0800638ifeq ($(HAVE_CXX11),true)
Nicolas Noblef8681182015-03-18 14:25:44 -0700639 $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static)
Craig Tillercf133f42015-02-26 14:05:56 -0800640else
Nicolas Noblef8681182015-03-18 14:25:44 -0700641 $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-std=c++0x" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static)
Craig Tillercf133f42015-02-26 14:05:56 -0800642endif
Nicolas Noble53830622015-02-12 16:56:38 -0800643 $(Q)$(MAKE) -C third_party/protobuf clean
644 $(Q)$(MAKE) -C third_party/protobuf
Craig Tiller61b910f2015-02-15 10:54:07 -0800645 $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/protobuf
646 $(Q)mkdir -p $(BINDIR)/$(CONFIG)/protobuf
647 $(Q)cp third_party/protobuf/src/.libs/libprotoc.a $(LIBDIR)/$(CONFIG)/protobuf
648 $(Q)cp third_party/protobuf/src/.libs/libprotobuf.a $(LIBDIR)/$(CONFIG)/protobuf
649 $(Q)cp third_party/protobuf/src/protoc $(BINDIR)/$(CONFIG)/protobuf
Nicolas Noble53830622015-02-12 16:56:38 -0800650
nnoble29e1d292014-12-01 10:27:40 -0800651static: static_c static_cxx
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800652
Craig Tiller12c82092015-01-15 08:45:56 -0800653static_c: \
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800654% for lib in libs:
Craig Tiller59140fc2015-01-18 10:12:17 -0800655% if lib.build == 'all' and lib.language == 'c':
Craig Tiller61b910f2015-02-15 10:54:07 -0800656 $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800657% endif
658% endfor
659
660
Craig Tiller12c82092015-01-15 08:45:56 -0800661static_cxx: \
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800662% for lib in libs:
Craig Tiller59140fc2015-01-18 10:12:17 -0800663% if lib.build == 'all' and lib.language == 'c++':
Craig Tiller61b910f2015-02-15 10:54:07 -0800664 $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\
nnoble29e1d292014-12-01 10:27:40 -0800665% endif
666% endfor
667
668
669shared: shared_c shared_cxx
670
Craig Tiller12c82092015-01-15 08:45:56 -0800671shared_c: \
nnoble29e1d292014-12-01 10:27:40 -0800672% for lib in libs:
Craig Tiller59140fc2015-01-18 10:12:17 -0800673% if lib.build == 'all' and lib.language == 'c':
Craig Tiller61b910f2015-02-15 10:54:07 -0800674 $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800675% endif
676% endfor
677
678
Craig Tiller12c82092015-01-15 08:45:56 -0800679shared_cxx: \
nnoble29e1d292014-12-01 10:27:40 -0800680% for lib in libs:
Craig Tiller59140fc2015-01-18 10:12:17 -0800681% if lib.build == 'all' and lib.language == 'c++':
Craig Tiller61b910f2015-02-15 10:54:07 -0800682 $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\
nnoble29e1d292014-12-01 10:27:40 -0800683% endif
684% endfor
685
686
Jan Tattermusch2ec0b3e2015-02-18 15:03:12 -0800687shared_csharp: shared_c \
688% for lib in libs:
689% if lib.build == 'all' and lib.language == 'csharp':
690 $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\
691% endif
692% endfor
693
694grpc_csharp_ext: shared_csharp
695
Nicolas "Pixel" Noble522d7122015-02-19 01:28:02 +0100696plugins: $(PROTOC_PLUGINS)
697
nnoble29e1d292014-12-01 10:27:40 -0800698privatelibs: privatelibs_c privatelibs_cxx
699
Craig Tiller12c82092015-01-15 08:45:56 -0800700privatelibs_c: \
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800701% for lib in libs:
Craig Tiller59140fc2015-01-18 10:12:17 -0800702% if lib.build == 'private' and lib.language == 'c':
Craig Tiller61b910f2015-02-15 10:54:07 -0800703 $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800704% endif
705% endfor
706
707
Craig Tiller12c82092015-01-15 08:45:56 -0800708privatelibs_cxx: \
nnoble29e1d292014-12-01 10:27:40 -0800709% for lib in libs:
Craig Tiller59140fc2015-01-18 10:12:17 -0800710% if lib.build == 'private' and lib.language == 'c++':
Craig Tiller61b910f2015-02-15 10:54:07 -0800711 $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800712% endif
713% endfor
714
715
nnoble29e1d292014-12-01 10:27:40 -0800716buildtests: buildtests_c buildtests_cxx
717
Craig Tiller12c82092015-01-15 08:45:56 -0800718buildtests_c: privatelibs_c\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800719% for tgt in targets:
Craig Tiller59140fc2015-01-18 10:12:17 -0800720% if tgt.build == 'test' and not tgt.language == 'c++':
Craig Tiller61b910f2015-02-15 10:54:07 -0800721 $(BINDIR)/$(CONFIG)/${tgt.name}\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800722% endif
723% endfor
724
725
Craig Tiller12c82092015-01-15 08:45:56 -0800726buildtests_cxx: privatelibs_cxx\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800727% for tgt in targets:
Craig Tiller59140fc2015-01-18 10:12:17 -0800728% if tgt.build == 'test' and tgt.language == 'c++':
Craig Tiller61b910f2015-02-15 10:54:07 -0800729 $(BINDIR)/$(CONFIG)/${tgt.name}\
nnoble29e1d292014-12-01 10:27:40 -0800730% endif
731% endfor
732
733
nnoble85a49262014-12-08 18:14:03 -0800734test: test_c test_cxx
nnoble29e1d292014-12-01 10:27:40 -0800735
nnoble85a49262014-12-08 18:14:03 -0800736test_c: buildtests_c
nnoble29e1d292014-12-01 10:27:40 -0800737% for tgt in targets:
Craig Tiller59140fc2015-01-18 10:12:17 -0800738% if tgt.build == 'test' and tgt.get('run', True) and not tgt.language == 'c++':
nnoble29e1d292014-12-01 10:27:40 -0800739 $(E) "[RUN] Testing ${tgt.name}"
Craig Tillerda224d62015-02-15 11:01:58 -0800740 $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 )
nnoble29e1d292014-12-01 10:27:40 -0800741% endif
742% endfor
743
744
nnoble85a49262014-12-08 18:14:03 -0800745test_cxx: buildtests_cxx
nnoble29e1d292014-12-01 10:27:40 -0800746% for tgt in targets:
Craig Tiller59140fc2015-01-18 10:12:17 -0800747% if tgt.build == 'test' and tgt.get('run', True) and tgt.language == 'c++':
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800748 $(E) "[RUN] Testing ${tgt.name}"
Craig Tillerda224d62015-02-15 11:01:58 -0800749 $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 )
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800750% endif
751% endfor
752
753
Nicolas "Pixel" Noble051a28f2015-03-17 22:54:54 +0100754test_python: static_c
755 $(E) "[RUN] Testing python code"
756 $(Q) tools/run_tests/run_tests.py -lpython -c$(CONFIG)
757
758
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800759tools: privatelibs\
760% for tgt in targets:
761% if tgt.build == 'tool':
Craig Tiller61b910f2015-02-15 10:54:07 -0800762 $(BINDIR)/$(CONFIG)/${tgt.name}\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800763% endif
764% endfor
765
766
767buildbenchmarks: privatelibs\
768% for tgt in targets:
769% if tgt.build == 'benchmark':
Craig Tiller61b910f2015-02-15 10:54:07 -0800770 $(BINDIR)/$(CONFIG)/${tgt.name}\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800771% endif
772% endfor
773
774
775benchmarks: buildbenchmarks
776
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800777strip: strip-static strip-shared
778
nnoble20e2e3f2014-12-16 15:37:57 -0800779strip-static: strip-static_c strip-static_cxx
780
781strip-shared: strip-shared_c strip-shared_cxx
782
Nicolas Noble047b7272015-01-16 13:55:05 -0800783
784# TODO(nnoble): the strip target is stripping in-place, instead
785# of copying files in a temporary folder.
786# This prevents proper debugging after running make install.
787
nnoble85a49262014-12-08 18:14:03 -0800788strip-static_c: static_c
Nicolas "Pixel" Noble3a2551c2015-01-29 21:33:32 +0100789ifeq ($(CONFIG),opt)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800790% for lib in libs:
Craig Tiller59140fc2015-01-18 10:12:17 -0800791% if lib.language == "c":
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800792% if lib.build == "all":
793 $(E) "[STRIP] Stripping lib${lib.name}.a"
Craig Tiller61b910f2015-02-15 10:54:07 -0800794 $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800795% endif
nnoble85a49262014-12-08 18:14:03 -0800796% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800797% endfor
Nicolas "Pixel" Noble3a2551c2015-01-29 21:33:32 +0100798endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800799
nnoble85a49262014-12-08 18:14:03 -0800800strip-static_cxx: static_cxx
Nicolas "Pixel" Noble3a2551c2015-01-29 21:33:32 +0100801ifeq ($(CONFIG),opt)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800802% for lib in libs:
Craig Tiller59140fc2015-01-18 10:12:17 -0800803% if lib.language == "c++":
nnoble85a49262014-12-08 18:14:03 -0800804% if lib.build == "all":
805 $(E) "[STRIP] Stripping lib${lib.name}.a"
Craig Tiller61b910f2015-02-15 10:54:07 -0800806 $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a
nnoble85a49262014-12-08 18:14:03 -0800807% endif
808% endif
809% endfor
Nicolas "Pixel" Noble3a2551c2015-01-29 21:33:32 +0100810endif
nnoble85a49262014-12-08 18:14:03 -0800811
812strip-shared_c: shared_c
Nicolas "Pixel" Noble3a2551c2015-01-29 21:33:32 +0100813ifeq ($(CONFIG),opt)
nnoble85a49262014-12-08 18:14:03 -0800814% for lib in libs:
Craig Tiller59140fc2015-01-18 10:12:17 -0800815% if lib.language == "c":
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800816% if lib.build == "all":
817 $(E) "[STRIP] Stripping lib${lib.name}.so"
Craig Tiller61b910f2015-02-15 10:54:07 -0800818 $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800819% endif
nnoble85a49262014-12-08 18:14:03 -0800820% endif
821% endfor
Nicolas "Pixel" Noble3a2551c2015-01-29 21:33:32 +0100822endif
nnoble85a49262014-12-08 18:14:03 -0800823
824strip-shared_cxx: shared_cxx
Nicolas "Pixel" Noble3a2551c2015-01-29 21:33:32 +0100825ifeq ($(CONFIG),opt)
nnoble85a49262014-12-08 18:14:03 -0800826% for lib in libs:
Craig Tiller59140fc2015-01-18 10:12:17 -0800827% if lib.language == "c++":
nnoble85a49262014-12-08 18:14:03 -0800828% if lib.build == "all":
829 $(E) "[STRIP] Stripping lib${lib.name}.so"
Craig Tiller61b910f2015-02-15 10:54:07 -0800830 $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)
nnoble85a49262014-12-08 18:14:03 -0800831% endif
832% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800833% endfor
Nicolas "Pixel" Noble3a2551c2015-01-29 21:33:32 +0100834endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800835
Jan Tattermusch2ec0b3e2015-02-18 15:03:12 -0800836strip-shared_csharp: shared_csharp
837ifeq ($(CONFIG),opt)
838% for lib in libs:
839% if lib.language == "csharp":
840% if lib.build == "all":
841 $(E) "[STRIP] Stripping lib${lib.name}.so"
842 $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)
843% endif
844% endif
845% endfor
846endif
847
nnoble72309c62014-12-12 11:42:26 -0800848% for p in protos:
Nicolas Noble53830622015-02-12 16:56:38 -0800849ifeq ($(NO_PROTOC),true)
Craig Tiller61b910f2015-02-15 10:54:07 -0800850$(GENDIR)/${p}.pb.cc: protoc_dep_error
Nicolas "Pixel" Noble0caebbf2015-04-09 23:08:51 +0200851$(GENDIR)/${p}.grpc.pb.cc: protoc_dep_error
Nicolas Noble53830622015-02-12 16:56:38 -0800852else
Craig Tiller61b910f2015-02-15 10:54:07 -0800853$(GENDIR)/${p}.pb.cc: ${p}.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800854 $(E) "[PROTOC] Generating protobuf CC file from $<"
855 $(Q) mkdir -p `dirname $@`
Nicolas "Pixel" Noble0caebbf2015-04-09 23:08:51 +0200856 $(Q) $(PROTOC) --cpp_out=$(GENDIR) $<
857
858$(GENDIR)/${p}.grpc.pb.cc: ${p}.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
859 $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<"
860 $(Q) mkdir -p `dirname $@`
861 $(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $<
Nicolas Noble53830622015-02-12 16:56:38 -0800862endif
nnoble72309c62014-12-12 11:42:26 -0800863
864% endfor
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800865
Craig Tiller61b910f2015-02-15 10:54:07 -0800866$(OBJDIR)/$(CONFIG)/%.o : %.c
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800867 $(E) "[C] Compiling $<"
868 $(Q) mkdir -p `dirname $@`
Craig Tiller12c82092015-01-15 08:45:56 -0800869 $(Q) $(CC) $(CFLAGS) $(CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $<
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800870
Craig Tiller61b910f2015-02-15 10:54:07 -0800871$(OBJDIR)/$(CONFIG)/%.o : $(GENDIR)/%.pb.cc
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800872 $(E) "[CXX] Compiling $<"
873 $(Q) mkdir -p `dirname $@`
Craig Tiller12c82092015-01-15 08:45:56 -0800874 $(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $<
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800875
Craig Tiller61b910f2015-02-15 10:54:07 -0800876$(OBJDIR)/$(CONFIG)/src/compiler/%.o : src/compiler/%.cc
nnoble72309c62014-12-12 11:42:26 -0800877 $(E) "[HOSTCXX] Compiling $<"
878 $(Q) mkdir -p `dirname $@`
Craig Tiller12c82092015-01-15 08:45:56 -0800879 $(Q) $(HOST_CXX) $(HOST_CXXFLAGS) $(HOST_CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $<
nnoble72309c62014-12-12 11:42:26 -0800880
Craig Tiller61b910f2015-02-15 10:54:07 -0800881$(OBJDIR)/$(CONFIG)/%.o : %.cc
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800882 $(E) "[CXX] Compiling $<"
883 $(Q) mkdir -p `dirname $@`
Craig Tiller12c82092015-01-15 08:45:56 -0800884 $(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $<
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800885
886
Nicolas "Pixel" Noble161ea232015-02-22 05:48:53 +0100887install: install_c install_cxx install-plugins install-certs verify-install
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800888
nnoble85a49262014-12-08 18:14:03 -0800889install_c: install-headers_c install-static_c install-shared_c
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800890
nnoble85a49262014-12-08 18:14:03 -0800891install_cxx: install-headers_cxx install-static_cxx install-shared_cxx
892
Jan Tattermusch2ec0b3e2015-02-18 15:03:12 -0800893install_csharp: install-shared_csharp install_c
894
895install_grpc_csharp_ext: install_csharp
896
nnoble85a49262014-12-08 18:14:03 -0800897install-headers: install-headers_c install-headers_cxx
898
899install-headers_c:
900 $(E) "[INSTALL] Installing public C headers"
Nicolas "Pixel" Noble932d5d32015-02-21 02:15:34 +0100901 $(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1
nnoble85a49262014-12-08 18:14:03 -0800902 $(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
903
904install-headers_cxx:
905 $(E) "[INSTALL] Installing public C++ headers"
Nicolas "Pixel" Noble932d5d32015-02-21 02:15:34 +0100906 $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1
nnoble85a49262014-12-08 18:14:03 -0800907 $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
908
909install-static: install-static_c install-static_cxx
910
911install-static_c: static_c strip-static_c
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800912% for lib in libs:
Craig Tiller59140fc2015-01-18 10:12:17 -0800913% if lib.language == "c":
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800914% if lib.build == "all":
915 $(E) "[INSTALL] Installing lib${lib.name}.a"
Nicolas "Pixel" Noble932d5d32015-02-21 02:15:34 +0100916 $(Q) $(INSTALL) -d $(prefix)/lib
Craig Tiller61b910f2015-02-15 10:54:07 -0800917 $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(prefix)/lib/lib${lib.name}.a
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800918% endif
nnoble85a49262014-12-08 18:14:03 -0800919% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800920% endfor
921
nnoble85a49262014-12-08 18:14:03 -0800922install-static_cxx: static_cxx strip-static_cxx
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800923% for lib in libs:
Craig Tiller59140fc2015-01-18 10:12:17 -0800924% if lib.language == "c++":
nnoble85a49262014-12-08 18:14:03 -0800925% if lib.build == "all":
926 $(E) "[INSTALL] Installing lib${lib.name}.a"
Nicolas "Pixel" Noble932d5d32015-02-21 02:15:34 +0100927 $(Q) $(INSTALL) -d $(prefix)/lib
Craig Tiller61b910f2015-02-15 10:54:07 -0800928 $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(prefix)/lib/lib${lib.name}.a
nnoble85a49262014-12-08 18:14:03 -0800929% endif
930% endif
931% endfor
932
Nicolas "Pixel" Noble522d7122015-02-19 01:28:02 +0100933<%def name="install_shared(lang_filter)">\
nnoble85a49262014-12-08 18:14:03 -0800934% for lib in libs:
Nicolas "Pixel" Noble522d7122015-02-19 01:28:02 +0100935% if lib.language == lang_filter:
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800936% if lib.build == "all":
nnoble5b7f32a2014-12-22 08:12:44 -0800937ifeq ($(SYSTEM),MINGW32)
938 $(E) "[INSTALL] Installing ${lib.name}.$(SHARED_EXT)"
Nicolas "Pixel" Noble932d5d32015-02-21 02:15:34 +0100939 $(Q) $(INSTALL) -d $(prefix)/lib
Craig Tiller61b910f2015-02-15 10:54:07 -0800940 $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/${lib.name}.$(SHARED_EXT) $(prefix)/lib/${lib.name}.$(SHARED_EXT)
941 $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}-imp.a $(prefix)/lib/lib${lib.name}-imp.a
nnoble5b7f32a2014-12-22 08:12:44 -0800942else
943 $(E) "[INSTALL] Installing lib${lib.name}.$(SHARED_EXT)"
Nicolas "Pixel" Noble932d5d32015-02-21 02:15:34 +0100944 $(Q) $(INSTALL) -d $(prefix)/lib
Craig Tiller61b910f2015-02-15 10:54:07 -0800945 $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.$(SHARED_EXT)
Masood Malekghassemid1be74f2015-04-07 16:23:09 -0700946ifneq ($(SYSTEM),Darwin)
Tim Emiola820e3d62015-04-10 09:11:50 -0700947 $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so.${settings.version.major}
nnoble5b7f32a2014-12-22 08:12:44 -0800948 $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so
949endif
950endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800951% endif
nnoble85a49262014-12-08 18:14:03 -0800952% endif
953% endfor
nnoble5b7f32a2014-12-22 08:12:44 -0800954ifneq ($(SYSTEM),MINGW32)
955ifneq ($(SYSTEM),Darwin)
Nicolas "Pixel" Noblecc2b42a2015-02-20 00:42:21 +0100956 $(Q) ldconfig || true
nnoble5b7f32a2014-12-22 08:12:44 -0800957endif
958endif
Nicolas "Pixel" Noble522d7122015-02-19 01:28:02 +0100959</%def>
nnoble85a49262014-12-08 18:14:03 -0800960
Nicolas "Pixel" Noble522d7122015-02-19 01:28:02 +0100961install-shared_c: shared_c strip-shared_c
962${install_shared("c")}
963
964install-shared_cxx: shared_cxx strip-shared_cxx install-shared_c
965${install_shared("c++")}
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800966
Jan Tattermusch2ec0b3e2015-02-18 15:03:12 -0800967install-shared_csharp: shared_csharp strip-shared_csharp
Nicolas "Pixel" Noble522d7122015-02-19 01:28:02 +0100968${install_shared("csharp")}
969
Nicolas "Pixel" Noble522d7122015-02-19 01:28:02 +0100970install-plugins: $(PROTOC_PLUGINS)
971ifeq ($(SYSTEM),MINGW32)
972 $(Q) false
973else
974 $(E) "[INSTALL] Installing grpc protoc plugins"
975% for tgt in targets:
976% if tgt.build == 'protoc':
Nicolas "Pixel" Noble932d5d32015-02-21 02:15:34 +0100977 $(Q) $(INSTALL) -d $(prefix)/bin
Nicolas "Pixel" Noble522d7122015-02-19 01:28:02 +0100978 $(Q) $(INSTALL) $(BINDIR)/$(CONFIG)/${tgt.name} $(prefix)/bin/${tgt.name}
979% endif
980% endfor
981endif
Jan Tattermusch2ec0b3e2015-02-18 15:03:12 -0800982
Nicolas "Pixel" Noble161ea232015-02-22 05:48:53 +0100983install-certs: etc/roots.pem
984 $(E) "[INSTALL] Installing root certificates"
985 $(Q) $(INSTALL) -d $(prefix)/share/grpc
986 $(Q) $(INSTALL) etc/roots.pem $(prefix)/share/grpc/roots.pem
987
Nicolas "Pixel" Noble98ab9982015-02-21 04:22:16 +0100988verify-install:
Nicolas "Pixel" Noble2c23a722015-02-24 20:17:45 +0100989ifeq ($(INSTALL_OK),true)
Nicolas "Pixel" Noble98ab9982015-02-21 04:22:16 +0100990 @echo "Your system looks ready to go."
991 @echo
992else
murgatroid99b6181362015-03-02 14:32:25 -0800993 @echo "We couldn't find protoc 3.0.0+ installed on your system. While this"
Nicolas "Pixel" Noble98ab9982015-02-21 04:22:16 +0100994 @echo "won't prevent grpc from working, you won't be able to compile"
995 @echo "and run any meaningful code with it."
996 @echo
997 @echo
998 @echo "Please download and install protobuf 3.0.0+ from:"
999 @echo
1000 @echo " https://github.com/google/protobuf/releases"
1001 @echo
murgatroid99b6181362015-03-02 14:32:25 -08001002 @echo "Once you've done so, or if you think this message is in error,"
1003 @echo "you can re-run this check by doing:"
Nicolas "Pixel" Noble98ab9982015-02-21 04:22:16 +01001004 @echo
1005 @echo " make verify-install"
1006endif
1007
Craig Tiller3759e6f2015-01-15 08:13:11 -08001008clean:
Nicolas "Pixel" Noble522d7122015-02-19 01:28:02 +01001009 $(E) "[CLEAN] Cleaning build directories."
Craig Tillerda224d62015-02-15 11:01:58 -08001010 $(Q) $(RM) -rf $(OBJDIR) $(LIBDIR) $(BINDIR) $(GENDIR)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001011
1012
1013# The various libraries
1014
1015% for lib in libs:
1016${makelib(lib)}
1017% endfor
1018
1019
nnoble69ac39f2014-12-12 15:43:38 -08001020# All of the test targets, and protoc plugins
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001021
1022% for tgt in targets:
1023${maketarget(tgt)}
1024% endfor
1025
1026<%def name="makelib(lib)">
1027LIB${lib.name.upper()}_SRC = \\
1028
1029% for src in lib.src:
nnoble72309c62014-12-12 11:42:26 -08001030 ${proto_to_cc(src)} \\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001031
1032% endfor
1033
1034% if "public_headers" in lib:
Craig Tiller59140fc2015-01-18 10:12:17 -08001035% if lib.language == "c++":
nnoble85a49262014-12-08 18:14:03 -08001036PUBLIC_HEADERS_CXX += \\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001037
nnoble85a49262014-12-08 18:14:03 -08001038% else:
1039PUBLIC_HEADERS_C += \\
1040
1041% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001042% for hdr in lib.public_headers:
1043 ${hdr} \\
1044
1045% endfor
1046% endif
1047
Craig Tiller61b910f2015-02-15 10:54:07 -08001048LIB${lib.name.upper()}_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIB${lib.name.upper()}_SRC))))
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001049
Nicolas Noble047b7272015-01-16 13:55:05 -08001050## If the library requires OpenSSL with ALPN, let's add some restrictions.
Nicolas "Pixel" Noble061690d2015-03-06 22:58:58 +01001051% if lib.get('secure', 'check') == 'yes' or lib.get('secure', 'check') == 'check':
nnoble69ac39f2014-12-12 15:43:38 -08001052ifeq ($(NO_SECURE),true)
1053
Nicolas Noble047b7272015-01-16 13:55:05 -08001054# You can't build secure libraries if you don't have OpenSSL with ALPN.
1055
Craig Tiller61b910f2015-02-15 10:54:07 -08001056$(LIBDIR)/$(CONFIG)/lib${lib.name}.a: openssl_dep_error
nnoble69ac39f2014-12-12 15:43:38 -08001057
nnoble5b7f32a2014-12-22 08:12:44 -08001058% if lib.build == "all":
1059ifeq ($(SYSTEM),MINGW32)
Craig Tiller61b910f2015-02-15 10:54:07 -08001060$(LIBDIR)/$(CONFIG)/${lib.name}.$(SHARED_EXT): openssl_dep_error
nnoble5b7f32a2014-12-22 08:12:44 -08001061else
Craig Tiller61b910f2015-02-15 10:54:07 -08001062$(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT): openssl_dep_error
nnoble5b7f32a2014-12-22 08:12:44 -08001063endif
1064% endif
1065
nnoble69ac39f2014-12-12 15:43:38 -08001066else
1067
Nicolas Noble53830622015-02-12 16:56:38 -08001068% if lib.language == 'c++':
1069ifeq ($(NO_PROTOBUF),true)
1070
1071# You can't build a C++ library if you don't have protobuf - a bit overreached, but still okay.
1072
Craig Tiller61b910f2015-02-15 10:54:07 -08001073$(LIBDIR)/$(CONFIG)/lib${lib.name}.a: protobuf_dep_error
Nicolas Noble53830622015-02-12 16:56:38 -08001074
1075% if lib.build == "all":
1076ifeq ($(SYSTEM),MINGW32)
Craig Tiller61b910f2015-02-15 10:54:07 -08001077$(LIBDIR)/$(CONFIG)/${lib.name}.$(SHARED_EXT): protobuf_dep_error
Nicolas Noble53830622015-02-12 16:56:38 -08001078else
Craig Tiller61b910f2015-02-15 10:54:07 -08001079$(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT): protobuf_dep_error
Nicolas Noble53830622015-02-12 16:56:38 -08001080endif
1081% endif
1082
1083else
1084% endif
1085
Craig Tiller61b910f2015-02-15 10:54:07 -08001086$(LIBDIR)/$(CONFIG)/lib${lib.name}.a: $(ZLIB_DEP) $(OPENSSL_DEP)\
Nicolas Noble047b7272015-01-16 13:55:05 -08001087## The else here corresponds to the if secure earlier.
nnoble20e2e3f2014-12-16 15:37:57 -08001088% else:
Nicolas Noble53830622015-02-12 16:56:38 -08001089% if lib.language == 'c++':
1090ifeq ($(NO_PROTOBUF),true)
1091
1092# You can't build a C++ library if you don't have protobuf - a bit overreached, but still okay.
1093
Craig Tiller61b910f2015-02-15 10:54:07 -08001094$(LIBDIR)/$(CONFIG)/lib${lib.name}.a: protobuf_dep_error
Nicolas Noble53830622015-02-12 16:56:38 -08001095
1096% if lib.build == "all":
1097ifeq ($(SYSTEM),MINGW32)
Craig Tiller61b910f2015-02-15 10:54:07 -08001098$(LIBDIR)/$(CONFIG)/${lib.name}.$(SHARED_EXT): protobuf_dep_error
Nicolas Noble53830622015-02-12 16:56:38 -08001099else
Craig Tiller61b910f2015-02-15 10:54:07 -08001100$(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT): protobuf_dep_error
Nicolas Noble53830622015-02-12 16:56:38 -08001101endif
nnoble20e2e3f2014-12-16 15:37:57 -08001102% endif
Nicolas Noble53830622015-02-12 16:56:38 -08001103
1104else
1105
1106% endif
Craig Tiller61b910f2015-02-15 10:54:07 -08001107$(LIBDIR)/$(CONFIG)/lib${lib.name}.a: $(ZLIB_DEP)\
Nicolas Noble53830622015-02-12 16:56:38 -08001108% endif
1109% if lib.language == 'c++':
1110 $(PROTOBUF_DEP)\
1111% endif
1112 $(LIB${lib.name.upper()}_OBJS)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001113 $(E) "[AR] Creating $@"
nnoble85a49262014-12-08 18:14:03 -08001114 $(Q) mkdir -p `dirname $@`
Craig Tiller61b910f2015-02-15 10:54:07 -08001115 $(Q) rm -f $(LIBDIR)/$(CONFIG)/lib${lib.name}.a
1116 $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(LIB${lib.name.upper()}_OBJS)
nnoble20e2e3f2014-12-16 15:37:57 -08001117% if lib.get('baselib', False):
Nicolas "Pixel" Noble061690d2015-03-06 22:58:58 +01001118% if lib.get('secure', 'check') == 'yes':
Craig Tiller7ab4fee2015-02-24 08:15:53 -08001119 $(Q) rm -rf tmp-merge-${lib.name}
1120 $(Q) mkdir tmp-merge-${lib.name}
1121 $(Q) ( cd tmp-merge-${lib.name} ; $(AR) x ../$(LIBDIR)/$(CONFIG)/lib${lib.name}.a )
1122 $(Q) for l in $(OPENSSL_MERGE_LIBS) ; do ( cd tmp-merge-${lib.name} ; <%text>ar x ../$${l}</%text> ) ; done
1123 $(Q) rm -f $(LIBDIR)/$(CONFIG)/lib${lib.name}.a tmp-merge-${lib.name}/__.SYMDEF*
1124 $(Q) ar rcs $(LIBDIR)/$(CONFIG)/lib${lib.name}.a tmp-merge-${lib.name}/*
1125 $(Q) rm -rf tmp-merge-${lib.name}
nnoble20e2e3f2014-12-16 15:37:57 -08001126% endif
1127% endif
Craig Tillerb4ee3b52015-01-21 16:22:50 -08001128ifeq ($(SYSTEM),Darwin)
murgatroid99b6181362015-03-02 14:32:25 -08001129 $(Q) ranlib $(LIBDIR)/$(CONFIG)/lib${lib.name}.a
Craig Tillerb4ee3b52015-01-21 16:22:50 -08001130endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001131
nnoble5b7f32a2014-12-22 08:12:44 -08001132<%
Nicolas "Pixel" Noble010f1e72015-04-23 02:23:49 +02001133
Craig Tiller59140fc2015-01-18 10:12:17 -08001134 if lib.language == 'c++':
nnoble5b7f32a2014-12-22 08:12:44 -08001135 ld = '$(LDXX)'
1136 else:
1137 ld = '$(LD)'
1138
Craig Tillerda224d62015-02-15 11:01:58 -08001139 out_base = '$(LIBDIR)/$(CONFIG)/' + lib.name
1140 out_libbase = '$(LIBDIR)/$(CONFIG)/lib' + lib.name
nnoble5b7f32a2014-12-22 08:12:44 -08001141
1142 common = '$(LIB' + lib.name.upper() + '_OBJS) $(LDLIBS)'
1143
1144 libs = ''
Nicolas "Pixel" Noble85bf09b2015-01-15 18:22:40 +01001145 lib_deps = ' $(ZLIB_DEP)'
nnoble5b7f32a2014-12-22 08:12:44 -08001146 mingw_libs = ''
Nicolas "Pixel" Noble85bf09b2015-01-15 18:22:40 +01001147 mingw_lib_deps = ' $(ZLIB_DEP)'
nnoble5b7f32a2014-12-22 08:12:44 -08001148 for dep in lib.get('deps', []):
1149 libs = libs + ' -l' + dep
Craig Tiller61b910f2015-02-15 10:54:07 -08001150 lib_deps = lib_deps + ' $(LIBDIR)/$(CONFIG)/lib' + dep + '.$(SHARED_EXT)'
nnoble5b7f32a2014-12-22 08:12:44 -08001151 mingw_libs = mingw_libs + ' -l' + dep + '-imp'
Craig Tillerda224d62015-02-15 11:01:58 -08001152 mingw_lib_deps = mingw_lib_deps + '$(LIBDIR)/$(CONFIG)/' + dep + '.$(SHARED_EXT)'
nnoble5b7f32a2014-12-22 08:12:44 -08001153
Nicolas "Pixel" Noble061690d2015-03-06 22:58:58 +01001154 if lib.get('secure', 'check') == 'yes':
nnoble5b7f32a2014-12-22 08:12:44 -08001155 common = common + ' $(LDLIBS_SECURE) $(OPENSSL_MERGE_LIBS)'
Nicolas "Pixel" Noble010f1e72015-04-23 02:23:49 +02001156 for src in lib.src:
1157 sources_that_need_openssl.add(src)
1158 else:
1159 for src in lib.src:
1160 sources_that_don_t_need_openssl.add(src)
Nicolas "Pixel" Noble061690d2015-03-06 22:58:58 +01001161
1162 if lib.get('secure', 'check') == 'yes' or lib.get('secure', 'check') == 'check':
nnoble5b7f32a2014-12-22 08:12:44 -08001163 lib_deps = lib_deps + ' $(OPENSSL_DEP)'
1164 mingw_lib_deps = mingw_lib_deps + ' $(OPENSSL_DEP)'
Nicolas "Pixel" Nobledda049c2015-02-21 00:39:32 +01001165
1166 if lib.language == 'c++':
1167 common = common + ' $(LDLIBSXX) $(LDLIBS_PROTOBUF)'
nnoble5b7f32a2014-12-22 08:12:44 -08001168%>
1169
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001170% if lib.build == "all":
nnoble5b7f32a2014-12-22 08:12:44 -08001171ifeq ($(SYSTEM),MINGW32)
1172${out_base}.$(SHARED_EXT): $(LIB${lib.name.upper()}_OBJS) ${mingw_lib_deps}
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001173 $(E) "[LD] Linking $@"
nnoble85a49262014-12-08 18:14:03 -08001174 $(Q) mkdir -p `dirname $@`
Craig Tillerda224d62015-02-15 11:01:58 -08001175 $(Q) ${ld} $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=${out_base}.def -Wl,--out-implib=${out_libbase}-imp.a -o ${out_base}.$(SHARED_EXT) ${common}${mingw_libs}
nnoble5b7f32a2014-12-22 08:12:44 -08001176else
1177${out_libbase}.$(SHARED_EXT): $(LIB${lib.name.upper()}_OBJS) ${lib_deps}
1178 $(E) "[LD] Linking $@"
1179 $(Q) mkdir -p `dirname $@`
1180ifeq ($(SYSTEM),Darwin)
Masood Malekghassemid1be74f2015-04-07 16:23:09 -07001181 $(Q) ${ld} $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name lib${lib.name}.$(SHARED_EXT) -dynamiclib -o ${out_libbase}.$(SHARED_EXT) ${common}${libs}
nnoble5b7f32a2014-12-22 08:12:44 -08001182else
Craig Tillerda224d62015-02-15 11:01:58 -08001183 $(Q) ${ld} $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,lib${lib.name}.so.${settings.version.major} -o ${out_libbase}.$(SHARED_EXT) ${common}${libs}
Nicolas "Pixel" Nobled8f8b6b2015-01-29 21:29:43 +01001184 $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) ${out_libbase}.so.${settings.version.major}
nnoble5b7f32a2014-12-22 08:12:44 -08001185 $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) ${out_libbase}.so
1186endif
1187endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001188% endif
Nicolas "Pixel" Noble061690d2015-03-06 22:58:58 +01001189% if lib.get('secure', 'check') == 'yes' or lib.get('secure', 'check') == 'check':
Nicolas Noble047b7272015-01-16 13:55:05 -08001190## If the lib was secure, we have to close the Makefile's if that tested
1191## the presence of an ALPN-capable OpenSSL.
Nicolas Noble53830622015-02-12 16:56:38 -08001192
1193endif
1194% endif
1195% if lib.language == 'c++':
1196## If the lib was C++, we have to close the Makefile's if that tested
1197## the presence of protobuf 3.0.0+
nnoble69ac39f2014-12-12 15:43:38 -08001198
1199endif
1200% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001201
Nicolas "Pixel" Noble061690d2015-03-06 22:58:58 +01001202% if lib.get('secure', 'check') == 'yes' or lib.get('secure', 'check') == 'check':
nnoble69ac39f2014-12-12 15:43:38 -08001203ifneq ($(NO_SECURE),true)
1204% endif
1205ifneq ($(NO_DEPS),true)
Craig Tiller8f126a62015-01-15 08:50:19 -08001206-include $(LIB${lib.name.upper()}_OBJS:.o=.dep)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001207endif
Nicolas "Pixel" Noble061690d2015-03-06 22:58:58 +01001208% if lib.get('secure', 'check') == 'yes' or lib.get('secure', 'check') == 'check':
nnoble69ac39f2014-12-12 15:43:38 -08001209endif
1210% endif
Craig Tiller27715ca2015-01-12 16:55:59 -08001211% for src in lib.src:
Craig Tillerd896fa52015-04-24 14:30:09 -07001212% if not proto_re.match(src) and any(proto_re.match(src2) for src2 in lib.src):
Craig Tiller04f81562015-04-24 14:34:30 -07001213$(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: ${' '.join(proto_to_cc(src2) for src2 in lib.src if proto_re.match(src2))}
Craig Tiller27715ca2015-01-12 16:55:59 -08001214% endif
Craig Tiller27715ca2015-01-12 16:55:59 -08001215% endfor
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001216</%def>
1217
1218<%def name="maketarget(tgt)">
1219${tgt.name.upper()}_SRC = \\
1220
1221% for src in tgt.src:
nnoble72309c62014-12-12 11:42:26 -08001222 ${proto_to_cc(src)} \\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001223
1224% endfor
1225
Craig Tiller61b910f2015-02-15 10:54:07 -08001226${tgt.name.upper()}_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(${tgt.name.upper()}_SRC))))
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001227
Nicolas "Pixel" Noble061690d2015-03-06 22:58:58 +01001228% if tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
nnoble69ac39f2014-12-12 15:43:38 -08001229ifeq ($(NO_SECURE),true)
1230
Nicolas Noble047b7272015-01-16 13:55:05 -08001231# You can't build secure targets if you don't have OpenSSL with ALPN.
1232
Craig Tiller61b910f2015-02-15 10:54:07 -08001233$(BINDIR)/$(CONFIG)/${tgt.name}: openssl_dep_error
nnoble69ac39f2014-12-12 15:43:38 -08001234
1235else
1236
1237% endif
Nicolas Noble047b7272015-01-16 13:55:05 -08001238##
1239## We're not trying to add a dependency on building zlib and openssl here,
1240## as it's already done in the libraries. We're assuming that the build
1241## trickles down, and that a secure target requires a secure version of
1242## a library.
1243##
1244## That simplifies the codegen a bit, but prevents a fully defined Makefile.
1245## I can live with that.
1246##
Nicolas "Pixel" Noble18953e32015-02-27 02:41:11 +01001247% if tgt.build == 'protoc' or tgt.language == 'c++':
Nicolas Noble53830622015-02-12 16:56:38 -08001248
1249ifeq ($(NO_PROTOBUF),true)
1250
Nicolas "Pixel" Noble18953e32015-02-27 02:41:11 +01001251# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
Nicolas Noble53830622015-02-12 16:56:38 -08001252
Craig Tiller61b910f2015-02-15 10:54:07 -08001253$(BINDIR)/$(CONFIG)/${tgt.name}: protobuf_dep_error
Nicolas Noble53830622015-02-12 16:56:38 -08001254
1255else
1256
Craig Tiller61b910f2015-02-15 10:54:07 -08001257$(BINDIR)/$(CONFIG)/${tgt.name}: $(PROTOBUF_DEP) $(${tgt.name.upper()}_OBJS)\
Nicolas Noble53830622015-02-12 16:56:38 -08001258% else:
Craig Tiller61b910f2015-02-15 10:54:07 -08001259$(BINDIR)/$(CONFIG)/${tgt.name}: $(${tgt.name.upper()}_OBJS)\
Nicolas Noble53830622015-02-12 16:56:38 -08001260% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001261% for dep in tgt.deps:
Craig Tiller61b910f2015-02-15 10:54:07 -08001262 $(LIBDIR)/$(CONFIG)/lib${dep}.a\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001263% endfor
1264
Craig Tiller59140fc2015-01-18 10:12:17 -08001265% if tgt.language == "c++":
Nicolas Noble047b7272015-01-16 13:55:05 -08001266## C++ targets specificies.
nnoble72309c62014-12-12 11:42:26 -08001267% if tgt.build == 'protoc':
1268 $(E) "[HOSTLD] Linking $@"
1269 $(Q) mkdir -p `dirname $@`
1270 $(Q) $(HOST_LDXX) $(HOST_LDFLAGS) $(${tgt.name.upper()}_OBJS)\
1271% else:
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001272 $(E) "[LD] Linking $@"
nnoble85a49262014-12-08 18:14:03 -08001273 $(Q) mkdir -p `dirname $@`
nnoblec78b3402014-12-11 16:06:57 -08001274 $(Q) $(LDXX) $(LDFLAGS) $(${tgt.name.upper()}_OBJS)\
nnoble72309c62014-12-12 11:42:26 -08001275% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001276% else:
Nicolas Noble047b7272015-01-16 13:55:05 -08001277## C-only targets specificities.
nnoble72309c62014-12-12 11:42:26 -08001278 $(E) "[LD] Linking $@"
1279 $(Q) mkdir -p `dirname $@`
nnoble5b7f32a2014-12-22 08:12:44 -08001280 $(Q) $(LD) $(LDFLAGS) $(${tgt.name.upper()}_OBJS)\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001281% endif
1282% for dep in tgt.deps:
Craig Tiller61b910f2015-02-15 10:54:07 -08001283 $(LIBDIR)/$(CONFIG)/lib${dep}.a\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001284% endfor
Craig Tiller59140fc2015-01-18 10:12:17 -08001285% if tgt.language == "c++":
nnoble72309c62014-12-12 11:42:26 -08001286% if tgt.build == 'protoc':
Nicolas Noble53830622015-02-12 16:56:38 -08001287 $(HOST_LDLIBSXX) $(HOST_LDLIBS_PROTOC)\
nnoble72309c62014-12-12 11:42:26 -08001288% else:
Nicolas Noble53830622015-02-12 16:56:38 -08001289 $(LDLIBSXX) $(LDLIBS_PROTOBUF)\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001290% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001291% endif
nnoblec78b3402014-12-11 16:06:57 -08001292% if tgt.build == 'protoc':
nnoble72309c62014-12-12 11:42:26 -08001293 $(HOST_LDLIBS)\
1294% else:
1295 $(LDLIBS)\
1296% endif
1297% if tgt.build == 'protoc':
1298 $(HOST_LDLIBS_PROTOC)\
Nicolas "Pixel" Noble061690d2015-03-06 22:58:58 +01001299% elif tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
nnoble72309c62014-12-12 11:42:26 -08001300 $(LDLIBS_SECURE)\
nnoblec78b3402014-12-11 16:06:57 -08001301% endif
Yang Gaob0b518e2015-04-13 14:53:25 -07001302% if tgt.language == 'c++' and tgt.build == 'test':
1303 $(GTEST_LIB)\
1304% endif
Craig Tiller61b910f2015-02-15 10:54:07 -08001305 -o $(BINDIR)/$(CONFIG)/${tgt.name}
Nicolas "Pixel" Noble18953e32015-02-27 02:41:11 +01001306% if tgt.build == 'protoc' or tgt.language == 'c++':
Nicolas Noble53830622015-02-12 16:56:38 -08001307
1308endif
1309% endif
Nicolas "Pixel" Noble061690d2015-03-06 22:58:58 +01001310% if tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
nnoble69ac39f2014-12-12 15:43:38 -08001311
1312endif
1313% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001314
Craig Tillerf5371ef2015-01-12 16:40:18 -08001315% for src in tgt.src:
Craig Tiller61b910f2015-02-15 10:54:07 -08001316$(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: \
Craig Tillerf5371ef2015-01-12 16:40:18 -08001317% for dep in tgt.deps:
Craig Tiller61b910f2015-02-15 10:54:07 -08001318 $(LIBDIR)/$(CONFIG)/lib${dep}.a\
Craig Tillerf5371ef2015-01-12 16:40:18 -08001319% endfor
1320
1321% endfor
1322
Craig Tiller8f126a62015-01-15 08:50:19 -08001323deps_${tgt.name}: $(${tgt.name.upper()}_OBJS:.o=.dep)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001324
Nicolas "Pixel" Noble061690d2015-03-06 22:58:58 +01001325% if tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
nnoble69ac39f2014-12-12 15:43:38 -08001326ifneq ($(NO_SECURE),true)
1327% endif
1328ifneq ($(NO_DEPS),true)
Craig Tiller8f126a62015-01-15 08:50:19 -08001329-include $(${tgt.name.upper()}_OBJS:.o=.dep)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001330endif
Nicolas "Pixel" Noble061690d2015-03-06 22:58:58 +01001331% if tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
nnoble69ac39f2014-12-12 15:43:38 -08001332endif
1333% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001334</%def>
1335
Nicolas "Pixel" Noble010f1e72015-04-23 02:23:49 +02001336ifneq ($(OPENSSL_DEP),)
1337# This is to ensure the embedded OpenSSL is built beforehand, properly
1338# installing headers to their final destination on the drive. We need this
1339# otherwise parallel compilation will fail if a source is compiled first.
1340% for src in sorted(sources_that_need_openssl):
1341% if src not in sources_that_don_t_need_openssl:
1342${src}: $(OPENSSL_DEP)
1343% endif
1344% endfor
1345endif
1346
nnoble85a49262014-12-08 18:14:03 -08001347.PHONY: all strip tools \
nnoble69ac39f2014-12-12 15:43:38 -08001348dep_error openssl_dep_error openssl_dep_message git_update stop \
nnoble85a49262014-12-08 18:14:03 -08001349buildtests buildtests_c buildtests_cxx \
1350test test_c test_cxx \
1351install install_c install_cxx \
1352install-headers install-headers_c install-headers_cxx \
1353install-shared install-shared_c install-shared_cxx \
1354install-static install-static_c install-static_cxx \
1355strip strip-shared strip-static \
1356strip_c strip-shared_c strip-static_c \
1357strip_cxx strip-shared_cxx strip-static_cxx \
Craig Tillerf0afe502015-01-15 09:04:49 -08001358dep_c dep_cxx bins_dep_c bins_dep_cxx \
Craig Tiller12c82092015-01-15 08:45:56 -08001359clean