Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1 | %YAML 1.2 |
| 2 | --- | |
| 3 | # GRPC global makefile |
| 4 | # This currently builds C and C++ code. |
| 5 | # This file has been automatically generated from a template file. |
| 6 | # Please look at the templates directory instead. |
| 7 | # This file can be regenerated from the template by running |
| 8 | # tools/buildgen/generate_projects.sh |
Craig Tiller | 3b93548 | 2015-02-16 12:15:48 -0800 | [diff] [blame] | 9 | |
murgatroid99 | 3466c4b | 2016-01-12 10:26:04 -0800 | [diff] [blame] | 10 | # Copyright 2015-2016, Google Inc. |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 11 | # All rights reserved. |
| 12 | # |
| 13 | # Redistribution and use in source and binary forms, with or without |
| 14 | # modification, are permitted provided that the following conditions are |
| 15 | # met: |
| 16 | # |
| 17 | # * Redistributions of source code must retain the above copyright |
| 18 | # notice, this list of conditions and the following disclaimer. |
| 19 | # * Redistributions in binary form must reproduce the above |
| 20 | # copyright notice, this list of conditions and the following disclaimer |
| 21 | # in the documentation and/or other materials provided with the |
| 22 | # distribution. |
| 23 | # * Neither the name of Google Inc. nor the names of its |
| 24 | # contributors may be used to endorse or promote products derived from |
| 25 | # this software without specific prior written permission. |
| 26 | # |
| 27 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 28 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 29 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 30 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 31 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 32 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 33 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 34 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 35 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 36 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 37 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 38 | <%! |
| 39 | import re |
| 40 | import os |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 41 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 42 | proto_re = re.compile('(.*)\\.proto') |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 43 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 44 | def proto_to_cc(filename): |
| 45 | m = proto_re.match(filename) |
| 46 | if not m: |
| 47 | return filename |
| 48 | return '$(GENDIR)/' + m.group(1) + '.pb.cc $(GENDIR)/' + m.group(1) + '.grpc.pb.cc' |
Nicolas "Pixel" Noble | 010f1e7 | 2015-04-23 02:23:49 +0200 | [diff] [blame] | 49 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 50 | sources_that_need_openssl = set() |
| 51 | sources_that_don_t_need_openssl = set() |
| 52 | %> |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 53 | |
Craig Tiller | 96b4955 | 2015-01-21 16:29:01 -0800 | [diff] [blame] | 54 | |
Craig Tiller | 71a8604 | 2016-01-15 14:59:58 -0800 | [diff] [blame] | 55 | comma := , |
| 56 | |
| 57 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 58 | # Basic platform detection |
| 59 | HOST_SYSTEM = $(shell uname | cut -f 1 -d_) |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 60 | SYSTEM ?= $(HOST_SYSTEM) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 61 | ifeq ($(SYSTEM),MSYS) |
| 62 | SYSTEM = MINGW32 |
| 63 | endif |
| 64 | ifeq ($(SYSTEM),MINGW64) |
| 65 | SYSTEM = MINGW32 |
| 66 | endif |
Craig Tiller | 96b4955 | 2015-01-21 16:29:01 -0800 | [diff] [blame] | 67 | |
| 68 | |
Nicolas "Pixel" Noble | 6dad9b0 | 2015-09-23 18:32:26 +0200 | [diff] [blame] | 69 | MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 70 | ifndef BUILDDIR |
Nicolas "Pixel" Noble | 42b4c28 | 2015-09-17 23:57:08 +0200 | [diff] [blame] | 71 | BUILDDIR_ABSOLUTE = $(patsubst %/,%,$(dir $(MAKEFILE_PATH))) |
| 72 | else |
| 73 | BUILDDIR_ABSOLUTE = $(abspath $(BUILDDIR)) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 74 | endif |
Craig Tiller | 61b910f | 2015-02-15 10:54:07 -0800 | [diff] [blame] | 75 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 76 | HAS_GCC = $(shell which gcc > /dev/null 2> /dev/null && echo true || echo false) |
| 77 | HAS_CC = $(shell which cc > /dev/null 2> /dev/null && echo true || echo false) |
| 78 | HAS_CLANG = $(shell which clang > /dev/null 2> /dev/null && echo true || echo false) |
Nicolas Noble | f868118 | 2015-03-18 14:25:44 -0700 | [diff] [blame] | 79 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 80 | ifeq ($(HAS_CC),true) |
| 81 | DEFAULT_CC = cc |
| 82 | DEFAULT_CXX = c++ |
| 83 | else |
| 84 | ifeq ($(HAS_GCC),true) |
| 85 | DEFAULT_CC = gcc |
| 86 | DEFAULT_CXX = g++ |
| 87 | else |
| 88 | ifeq ($(HAS_CLANG),true) |
| 89 | DEFAULT_CC = clang |
| 90 | DEFAULT_CXX = clang++ |
| 91 | else |
| 92 | DEFAULT_CC = no_c_compiler |
| 93 | DEFAULT_CXX = no_c++_compiler |
| 94 | endif |
| 95 | endif |
| 96 | endif |
Nicolas Noble | f868118 | 2015-03-18 14:25:44 -0700 | [diff] [blame] | 97 | |
| 98 | |
Nicolas "Pixel" Noble | 42b4c28 | 2015-09-17 23:57:08 +0200 | [diff] [blame] | 99 | BINDIR = $(BUILDDIR_ABSOLUTE)/bins |
| 100 | OBJDIR = $(BUILDDIR_ABSOLUTE)/objs |
| 101 | LIBDIR = $(BUILDDIR_ABSOLUTE)/libs |
| 102 | GENDIR = $(BUILDDIR_ABSOLUTE)/gens |
Craig Tiller | 61b910f | 2015-02-15 10:54:07 -0800 | [diff] [blame] | 103 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 104 | # Configurations |
ctiller | 8cfebb9 | 2015-01-06 15:02:12 -0800 | [diff] [blame] | 105 | |
Craig Tiller | a0f8517 | 2016-01-20 15:56:06 -0800 | [diff] [blame] | 106 | % for name, args in configs.iteritems(): |
| 107 | VALID_CONFIG_${name} = 1 |
| 108 | % if args.get('compile_the_world', False): |
| 109 | REQUIRE_CUSTOM_LIBRARIES_${name} = 1 |
| 110 | % endif |
Craig Tiller | aff3d50 | 2016-01-20 15:59:31 -0800 | [diff] [blame] | 111 | % for tool, default in [('CC', 'CC'), ('CXX', 'CXX'), ('LD', 'CC'), ('LDXX', 'CXX')]: |
Craig Tiller | a0f8517 | 2016-01-20 15:56:06 -0800 | [diff] [blame] | 112 | ${tool}_${name} = ${args.get(tool, '$(DEFAULT_%s)' % default)} |
| 113 | % endfor |
| 114 | % for arg in ['CFLAGS', 'CXXFLAGS', 'CPPFLAGS', 'LDFLAGS', 'DEFINES']: |
| 115 | % if args.get(arg, None) is not None: |
| 116 | ${arg}_${name} = ${args.get(arg)} |
| 117 | % endif |
| 118 | % endfor |
| 119 | % if args.get('timeout_multiplier', 1) != 1: |
| 120 | DEFINES_${name} += GRPC_TEST_SLOWDOWN_BUILD_FACTOR=${args.timeout_multiplier} |
| 121 | % endif |
ctiller | 8cfebb9 | 2015-01-06 15:02:12 -0800 | [diff] [blame] | 122 | |
Craig Tiller | a0f8517 | 2016-01-20 15:56:06 -0800 | [diff] [blame] | 123 | % endfor |
Craig Tiller | 699ba21 | 2015-01-13 17:02:20 -0800 | [diff] [blame] | 124 | |
Nicolas Noble | 047b727 | 2015-01-16 13:55:05 -0800 | [diff] [blame] | 125 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 126 | # General settings. |
| 127 | # You may want to change these depending on your system. |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 128 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 129 | prefix ?= /usr/local |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 130 | |
Nicolas "Pixel" Noble | 1a8eb85 | 2016-01-26 22:33:19 +0100 | [diff] [blame] | 131 | PROTOC ?= protoc |
| 132 | DTRACE ?= dtrace |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 133 | CONFIG ?= opt |
Nicolas "Pixel" Noble | fba36bc | 2016-01-27 03:24:03 +0100 | [diff] [blame] | 134 | # Doing X ?= Y is the same as: |
| 135 | # ifeq ($(origin X), undefined) |
| 136 | # X = Y |
| 137 | # endif |
| 138 | # but some variables, such as CC, CXX, LD or AR, have defaults. |
| 139 | # So instead of using ?= on them, we need to check their origin. |
| 140 | # See: |
| 141 | # https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html |
| 142 | # https://www.gnu.org/software/make/manual/html_node/Flavors.html#index-_003f_003d |
| 143 | # https://www.gnu.org/software/make/manual/html_node/Origin-Function.html |
| 144 | ifeq ($(origin CC), default) |
| 145 | CC = $(CC_$(CONFIG)) |
| 146 | endif |
| 147 | ifeq ($(origin CXX), default) |
| 148 | CXX = $(CXX_$(CONFIG)) |
| 149 | endif |
| 150 | ifeq ($(origin LD), default) |
| 151 | LD = $(LD_$(CONFIG)) |
| 152 | endif |
Nicolas "Pixel" Noble | 1a8eb85 | 2016-01-26 22:33:19 +0100 | [diff] [blame] | 153 | LDXX ?= $(LDXX_$(CONFIG)) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 154 | ifeq ($(SYSTEM),Linux) |
Nicolas "Pixel" Noble | 6e72dae | 2016-02-03 04:23:08 +0100 | [diff] [blame] | 155 | ifeq ($(origin AR), default) |
| 156 | AR = ar rcs |
| 157 | endif |
Nicolas "Pixel" Noble | 1a8eb85 | 2016-01-26 22:33:19 +0100 | [diff] [blame] | 158 | STRIP ?= strip --strip-unneeded |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 159 | else |
| 160 | ifeq ($(SYSTEM),Darwin) |
Nicolas "Pixel" Noble | 6e72dae | 2016-02-03 04:23:08 +0100 | [diff] [blame] | 161 | ifeq ($(origin AR), default) |
| 162 | AR = libtool -o |
| 163 | endif |
Nicolas "Pixel" Noble | 1a8eb85 | 2016-01-26 22:33:19 +0100 | [diff] [blame] | 164 | STRIP ?= strip -x |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 165 | else |
Nicolas "Pixel" Noble | 6e72dae | 2016-02-03 04:23:08 +0100 | [diff] [blame] | 166 | ifeq ($(origin AR), default) |
| 167 | AR = ar rcs |
| 168 | endif |
Nicolas "Pixel" Noble | 1a8eb85 | 2016-01-26 22:33:19 +0100 | [diff] [blame] | 169 | STRIP ?= strip |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 170 | endif |
| 171 | endif |
Nicolas "Pixel" Noble | 1a8eb85 | 2016-01-26 22:33:19 +0100 | [diff] [blame] | 172 | INSTALL ?= install |
| 173 | RM ?= rm -f |
| 174 | PKG_CONFIG ?= pkg-config |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 175 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 176 | ifndef VALID_CONFIG_$(CONFIG) |
| 177 | $(error Invalid CONFIG value '$(CONFIG)') |
| 178 | endif |
yangg | 102e4fe | 2015-01-06 16:02:50 -0800 | [diff] [blame] | 179 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 180 | ifeq ($(SYSTEM),Linux) |
| 181 | TMPOUT = /dev/null |
| 182 | else |
| 183 | TMPOUT = `mktemp /tmp/test-out-XXXXXX` |
| 184 | endif |
Nicolas Noble | 047b727 | 2015-01-16 13:55:05 -0800 | [diff] [blame] | 185 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 186 | # Detect if we can use C++11 |
| 187 | CXX11_CHECK_CMD = $(CXX) -std=c++11 -o $(TMPOUT) -c test/build/c++11.cc |
| 188 | HAS_CXX11 = $(shell $(CXX11_CHECK_CMD) 2> /dev/null && echo true || echo false) |
Craig Tiller | cf133f4 | 2015-02-26 14:05:56 -0800 | [diff] [blame] | 189 | |
Craig Tiller | 82f3f0d | 2016-01-25 11:27:42 -0800 | [diff] [blame] | 190 | CHECK_NO_SHIFT_NEGATIVE_VALUE_CMD = $(CC) -std=c99 -Werror -Wno-shift-negative-value -o $(TMPOUT) -c test/build/empty.c |
Craig Tiller | 16872b8 | 2016-01-25 10:55:20 -0800 | [diff] [blame] | 191 | HAS_NO_SHIFT_NEGATIVE_VALUE = $(shell $(CHECK_NO_SHIFT_NEGATIVE_VALUE_CMD) 2> /dev/null && echo true || echo false) |
| 192 | ifeq ($(HAS_NO_SHIFT_NEGATIVE_VALUE),true) |
| 193 | W_NO_SHIFT_NEGATIVE_VALUE=-Wno-shift-negative-value |
| 194 | endif |
| 195 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 196 | # The HOST compiler settings are used to compile the protoc plugins. |
| 197 | # In most cases, you won't have to change anything, but if you are |
| 198 | # cross-compiling, you can override these variables from GNU make's |
| 199 | # command line: make CC=cross-gcc HOST_CC=gcc |
Nicolas Noble | 047b727 | 2015-01-16 13:55:05 -0800 | [diff] [blame] | 200 | |
Nicolas "Pixel" Noble | 1a8eb85 | 2016-01-26 22:33:19 +0100 | [diff] [blame] | 201 | HOST_CC ?= $(CC) |
| 202 | HOST_CXX ?= $(CXX) |
| 203 | HOST_LD ?= $(LD) |
| 204 | HOST_LDXX ?= $(LDXX) |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 205 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 206 | ifdef EXTRA_DEFINES |
| 207 | DEFINES += $(EXTRA_DEFINES) |
| 208 | endif |
Craig Tiller | 86fa1c5 | 2015-02-27 09:57:58 -0800 | [diff] [blame] | 209 | |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 210 | CFLAGS += -std=c99 -Wsign-conversion -Wconversion -Wshadow |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 211 | ifeq ($(HAS_CXX11),true) |
| 212 | CXXFLAGS += -std=c++11 |
| 213 | else |
| 214 | CXXFLAGS += -std=c++0x |
| 215 | endif |
Nicolas "Pixel" Noble | 51b1aee | 2016-01-28 01:14:58 +0100 | [diff] [blame] | 216 | % for arg in ['CFLAGS', 'CXXFLAGS', 'CPPFLAGS', 'LDFLAGS', 'DEFINES']: |
| 217 | % if defaults.get('global', []).get(arg, None) is not None: |
| 218 | ${arg} += ${defaults.get('global').get(arg)} |
| 219 | % endif |
| 220 | % endfor |
Nicolas Noble | f868118 | 2015-03-18 14:25:44 -0700 | [diff] [blame] | 221 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 222 | CPPFLAGS += $(CPPFLAGS_$(CONFIG)) |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 223 | CFLAGS += $(CFLAGS_$(CONFIG)) |
| 224 | CXXFLAGS += $(CXXFLAGS_$(CONFIG)) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 225 | DEFINES += $(DEFINES_$(CONFIG)) INSTALL_PREFIX=\"$(prefix)\" |
| 226 | LDFLAGS += $(LDFLAGS_$(CONFIG)) |
Nicolas "Pixel" Noble | 482d761 | 2015-07-16 23:43:30 +0200 | [diff] [blame] | 227 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 228 | ifneq ($(SYSTEM),MINGW32) |
| 229 | PIC_CPPFLAGS = -fPIC |
| 230 | CPPFLAGS += -fPIC |
| 231 | LDFLAGS += -fPIC |
| 232 | endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 233 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 234 | INCLUDES = . include $(GENDIR) |
| 235 | LDFLAGS += -Llibs/$(CONFIG) |
Nicolas "Pixel" Noble | 3adab74 | 2015-06-02 00:33:06 +0200 | [diff] [blame] | 236 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 237 | ifeq ($(SYSTEM),Darwin) |
| 238 | ifneq ($(wildcard /usr/local/ssl/include),) |
| 239 | INCLUDES += /usr/local/ssl/include |
| 240 | endif |
| 241 | ifneq ($(wildcard /opt/local/include),) |
| 242 | INCLUDES += /opt/local/include |
| 243 | endif |
| 244 | ifneq ($(wildcard /usr/local/include),) |
| 245 | INCLUDES += /usr/local/include |
| 246 | endif |
| 247 | LIBS = m z |
| 248 | ifneq ($(wildcard /usr/local/ssl/lib),) |
| 249 | LDFLAGS += -L/usr/local/ssl/lib |
| 250 | endif |
| 251 | ifneq ($(wildcard /opt/local/lib),) |
| 252 | LDFLAGS += -L/opt/local/lib |
| 253 | endif |
| 254 | ifneq ($(wildcard /usr/local/lib),) |
| 255 | LDFLAGS += -L/usr/local/lib |
| 256 | endif |
| 257 | endif |
Nicolas Noble | f868118 | 2015-03-18 14:25:44 -0700 | [diff] [blame] | 258 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 259 | ifeq ($(SYSTEM),Linux) |
Craig Tiller | 1b1e238 | 2016-02-03 07:33:56 -0800 | [diff] [blame] | 260 | LIBS = dl rt m pthread |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 261 | LDFLAGS += -pthread |
| 262 | endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 263 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 264 | ifeq ($(SYSTEM),MINGW32) |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 265 | LIBS = m pthread ws2_32 |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 266 | LDFLAGS += -pthread |
| 267 | endif |
Nicolas Noble | f868118 | 2015-03-18 14:25:44 -0700 | [diff] [blame] | 268 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 269 | GTEST_LIB = -Ithird_party/googletest/include -Ithird_party/googletest third_party/googletest/src/gtest-all.cc |
| 270 | GTEST_LIB += -lgflags |
| 271 | ifeq ($(V),1) |
| 272 | E = @: |
| 273 | Q = |
| 274 | else |
| 275 | E = @echo |
| 276 | Q = @ |
| 277 | endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 278 | |
Craig Tiller | f008f06 | 2016-02-08 12:48:03 -0800 | [diff] [blame] | 279 | VERSION = ${settings.core_version} |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 280 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 281 | CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) |
| 282 | CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 283 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 284 | LDFLAGS += $(ARCH_FLAGS) |
| 285 | LDLIBS += $(addprefix -l, $(LIBS)) |
| 286 | LDLIBSXX += $(addprefix -l, $(LIBSXX)) |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 287 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 288 | HOST_CPPFLAGS = $(CPPFLAGS) |
| 289 | HOST_CFLAGS = $(CFLAGS) |
| 290 | HOST_CXXFLAGS = $(CXXFLAGS) |
| 291 | HOST_LDFLAGS = $(LDFLAGS) |
| 292 | HOST_LDLIBS = $(LDLIBS) |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 293 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 294 | # These are automatically computed variables. |
| 295 | # There shouldn't be any need to change anything from now on. |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 296 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 297 | -include cache.mk |
murgatroid99 | 24e2f4a | 2015-06-29 11:12:01 -0700 | [diff] [blame] | 298 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 299 | CACHE_MK = |
murgatroid99 | aa52157 | 2015-07-10 14:49:12 -0700 | [diff] [blame] | 300 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 301 | HAS_PKG_CONFIG ?= $(shell command -v $(PKG_CONFIG) >/dev/null 2>&1 && echo true || echo false) |
murgatroid99 | aa52157 | 2015-07-10 14:49:12 -0700 | [diff] [blame] | 302 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 303 | ifeq ($(HAS_PKG_CONFIG), true) |
| 304 | CACHE_MK += HAS_PKG_CONFIG = true, |
| 305 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 306 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 307 | PC_TEMPLATE = prefix=$(prefix),\ |
| 308 | exec_prefix=${'\$${prefix}'},\ |
| 309 | includedir=${'\$${prefix}'}/include,\ |
| 310 | libdir=${'\$${exec_prefix}'}/lib,\ |
| 311 | ,\ |
| 312 | Name: $(PC_NAME),\ |
| 313 | Description: $(PC_DESCRIPTION),\ |
| 314 | Version: $(VERSION),\ |
| 315 | Cflags: -I${'\$${includedir}'} $(PC_CFLAGS),\ |
| 316 | Requires.private: $(PC_REQUIRES_PRIVATE),\ |
| 317 | Libs: -L${'\$${libdir}'} $(PC_LIB),\ |
| 318 | Libs.private: $(PC_LIBS_PRIVATE) |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 319 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 320 | ifeq ($(SYSTEM),MINGW32) |
| 321 | SHARED_EXT = dll |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 322 | SHARED_PREFIX = |
Craig Tiller | f008f06 | 2016-02-08 12:48:03 -0800 | [diff] [blame] | 323 | SHARED_VERSION = -${settings.core_version.major} |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 324 | else ifeq ($(SYSTEM),Darwin) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 325 | SHARED_EXT = dylib |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 326 | SHARED_PREFIX = lib |
| 327 | SHARED_VERSION = |
| 328 | else |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 329 | SHARED_EXT = so.$(VERSION) |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 330 | SHARED_PREFIX = lib |
| 331 | SHARED_VERSION = |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 332 | endif |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 333 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 334 | ifeq ($(wildcard .git),) |
| 335 | IS_GIT_FOLDER = false |
| 336 | else |
| 337 | IS_GIT_FOLDER = true |
| 338 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 339 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 340 | ifeq ($(HAS_PKG_CONFIG),true) |
| 341 | OPENSSL_ALPN_CHECK_CMD = $(PKG_CONFIG) --atleast-version=1.0.2 openssl |
| 342 | OPENSSL_NPN_CHECK_CMD = $(PKG_CONFIG) --atleast-version=1.0.1 openssl |
| 343 | ZLIB_CHECK_CMD = $(PKG_CONFIG) --exists zlib |
| 344 | PROTOBUF_CHECK_CMD = $(PKG_CONFIG) --atleast-version=3.0.0-alpha-3 protobuf |
| 345 | else # HAS_PKG_CONFIG |
murgatroid99 | 24e2f4a | 2015-06-29 11:12:01 -0700 | [diff] [blame] | 346 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 347 | ifeq ($(SYSTEM),MINGW32) |
| 348 | OPENSSL_LIBS = ssl32 eay32 |
| 349 | else |
| 350 | OPENSSL_LIBS = ssl crypto |
| 351 | endif |
Nicolas Noble | f868118 | 2015-03-18 14:25:44 -0700 | [diff] [blame] | 352 | |
Nicolas "Pixel" Noble | 4500034 | 2016-01-28 05:04:45 +0100 | [diff] [blame] | 353 | OPENSSL_ALPN_CHECK_CMD = $(CC) $(CPPFLAGS) $(CFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c $(addprefix -l, $(OPENSSL_LIBS)) $(LDFLAGS) |
| 354 | OPENSSL_NPN_CHECK_CMD = $(CC) $(CPPFLAGS) $(CFLAGS) -o $(TMPOUT) test/build/openssl-npn.c $(addprefix -l, $(OPENSSL_LIBS)) $(LDFLAGS) |
| 355 | ZLIB_CHECK_CMD = $(CC) $(CPPFLAGS) $(CFLAGS) -o $(TMPOUT) test/build/zlib.c -lz $(LDFLAGS) |
| 356 | PROTOBUF_CHECK_CMD = $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $(TMPOUT) test/build/protobuf.cc -lprotobuf $(LDFLAGS) |
Craig Tiller | 297fafa | 2015-01-15 15:46:39 -0800 | [diff] [blame] | 357 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 358 | endif # HAS_PKG_CONFIG |
murgatroid99 | 24e2f4a | 2015-06-29 11:12:01 -0700 | [diff] [blame] | 359 | |
Nicolas "Pixel" Noble | 4500034 | 2016-01-28 05:04:45 +0100 | [diff] [blame] | 360 | PERFTOOLS_CHECK_CMD = $(CC) $(CPPFLAGS) $(CFLAGS) -o $(TMPOUT) test/build/perftools.c -lprofiler $(LDFLAGS) |
murgatroid99 | 6d9e401 | 2015-07-08 10:22:45 -0700 | [diff] [blame] | 361 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 362 | PROTOC_CHECK_CMD = which protoc > /dev/null |
| 363 | PROTOC_CHECK_VERSION_CMD = protoc --version | grep -q libprotoc.3 |
| 364 | DTRACE_CHECK_CMD = which dtrace > /dev/null |
Nicolas "Pixel" Noble | 4500034 | 2016-01-28 05:04:45 +0100 | [diff] [blame] | 365 | SYSTEMTAP_HEADERS_CHECK_CMD = $(CC) $(CPPFLAGS) $(CFLAGS) -o $(TMPOUT) test/build/systemtap.c $(LDFLAGS) |
| 366 | ZOOKEEPER_CHECK_CMD = $(CC) $(CPPFLAGS) $(CFLAGS) -o $(TMPOUT) test/build/zookeeper.c $(LDFLAGS) -lzookeeper_mt |
murgatroid99 | 24e2f4a | 2015-06-29 11:12:01 -0700 | [diff] [blame] | 367 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 368 | ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG) |
| 369 | HAS_SYSTEM_PERFTOOLS ?= $(shell $(PERFTOOLS_CHECK_CMD) 2> /dev/null && echo true || echo false) |
| 370 | ifeq ($(HAS_SYSTEM_PERFTOOLS),true) |
| 371 | DEFINES += GRPC_HAVE_PERFTOOLS |
| 372 | LIBS += profiler |
| 373 | CACHE_MK += HAS_SYSTEM_PERFTOOLS = true, |
| 374 | endif |
| 375 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 376 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 377 | HAS_SYSTEM_PROTOBUF_VERIFY = $(shell $(PROTOBUF_CHECK_CMD) 2> /dev/null && echo true || echo false) |
| 378 | ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG) |
| 379 | HAS_SYSTEM_OPENSSL_ALPN ?= $(shell $(OPENSSL_ALPN_CHECK_CMD) 2> /dev/null && echo true || echo false) |
| 380 | ifeq ($(HAS_SYSTEM_OPENSSL_ALPN),true) |
| 381 | HAS_SYSTEM_OPENSSL_NPN = true |
| 382 | CACHE_MK += HAS_SYSTEM_OPENSSL_ALPN = true, |
| 383 | else |
| 384 | HAS_SYSTEM_OPENSSL_NPN ?= $(shell $(OPENSSL_NPN_CHECK_CMD) 2> /dev/null && echo true || echo false) |
| 385 | endif |
| 386 | ifeq ($(HAS_SYSTEM_OPENSSL_NPN),true) |
| 387 | CACHE_MK += HAS_SYSTEM_OPENSSL_NPN = true, |
| 388 | endif |
| 389 | HAS_SYSTEM_ZLIB ?= $(shell $(ZLIB_CHECK_CMD) 2> /dev/null && echo true || echo false) |
| 390 | ifeq ($(HAS_SYSTEM_ZLIB),true) |
| 391 | CACHE_MK += HAS_SYSTEM_ZLIB = true, |
| 392 | endif |
| 393 | HAS_SYSTEM_PROTOBUF ?= $(HAS_SYSTEM_PROTOBUF_VERIFY) |
| 394 | ifeq ($(HAS_SYSTEM_PROTOBUF),true) |
| 395 | CACHE_MK += HAS_SYSTEM_PROTOBUF = true, |
| 396 | endif |
| 397 | else |
| 398 | # override system libraries if the config requires a custom compiled library |
| 399 | HAS_SYSTEM_OPENSSL_ALPN = false |
| 400 | HAS_SYSTEM_OPENSSL_NPN = false |
| 401 | HAS_SYSTEM_ZLIB = false |
| 402 | HAS_SYSTEM_PROTOBUF = false |
| 403 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 404 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 405 | HAS_PROTOC ?= $(shell $(PROTOC_CHECK_CMD) 2> /dev/null && echo true || echo false) |
| 406 | ifeq ($(HAS_PROTOC),true) |
| 407 | CACHE_MK += HAS_PROTOC = true, |
| 408 | HAS_VALID_PROTOC ?= $(shell $(PROTOC_CHECK_VERSION_CMD) 2> /dev/null && echo true || echo false) |
| 409 | ifeq ($(HAS_VALID_PROTOC),true) |
| 410 | CACHE_MK += HAS_VALID_PROTOC = true, |
| 411 | endif |
| 412 | else |
| 413 | HAS_VALID_PROTOC = false |
| 414 | endif |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 415 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 416 | # Check for Systemtap (https://sourceware.org/systemtap/), first by making sure <sys/sdt.h> is present |
| 417 | # in the system and secondly by checking for the "dtrace" binary (on Linux, this is part of the Systemtap |
| 418 | # distribution. It's part of the base system on BSD/Solaris machines). |
| 419 | ifndef HAS_SYSTEMTAP |
| 420 | HAS_SYSTEMTAP_HEADERS = $(shell $(SYSTEMTAP_HEADERS_CHECK_CMD) 2> /dev/null && echo true || echo false) |
| 421 | HAS_DTRACE = $(shell $(DTRACE_CHECK_CMD) 2> /dev/null && echo true || echo false) |
| 422 | HAS_SYSTEMTAP = false |
| 423 | ifeq ($(HAS_SYSTEMTAP_HEADERS),true) |
| 424 | ifeq ($(HAS_DTRACE),true) |
| 425 | HAS_SYSTEMTAP = true |
| 426 | endif |
| 427 | endif |
| 428 | endif |
David Garcia Quintas | 611b736 | 2015-04-27 15:49:31 -0700 | [diff] [blame] | 429 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 430 | ifeq ($(HAS_SYSTEMTAP),true) |
| 431 | CACHE_MK += HAS_SYSTEMTAP = true, |
| 432 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 433 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 434 | HAS_ZOOKEEPER = $(shell $(ZOOKEEPER_CHECK_CMD) 2> /dev/null && echo true || echo false) |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 435 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 436 | # Note that for testing purposes, one can do: |
| 437 | # make HAS_EMBEDDED_OPENSSL_ALPN=false |
| 438 | # to emulate the fact we do not have OpenSSL in the third_party folder. |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 439 | ifeq ($(wildcard third_party/boringssl/include/openssl/ssl.h),) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 440 | HAS_EMBEDDED_OPENSSL_ALPN = false |
| 441 | else |
| 442 | HAS_EMBEDDED_OPENSSL_ALPN = true |
| 443 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 444 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 445 | ifeq ($(wildcard third_party/zlib/zlib.h),) |
| 446 | HAS_EMBEDDED_ZLIB = false |
| 447 | else |
| 448 | HAS_EMBEDDED_ZLIB = true |
| 449 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 450 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 451 | ifeq ($(wildcard third_party/protobuf/src/google/protobuf/descriptor.pb.h),) |
| 452 | HAS_EMBEDDED_PROTOBUF = false |
| 453 | ifneq ($(HAS_VALID_PROTOC),true) |
| 454 | NO_PROTOC = true |
| 455 | endif |
| 456 | else |
| 457 | HAS_EMBEDDED_PROTOBUF = true |
| 458 | endif |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 459 | |
Nicolas "Pixel" Noble | 0912179 | 2016-01-30 09:01:53 +0100 | [diff] [blame] | 460 | PC_REQUIRES_GRPC = |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 461 | PC_LIBS_GRPC = |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 462 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 463 | ifeq ($(HAS_SYSTEM_ZLIB),false) |
Craig Tiller | 3dca23a | 2016-01-21 11:44:55 -0800 | [diff] [blame] | 464 | ifeq ($(HAS_EMBEDDED_ZLIB), true) |
| 465 | EMBED_ZLIB ?= true |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 466 | else |
| 467 | DEP_MISSING += zlib |
Craig Tiller | 3dca23a | 2016-01-21 11:44:55 -0800 | [diff] [blame] | 468 | EMBED_ZLIB ?= broken |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 469 | endif |
| 470 | else |
Craig Tiller | 3dca23a | 2016-01-21 11:44:55 -0800 | [diff] [blame] | 471 | EMBED_ZLIB ?= false |
| 472 | endif |
| 473 | |
| 474 | ifeq ($(EMBED_ZLIB),true) |
| 475 | ZLIB_DEP = $(LIBDIR)/$(CONFIG)/libz.a |
| 476 | ZLIB_MERGE_LIBS = $(LIBDIR)/$(CONFIG)/libz.a |
Nicolas "Pixel" Noble | f51a901 | 2016-02-03 07:39:43 +0100 | [diff] [blame] | 477 | ZLIB_MERGE_OBJS = $(LIBZ_OBJS) |
Craig Tiller | 3dca23a | 2016-01-21 11:44:55 -0800 | [diff] [blame] | 478 | CPPFLAGS += -Ithird_party/zlib |
| 479 | LDFLAGS += -L$(LIBDIR)/$(CONFIG)/zlib |
| 480 | else |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 481 | ifeq ($(HAS_PKG_CONFIG),true) |
| 482 | CPPFLAGS += $(shell $(PKG_CONFIG) --cflags zlib) |
| 483 | LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-L zlib) |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 484 | LIBS += $(patsubst -l%,%,$(shell $(PKG_CONFIG) --libs-only-l zlib)) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 485 | PC_REQUIRES_GRPC += zlib |
| 486 | else |
| 487 | PC_LIBS_GRPC += -lz |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 488 | LIBS += z |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 489 | endif |
| 490 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 491 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 492 | OPENSSL_PKG_CONFIG = false |
murgatroid99 | da7a994 | 2015-06-29 14:57:37 -0700 | [diff] [blame] | 493 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 494 | PC_REQUIRES_SECURE = |
| 495 | PC_LIBS_SECURE = |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 496 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 497 | ifeq ($(HAS_SYSTEM_OPENSSL_ALPN),true) |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 498 | EMBED_OPENSSL ?= false |
| 499 | NO_SECURE ?= false |
| 500 | else # HAS_SYSTEM_OPENSSL_ALPN=false |
| 501 | ifeq ($(HAS_EMBEDDED_OPENSSL_ALPN),true) |
| 502 | EMBED_OPENSSL ?= true |
| 503 | NO_SECURE ?= false |
| 504 | else # HAS_EMBEDDED_OPENSSL_ALPN=false |
| 505 | ifeq ($(HAS_SYSTEM_OPENSSL_NPN),true) |
| 506 | EMBED_OPENSSL ?= false |
| 507 | NO_SECURE ?= false |
| 508 | else |
| 509 | NO_SECURE ?= true |
| 510 | endif # HAS_SYSTEM_OPENSSL_NPN=true |
| 511 | endif # HAS_EMBEDDED_OPENSSL_ALPN |
| 512 | endif # HAS_SYSTEM_OPENSSL_ALPN |
| 513 | |
| 514 | OPENSSL_DEP := |
| 515 | OPENSSL_MERGE_LIBS := |
| 516 | ifeq ($(NO_SECURE),false) |
| 517 | ifeq ($(EMBED_OPENSSL),true) |
| 518 | OPENSSL_DEP += $(LIBDIR)/$(CONFIG)/libboringssl.a |
| 519 | OPENSSL_MERGE_LIBS += $(LIBDIR)/$(CONFIG)/libboringssl.a |
Nicolas "Pixel" Noble | f51a901 | 2016-02-03 07:39:43 +0100 | [diff] [blame] | 520 | OPENSSL_MERGE_OBJS += $(LIBBORINGSSL_OBJS) |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 521 | # need to prefix these to ensure overriding system libraries |
| 522 | CPPFLAGS := -Ithird_party/boringssl/include $(CPPFLAGS) |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 523 | else # EMBED_OPENSSL=false |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 524 | ifeq ($(HAS_PKG_CONFIG),true) |
| 525 | OPENSSL_PKG_CONFIG = true |
| 526 | PC_REQUIRES_SECURE = openssl |
| 527 | CPPFLAGS := $(shell $(PKG_CONFIG) --cflags openssl) $(CPPFLAGS) |
| 528 | LDFLAGS_OPENSSL_PKG_CONFIG = $(shell $(PKG_CONFIG) --libs-only-L openssl) |
| 529 | ifeq ($(SYSTEM),Linux) |
| 530 | ifneq ($(LDFLAGS_OPENSSL_PKG_CONFIG),) |
| 531 | LDFLAGS_OPENSSL_PKG_CONFIG += $(shell $(PKG_CONFIG) --libs-only-L openssl | sed s/L/Wl,-rpath,/) |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 532 | endif # LDFLAGS_OPENSSL_PKG_CONFIG='' |
| 533 | endif # System=Linux |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 534 | LDFLAGS := $(LDFLAGS_OPENSSL_PKG_CONFIG) $(LDFLAGS) |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 535 | else # HAS_PKG_CONFIG=false |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 536 | LIBS_SECURE = $(OPENSSL_LIBS) |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 537 | endif # HAS_PKG_CONFIG |
| 538 | ifeq ($(HAS_SYSTEM_OPENSSL_NPN),true) |
| 539 | CPPFLAGS += -DTSI_OPENSSL_ALPN_SUPPORT=0 |
| 540 | LIBS_SECURE = $(OPENSSL_LIBS) |
| 541 | endif # HAS_SYSTEM_OPENSSL_NPN |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 542 | PC_LIBS_SECURE = $(addprefix -l, $(LIBS_SECURE)) |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 543 | endif # EMBED_OPENSSL |
| 544 | endif # NO_SECURE |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 545 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 546 | ifeq ($(OPENSSL_PKG_CONFIG),true) |
| 547 | LDLIBS_SECURE += $(shell $(PKG_CONFIG) --libs-only-l openssl) |
| 548 | else |
| 549 | LDLIBS_SECURE += $(addprefix -l, $(LIBS_SECURE)) |
| 550 | endif |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 551 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 552 | # grpc .pc file |
| 553 | PC_NAME = gRPC |
Craig Tiller | da179ce | 2016-02-09 12:01:53 -0800 | [diff] [blame] | 554 | PC_DESCRIPTION = high performance general RPC framework |
| 555 | PC_CFLAGS = |
| 556 | PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC) $(PC_REQUIRES_SECURE) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 557 | PC_LIBS_PRIVATE = $(PC_LIBS_GRPC) $(PC_LIBS_SECURE) |
| 558 | PC_LIB = -lgrpc |
| 559 | GRPC_PC_FILE := $(PC_TEMPLATE) |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 560 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 561 | # gprc_unsecure .pc file |
| 562 | PC_NAME = gRPC unsecure |
Craig Tiller | da179ce | 2016-02-09 12:01:53 -0800 | [diff] [blame] | 563 | PC_DESCRIPTION = high performance general RPC framework without SSL |
| 564 | PC_CFLAGS = |
| 565 | PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 566 | PC_LIBS_PRIVATE = $(PC_LIBS_GRPC) |
| 567 | PC_LIB = -lgrpc |
| 568 | GRPC_UNSECURE_PC_FILE := $(PC_TEMPLATE) |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 569 | |
Craig Tiller | da179ce | 2016-02-09 12:01:53 -0800 | [diff] [blame] | 570 | # gprc_zookeeper .pc file |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 571 | PC_NAME = gRPC zookeeper |
| 572 | PC_DESCRIPTION = gRPC's zookeeper plugin |
| 573 | PC_CFLAGS = |
| 574 | PC_REQUIRES_PRIVATE = |
| 575 | PC_LIBS_PRIVATE = -lzookeeper_mt |
| 576 | GRPC_ZOOKEEPER_PC_FILE := $(PC_TEMPLATE) |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 577 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 578 | PROTOBUF_PKG_CONFIG = false |
murgatroid99 | da7a994 | 2015-06-29 14:57:37 -0700 | [diff] [blame] | 579 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 580 | PC_REQUIRES_GRPCXX = |
| 581 | PC_LIBS_GRPCXX = |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 582 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 583 | CPPFLAGS := -Ithird_party/googletest/include $(CPPFLAGS) |
Craig Tiller | 16f6dac | 2015-08-24 17:00:04 -0700 | [diff] [blame] | 584 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 585 | ifeq ($(HAS_SYSTEM_PROTOBUF),true) |
| 586 | ifeq ($(HAS_PKG_CONFIG),true) |
| 587 | PROTOBUF_PKG_CONFIG = true |
| 588 | PC_REQUIRES_GRPCXX = protobuf |
| 589 | CPPFLAGS := $(shell $(PKG_CONFIG) --cflags protobuf) $(CPPFLAGS) |
| 590 | LDFLAGS_PROTOBUF_PKG_CONFIG = $(shell $(PKG_CONFIG) --libs-only-L protobuf) |
| 591 | ifeq ($(SYSTEM),Linux) |
| 592 | ifneq ($(LDFLAGS_PROTOBUF_PKG_CONFIG),) |
| 593 | LDFLAGS_PROTOBUF_PKG_CONFIG += $(shell $(PKG_CONFIG) --libs-only-L protobuf | sed s/L/Wl,-rpath,/) |
| 594 | endif |
| 595 | endif |
| 596 | else |
| 597 | PC_LIBS_GRPCXX = -lprotobuf |
| 598 | endif |
| 599 | else |
| 600 | ifeq ($(HAS_EMBEDDED_PROTOBUF),true) |
| 601 | PROTOBUF_DEP = $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a |
| 602 | CPPFLAGS := -Ithird_party/protobuf/src $(CPPFLAGS) |
| 603 | LDFLAGS := -L$(LIBDIR)/$(CONFIG)/protobuf $(LDFLAGS) |
| 604 | PROTOC = $(BINDIR)/$(CONFIG)/protobuf/protoc |
| 605 | else |
| 606 | NO_PROTOBUF = true |
| 607 | endif |
| 608 | endif |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 609 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 610 | LIBS_PROTOBUF = protobuf |
| 611 | LIBS_PROTOC = protoc protobuf |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 612 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 613 | HOST_LDLIBS_PROTOC += $(addprefix -l, $(LIBS_PROTOC)) |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 614 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 615 | ifeq ($(PROTOBUF_PKG_CONFIG),true) |
| 616 | LDLIBS_PROTOBUF += $(shell $(PKG_CONFIG) --libs-only-l protobuf) |
| 617 | else |
| 618 | LDLIBS_PROTOBUF += $(addprefix -l, $(LIBS_PROTOBUF)) |
| 619 | endif |
murgatroid99 | 24e2f4a | 2015-06-29 11:12:01 -0700 | [diff] [blame] | 620 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 621 | # grpc++ .pc file |
| 622 | PC_NAME = gRPC++ |
| 623 | PC_DESCRIPTION = C++ wrapper for gRPC |
| 624 | PC_CFLAGS = |
| 625 | PC_REQUIRES_PRIVATE = grpc $(PC_REQUIRES_GRPCXX) |
| 626 | PC_LIBS_PRIVATE = $(PC_LIBS_GRPCXX) |
| 627 | PC_LIB = -lgrpc++ |
| 628 | GRPCXX_PC_FILE := $(PC_TEMPLATE) |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 629 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 630 | # grpc++_unsecure .pc file |
| 631 | PC_NAME = gRPC++ unsecure |
| 632 | PC_DESCRIPTION = C++ wrapper for gRPC without SSL |
| 633 | PC_CFLAGS = |
| 634 | PC_REQUIRES_PRIVATE = grpc_unsecure $(PC_REQUIRES_GRPCXX) |
| 635 | PC_LIBS_PRIVATE = $(PC_LIBS_GRPCXX) |
| 636 | PC_LIB = -lgrpc++ |
| 637 | GRPCXX_UNSECURE_PC_FILE := $(PC_TEMPLATE) |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 638 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 639 | ifeq ($(MAKECMDGOALS),clean) |
| 640 | NO_DEPS = true |
| 641 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 642 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 643 | INSTALL_OK = false |
| 644 | ifeq ($(HAS_VALID_PROTOC),true) |
| 645 | ifeq ($(HAS_SYSTEM_PROTOBUF_VERIFY),true) |
| 646 | INSTALL_OK = true |
| 647 | endif |
| 648 | endif |
Nicolas "Pixel" Noble | 98ab998 | 2015-02-21 04:22:16 +0100 | [diff] [blame] | 649 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 650 | .SECONDARY = %.pb.h %.pb.cc |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 651 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 652 | PROTOC_PLUGINS =\ |
| 653 | % for tgt in targets: |
| 654 | % if tgt.build == 'protoc': |
| 655 | $(BINDIR)/$(CONFIG)/${tgt.name}\ |
| 656 | % endif |
| 657 | % endfor |
Craig Tiller | f58b9ef | 2015-01-15 09:09:12 -0800 | [diff] [blame] | 658 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 659 | ifeq ($(DEP_MISSING),) |
| 660 | all: static shared plugins\ |
| 661 | % for tgt in targets: |
| 662 | % if tgt.build == 'all': |
| 663 | $(BINDIR)/$(CONFIG)/${tgt.name}\ |
| 664 | % endif |
| 665 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 666 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 667 | dep_error: |
| 668 | @echo "You shouldn't see this message - all of your dependencies are correct." |
| 669 | else |
| 670 | all: dep_error git_update stop |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 671 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 672 | dep_error: |
| 673 | @echo |
| 674 | @echo "DEPENDENCY ERROR" |
| 675 | @echo |
| 676 | @echo "You are missing system dependencies that are essential to build grpc," |
| 677 | @echo "and the third_party directory doesn't have them:" |
| 678 | @echo |
| 679 | @echo " $(DEP_MISSING)" |
| 680 | @echo |
| 681 | @echo "Installing the development packages for your system will solve" |
| 682 | @echo "this issue. Please consult INSTALL to get more information." |
| 683 | @echo |
| 684 | @echo "If you need information about why these tests failed, run:" |
| 685 | @echo |
| 686 | @echo " make run_dep_checks" |
| 687 | @echo |
| 688 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 689 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 690 | git_update: |
| 691 | ifeq ($(IS_GIT_FOLDER),true) |
| 692 | @echo "Additionally, since you are in a git clone, you can download the" |
| 693 | @echo "missing dependencies in third_party by running the following command:" |
| 694 | @echo |
| 695 | @echo " git submodule update --init" |
| 696 | @echo |
| 697 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 698 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 699 | openssl_dep_error: openssl_dep_message git_update stop |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 700 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 701 | protobuf_dep_error: protobuf_dep_message git_update stop |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 702 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 703 | protoc_dep_error: protoc_dep_message git_update stop |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 704 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 705 | openssl_dep_message: |
| 706 | @echo |
| 707 | @echo "DEPENDENCY ERROR" |
| 708 | @echo |
| 709 | @echo "The target you are trying to run requires OpenSSL." |
| 710 | @echo "Your system doesn't have it, and neither does the third_party directory." |
| 711 | @echo |
| 712 | @echo "Please consult INSTALL to get more information." |
| 713 | @echo |
| 714 | @echo "If you need information about why these tests failed, run:" |
| 715 | @echo |
| 716 | @echo " make run_dep_checks" |
| 717 | @echo |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 718 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 719 | protobuf_dep_message: |
| 720 | @echo |
| 721 | @echo "DEPENDENCY ERROR" |
| 722 | @echo |
| 723 | @echo "The target you are trying to run requires protobuf 3.0.0+" |
| 724 | @echo "Your system doesn't have it, and neither does the third_party directory." |
| 725 | @echo |
| 726 | @echo "Please consult INSTALL to get more information." |
| 727 | @echo |
| 728 | @echo "If you need information about why these tests failed, run:" |
| 729 | @echo |
| 730 | @echo " make run_dep_checks" |
| 731 | @echo |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 732 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 733 | protoc_dep_message: |
| 734 | @echo |
| 735 | @echo "DEPENDENCY ERROR" |
| 736 | @echo |
| 737 | @echo "The target you are trying to run requires protobuf-compiler 3.0.0+" |
| 738 | @echo "Your system doesn't have it, and neither does the third_party directory." |
| 739 | @echo |
| 740 | @echo "Please consult INSTALL to get more information." |
| 741 | @echo |
| 742 | @echo "If you need information about why these tests failed, run:" |
| 743 | @echo |
| 744 | @echo " make run_dep_checks" |
| 745 | @echo |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 746 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 747 | systemtap_dep_error: |
| 748 | @echo |
| 749 | @echo "DEPENDENCY ERROR" |
| 750 | @echo |
| 751 | @echo "Under the '$(CONFIG)' configutation, the target you are trying " |
| 752 | @echo "to build requires systemtap 2.7+ (on Linux) or dtrace (on other " |
| 753 | @echo "platforms such as Solaris and *BSD). " |
| 754 | @echo |
| 755 | @echo "Please consult INSTALL to get more information." |
| 756 | @echo |
David Garcia Quintas | 8954e90 | 2015-04-29 09:46:33 -0700 | [diff] [blame] | 757 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 758 | stop: |
| 759 | @false |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 760 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 761 | % for tgt in targets: |
| 762 | ${tgt.name}: $(BINDIR)/$(CONFIG)/${tgt.name} |
| 763 | % endfor |
ctiller | 09cb6d5 | 2014-12-19 17:38:22 -0800 | [diff] [blame] | 764 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 765 | run_dep_checks: |
| 766 | $(OPENSSL_ALPN_CHECK_CMD) || true |
| 767 | $(OPENSSL_NPN_CHECK_CMD) || true |
| 768 | $(ZLIB_CHECK_CMD) || true |
| 769 | $(PERFTOOLS_CHECK_CMD) || true |
| 770 | $(PROTOBUF_CHECK_CMD) || true |
| 771 | $(PROTOC_CHECK_VERSION_CMD) || true |
| 772 | $(ZOOKEEPER_CHECK_CMD) || true |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 773 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 774 | third_party/protobuf/configure: |
| 775 | $(E) "[AUTOGEN] Preparing protobuf" |
| 776 | $(Q)(cd third_party/protobuf ; autoreconf -f -i -Wall,no-obsolete) |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 777 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 778 | $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure |
| 779 | $(E) "[MAKE] Building protobuf" |
| 780 | $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g $(PROTOBUF_LDFLAGS_EXTRA)" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g $(PROTOBUF_CPPFLAGS_EXTRA)" ./configure --disable-shared --enable-static) |
| 781 | $(Q)$(MAKE) -C third_party/protobuf clean |
| 782 | $(Q)$(MAKE) -C third_party/protobuf |
| 783 | $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/protobuf |
| 784 | $(Q)mkdir -p $(BINDIR)/$(CONFIG)/protobuf |
| 785 | $(Q)cp third_party/protobuf/src/.libs/libprotoc.a $(LIBDIR)/$(CONFIG)/protobuf |
| 786 | $(Q)cp third_party/protobuf/src/.libs/libprotobuf.a $(LIBDIR)/$(CONFIG)/protobuf |
| 787 | $(Q)cp third_party/protobuf/src/protoc $(BINDIR)/$(CONFIG)/protobuf |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 788 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 789 | static: static_c static_cxx |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 790 | |
Nicolas "Pixel" Noble | 0912179 | 2016-01-30 09:01:53 +0100 | [diff] [blame] | 791 | static_c: pc_c pc_c_unsecure cache.mk pc_c_zookeeper\ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 792 | % for lib in libs: |
| 793 | % if lib.build == 'all' and lib.language == 'c' and not lib.get('external_deps', None): |
| 794 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ |
| 795 | % endif |
| 796 | % endfor |
| 797 | static_zookeeper_libs |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 798 | |
| 799 | |
Nicolas "Pixel" Noble | 0912179 | 2016-01-30 09:01:53 +0100 | [diff] [blame] | 800 | static_cxx: pc_cxx pc_cxx_unsecure cache.mk \ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 801 | % for lib in libs: |
| 802 | % if lib.build == 'all' and lib.language == 'c++': |
| 803 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ |
| 804 | % endif |
| 805 | % endfor |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 806 | |
| 807 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 808 | shared: shared_c shared_cxx |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 809 | |
Nicolas "Pixel" Noble | 0912179 | 2016-01-30 09:01:53 +0100 | [diff] [blame] | 810 | shared_c: pc_c pc_c_unsecure cache.mk pc_c_zookeeper\ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 811 | % for lib in libs: |
| 812 | % if lib.build == 'all' and lib.language == 'c' and not lib.get('external_deps', None): |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 813 | $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 814 | % endif |
| 815 | % endfor |
| 816 | shared_zookeeper_libs |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 817 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 818 | shared_cxx: pc_cxx pc_cxx_unsecure cache.mk\ |
| 819 | % for lib in libs: |
| 820 | % if lib.build == 'all' and lib.language == 'c++': |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 821 | $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 822 | % endif |
| 823 | % endfor |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 824 | |
| 825 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 826 | shared_csharp: shared_c \ |
| 827 | % for lib in libs: |
| 828 | % if lib.build == 'all' and lib.language == 'csharp': |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 829 | $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 830 | % endif |
| 831 | % endfor |
Jan Tattermusch | 2ec0b3e | 2015-02-18 15:03:12 -0800 | [diff] [blame] | 832 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 833 | ifeq ($(HAS_ZOOKEEPER),true) |
| 834 | static_zookeeper_libs:\ |
| 835 | % for lib in libs: |
| 836 | % if lib.build == 'all' and lib.language == 'c' and 'zookeeper' in lib.get('external_deps', []): |
| 837 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ |
| 838 | % endif |
| 839 | % endfor |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 840 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 841 | shared_zookeeper_libs:\ |
| 842 | % for lib in libs: |
| 843 | % if lib.build == 'all' and lib.language == 'c' and 'zookeeper' in lib.get('external_deps', []): |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 844 | $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 845 | % endif |
| 846 | % endfor |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 847 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 848 | else |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 849 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 850 | static_zookeeper_libs: |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 851 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 852 | shared_zookeeper_libs: |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 853 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 854 | endif |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 855 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 856 | grpc_csharp_ext: shared_csharp |
Jan Tattermusch | 2ec0b3e | 2015-02-18 15:03:12 -0800 | [diff] [blame] | 857 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 858 | plugins: $(PROTOC_PLUGINS) |
Nicolas "Pixel" Noble | 522d712 | 2015-02-19 01:28:02 +0100 | [diff] [blame] | 859 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 860 | privatelibs: privatelibs_c privatelibs_cxx |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 861 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 862 | privatelibs_c: \ |
| 863 | % for lib in libs: |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 864 | % if lib.build == 'private' and lib.language == 'c' and not lib.get('external_deps', None) and not lib.boringssl: |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 865 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ |
| 866 | % endif |
| 867 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 868 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 869 | pc_c: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 870 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 871 | pc_c_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 872 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 873 | ifeq ($(HAS_ZOOKEEPER),true) |
| 874 | pc_c_zookeeper: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_zookeeper.pc |
| 875 | else |
| 876 | pc_c_zookeeper: |
| 877 | endif |
Hongwei Wang | a3780a8 | 2015-07-17 15:27:18 -0700 | [diff] [blame] | 878 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 879 | pc_cxx: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 880 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 881 | pc_cxx_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 882 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 883 | privatelibs_cxx: \ |
| 884 | % for lib in libs: |
| 885 | % if lib.build == 'private' and lib.language == 'c++' and not lib.get('external_deps', None): |
| 886 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ |
| 887 | % endif |
| 888 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 889 | |
| 890 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 891 | ifeq ($(HAS_ZOOKEEPER),true) |
| 892 | privatelibs_zookeeper: \ |
| 893 | % for lib in libs: |
| 894 | % if lib.build == 'private' and lib.language == 'c++' and zookeeper in lib.get('external_deps', []): |
| 895 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ |
| 896 | % endif |
| 897 | % endfor |
Hongwei Wang | 8e04d41 | 2015-07-31 15:12:51 -0700 | [diff] [blame] | 898 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 899 | else |
| 900 | privatelibs_zookeeper: |
| 901 | endif |
Hongwei Wang | 8e04d41 | 2015-07-31 15:12:51 -0700 | [diff] [blame] | 902 | |
| 903 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 904 | buildtests: buildtests_c buildtests_cxx buildtests_zookeeper |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 905 | |
Craig Tiller | 3824b6e | 2015-12-09 11:19:59 -0800 | [diff] [blame] | 906 | buildtests_c: privatelibs_c <%text>\</%text> |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 907 | % for tgt in targets: |
| 908 | % if tgt.build == 'test' and not tgt.language == 'c++' and not tgt.get('external_deps', None): |
Craig Tiller | 3824b6e | 2015-12-09 11:19:59 -0800 | [diff] [blame] | 909 | $(BINDIR)/$(CONFIG)/${tgt.name} <%text>\</%text> |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 910 | % endif |
| 911 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 912 | |
| 913 | |
Craig Tiller | 3824b6e | 2015-12-09 11:19:59 -0800 | [diff] [blame] | 914 | buildtests_cxx: buildtests_zookeeper privatelibs_cxx <%text>\</%text> |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 915 | % for tgt in targets: |
| 916 | % if tgt.build == 'test' and tgt.language == 'c++' and not tgt.get('external_deps', None): |
Craig Tiller | 3824b6e | 2015-12-09 11:19:59 -0800 | [diff] [blame] | 917 | $(BINDIR)/$(CONFIG)/${tgt.name} <%text>\</%text> |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 918 | % endif |
| 919 | % endfor |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 920 | |
| 921 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 922 | ifeq ($(HAS_ZOOKEEPER),true) |
Craig Tiller | 3824b6e | 2015-12-09 11:19:59 -0800 | [diff] [blame] | 923 | buildtests_zookeeper: privatelibs_zookeeper <%text>\</%text> |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 924 | % for tgt in targets: |
| 925 | % if tgt.build == 'test' and tgt.language == 'c++' and 'zookeeper' in tgt.get('external_deps', []): |
Craig Tiller | 3824b6e | 2015-12-09 11:19:59 -0800 | [diff] [blame] | 926 | $(BINDIR)/$(CONFIG)/${tgt.name} <%text>\</%text> |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 927 | % endif |
| 928 | % endfor |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 929 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 930 | else |
| 931 | buildtests_zookeeper: |
| 932 | endif |
Hongwei Wang | 8e04d41 | 2015-07-31 15:12:51 -0700 | [diff] [blame] | 933 | |
| 934 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 935 | test: test_c test_cxx test_zookeeper |
Hongwei Wang | 8e04d41 | 2015-07-31 15:12:51 -0700 | [diff] [blame] | 936 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 937 | flaky_test: flaky_test_c flaky_test_cxx flaky_test_zookeeper |
Nicolas "Pixel" Noble | 4251d56 | 2015-05-22 19:43:39 +0200 | [diff] [blame] | 938 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 939 | test_c: buildtests_c |
| 940 | % for tgt in targets: |
| 941 | % if tgt.build == 'test' and tgt.get('run', True) and not tgt.language == 'c++' and not tgt.get('flaky', False) and not tgt.get('external_deps', None): |
| 942 | $(E) "[RUN] Testing ${tgt.name}" |
| 943 | $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) |
| 944 | % endif |
| 945 | % endfor |
Nicolas "Pixel" Noble | 4251d56 | 2015-05-22 19:43:39 +0200 | [diff] [blame] | 946 | |
| 947 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 948 | flaky_test_c: buildtests_c |
| 949 | % for tgt in targets: |
| 950 | % if tgt.build == 'test' and tgt.get('run', True) and not tgt.language == 'c++' and tgt.get('flaky', False) and not tgt.get('external_deps', None): |
| 951 | $(E) "[RUN] Testing ${tgt.name}" |
| 952 | $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) |
| 953 | % endif |
| 954 | % endfor |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 955 | |
| 956 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 957 | test_cxx: test_zookeeper buildtests_cxx |
| 958 | % for tgt in targets: |
| 959 | % if tgt.build == 'test' and tgt.get('run', True) and tgt.language == 'c++' and not tgt.get('flaky', False) and not tgt.get('external_deps', None): |
| 960 | $(E) "[RUN] Testing ${tgt.name}" |
| 961 | $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) |
| 962 | % endif |
| 963 | % endfor |
Nicolas "Pixel" Noble | 4251d56 | 2015-05-22 19:43:39 +0200 | [diff] [blame] | 964 | |
| 965 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 966 | flaky_test_cxx: buildtests_cxx |
| 967 | % for tgt in targets: |
| 968 | % if tgt.build == 'test' and tgt.get('run', True) and tgt.language == 'c++' and tgt.get('flaky', False) and not tgt.get('external_deps', None): |
| 969 | $(E) "[RUN] Testing ${tgt.name}" |
| 970 | $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) |
| 971 | % endif |
| 972 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 973 | |
| 974 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 975 | ifeq ($(HAS_ZOOKEEPER),true) |
| 976 | test_zookeeper: buildtests_zookeeper |
| 977 | % for tgt in targets: |
| 978 | % if tgt.build == 'test' and tgt.get('run', True) and tgt.language == 'c++' and not tgt.get('flaky', False) and 'zookeeper' in tgt.get('external_deps', []): |
| 979 | $(E) "[RUN] Testing ${tgt.name}" |
| 980 | $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) |
| 981 | % endif |
| 982 | % endfor |
Hongwei Wang | 8e04d41 | 2015-07-31 15:12:51 -0700 | [diff] [blame] | 983 | |
| 984 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 985 | flaky_test_zookeeper: buildtests_zookeeper |
| 986 | % for tgt in targets: |
| 987 | % if tgt.build == 'test' and tgt.get('run', True) and tgt.language == 'c++' and tgt.get('flaky', False) and 'zookeeper' in tgt.get('external_deps', []): |
| 988 | $(E) "[RUN] Testing ${tgt.name}" |
| 989 | $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) |
| 990 | % endif |
| 991 | % endfor |
Hongwei Wang | 8e04d41 | 2015-07-31 15:12:51 -0700 | [diff] [blame] | 992 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 993 | else |
| 994 | test_zookeeper: |
| 995 | flaky_test_zookeeper: |
| 996 | endif |
Hongwei Wang | 8e04d41 | 2015-07-31 15:12:51 -0700 | [diff] [blame] | 997 | |
| 998 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 999 | test_python: static_c |
| 1000 | $(E) "[RUN] Testing python code" |
| 1001 | $(Q) tools/run_tests/run_tests.py -lpython -c$(CONFIG) |
Nicolas "Pixel" Noble | 051a28f | 2015-03-17 22:54:54 +0100 | [diff] [blame] | 1002 | |
| 1003 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1004 | tools: tools_c tools_cxx |
Craig Tiller | 7552f0f | 2015-06-19 17:46:20 -0700 | [diff] [blame] | 1005 | |
| 1006 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1007 | tools_c: privatelibs_c\ |
| 1008 | % for tgt in targets: |
| 1009 | % if tgt.build == 'tool' and not tgt.language=='c++': |
| 1010 | $(BINDIR)/$(CONFIG)/${tgt.name}\ |
| 1011 | % endif |
| 1012 | % endfor |
Craig Tiller | 7552f0f | 2015-06-19 17:46:20 -0700 | [diff] [blame] | 1013 | |
| 1014 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1015 | tools_cxx: privatelibs_cxx\ |
| 1016 | % for tgt in targets: |
| 1017 | % if tgt.build == 'tool' and tgt.language=='c++': |
| 1018 | $(BINDIR)/$(CONFIG)/${tgt.name}\ |
| 1019 | % endif |
| 1020 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1021 | |
| 1022 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1023 | buildbenchmarks: privatelibs\ |
| 1024 | % for tgt in targets: |
| 1025 | % if tgt.build == 'benchmark': |
| 1026 | $(BINDIR)/$(CONFIG)/${tgt.name}\ |
| 1027 | % endif |
| 1028 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1029 | |
| 1030 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1031 | benchmarks: buildbenchmarks |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1032 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1033 | strip: strip-static strip-shared |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1034 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1035 | strip-static: strip-static_c strip-static_cxx |
nnoble | 20e2e3f | 2014-12-16 15:37:57 -0800 | [diff] [blame] | 1036 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1037 | strip-shared: strip-shared_c strip-shared_cxx |
nnoble | 20e2e3f | 2014-12-16 15:37:57 -0800 | [diff] [blame] | 1038 | |
Nicolas Noble | 047b727 | 2015-01-16 13:55:05 -0800 | [diff] [blame] | 1039 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1040 | # TODO(nnoble): the strip target is stripping in-place, instead |
| 1041 | # of copying files in a temporary folder. |
| 1042 | # This prevents proper debugging after running make install. |
Nicolas Noble | 047b727 | 2015-01-16 13:55:05 -0800 | [diff] [blame] | 1043 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1044 | strip-static_c: static_c |
| 1045 | ifeq ($(CONFIG),opt) |
| 1046 | % for lib in libs: |
| 1047 | % if lib.language == "c": |
| 1048 | % if lib.build == "all": |
| 1049 | % if not lib.get('external_deps', None): |
| 1050 | $(E) "[STRIP] Stripping lib${lib.name}.a" |
| 1051 | $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a |
| 1052 | % endif |
| 1053 | % endif |
| 1054 | % endif |
| 1055 | % endfor |
| 1056 | ifeq ($(HAS_ZOOKEEPER),true) |
| 1057 | % for lib in libs: |
| 1058 | % if lib.language == "c": |
| 1059 | % if lib.build == "all": |
| 1060 | % if 'zookeeper' in lib.get('external_deps', []): |
| 1061 | $(E) "[STRIP] Stripping lib${lib.name}.a" |
| 1062 | $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a |
| 1063 | % endif |
| 1064 | % endif |
| 1065 | % endif |
| 1066 | % endfor |
| 1067 | endif |
| 1068 | endif |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1069 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1070 | strip-static_cxx: static_cxx |
| 1071 | ifeq ($(CONFIG),opt) |
| 1072 | % for lib in libs: |
| 1073 | % if lib.language == "c++": |
| 1074 | % if lib.build == "all": |
| 1075 | $(E) "[STRIP] Stripping lib${lib.name}.a" |
| 1076 | $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a |
| 1077 | % endif |
| 1078 | % endif |
| 1079 | % endfor |
| 1080 | endif |
Nicolas "Pixel" Noble | 4ef9b86 | 2015-08-14 19:35:24 +0200 | [diff] [blame] | 1081 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1082 | strip-shared_c: shared_c |
| 1083 | ifeq ($(CONFIG),opt) |
| 1084 | % for lib in libs: |
| 1085 | % if lib.language == "c": |
| 1086 | % if lib.build == "all": |
| 1087 | % if not lib.get('external_deps', None): |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1088 | $(E) "[STRIP] Stripping $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" |
| 1089 | $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1090 | % endif |
| 1091 | % endif |
| 1092 | % endif |
| 1093 | % endfor |
| 1094 | ifeq ($(HAS_ZOOKEEPER),true) |
| 1095 | % for lib in libs: |
| 1096 | % if lib.language == "c": |
| 1097 | % if lib.build == "all": |
| 1098 | % if 'zookeeper' in lib.get('external_deps', []): |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1099 | $(E) "[STRIP] Stripping $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" |
| 1100 | $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1101 | % endif |
| 1102 | % endif |
| 1103 | % endif |
| 1104 | % endfor |
| 1105 | endif |
| 1106 | endif |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1107 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1108 | strip-shared_cxx: shared_cxx |
| 1109 | ifeq ($(CONFIG),opt) |
| 1110 | % for lib in libs: |
| 1111 | % if lib.language == "c++": |
| 1112 | % if lib.build == "all": |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1113 | $(E) "[STRIP] Stripping $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" |
| 1114 | $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1115 | % endif |
| 1116 | % endif |
| 1117 | % endfor |
| 1118 | endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1119 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1120 | strip-shared_csharp: shared_csharp |
| 1121 | ifeq ($(CONFIG),opt) |
| 1122 | % for lib in libs: |
| 1123 | % if lib.language == "csharp": |
| 1124 | % if lib.build == "all": |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1125 | $(E) "[STRIP] Stripping $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" |
| 1126 | $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1127 | % endif |
| 1128 | % endif |
| 1129 | % endfor |
| 1130 | endif |
Jan Tattermusch | 2ec0b3e | 2015-02-18 15:03:12 -0800 | [diff] [blame] | 1131 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1132 | cache.mk:: |
| 1133 | $(E) "[MAKE] Generating $@" |
| 1134 | $(Q) echo "$(CACHE_MK)" | tr , '\n' >$@ |
murgatroid99 | aa52157 | 2015-07-10 14:49:12 -0700 | [diff] [blame] | 1135 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1136 | $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc: |
| 1137 | $(E) "[MAKE] Generating $@" |
| 1138 | $(Q) mkdir -p $(@D) |
| 1139 | $(Q) echo "$(GRPC_PC_FILE)" | tr , '\n' >$@ |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 1140 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1141 | $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc: |
| 1142 | $(E) "[MAKE] Generating $@" |
| 1143 | $(Q) mkdir -p $(@D) |
| 1144 | $(Q) echo "$(GRPC_UNSECURE_PC_FILE)" | tr , '\n' >$@ |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 1145 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1146 | $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_zookeeper.pc: |
| 1147 | $(E) "[MAKE] Generating $@" |
| 1148 | $(Q) mkdir -p $(@D) |
| 1149 | $(Q) echo -e "$(GRPC_ZOOKEEPER_PC_FILE)" >$@ |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 1150 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1151 | $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc: |
| 1152 | $(E) "[MAKE] Generating $@" |
| 1153 | $(Q) mkdir -p $(@D) |
| 1154 | $(Q) echo "$(GRPCXX_PC_FILE)" | tr , '\n' >$@ |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 1155 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1156 | $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc: |
| 1157 | $(E) "[MAKE] Generating $@" |
| 1158 | $(Q) mkdir -p $(@D) |
| 1159 | $(Q) echo "$(GRPCXX_UNSECURE_PC_FILE)" | tr , '\n' >$@ |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 1160 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1161 | % for p in protos: |
| 1162 | ifeq ($(NO_PROTOC),true) |
| 1163 | $(GENDIR)/${p}.pb.cc: protoc_dep_error |
| 1164 | $(GENDIR)/${p}.grpc.pb.cc: protoc_dep_error |
| 1165 | else |
Craig Tiller | 1b4e330 | 2015-12-17 16:35:00 -0800 | [diff] [blame] | 1166 | $(GENDIR)/${p}.pb.cc: ${p}.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) ${' '.join('$(GENDIR)/%s.pb.cc' % q for q in proto_deps.get(p, []))} |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1167 | $(E) "[PROTOC] Generating protobuf CC file from $<" |
| 1168 | $(Q) mkdir -p `dirname $@` |
| 1169 | $(Q) $(PROTOC) --cpp_out=$(GENDIR) $< |
Nicolas "Pixel" Noble | 0caebbf | 2015-04-09 23:08:51 +0200 | [diff] [blame] | 1170 | |
Craig Tiller | 1b4e330 | 2015-12-17 16:35:00 -0800 | [diff] [blame] | 1171 | $(GENDIR)/${p}.grpc.pb.cc: ${p}.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) ${' '.join('$(GENDIR)/%s.pb.cc $(GENDIR)/%s.grpc.pb.cc' % (q,q) for q in proto_deps.get(p, []))} |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1172 | $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" |
| 1173 | $(Q) mkdir -p `dirname $@` |
| 1174 | $(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $< |
| 1175 | endif |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 1176 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1177 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1178 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1179 | ifeq ($(CONFIG),stapprof) |
| 1180 | src/core/profiling/stap_timers.c: $(GENDIR)/src/core/profiling/stap_probes.h |
| 1181 | ifeq ($(HAS_SYSTEMTAP),true) |
| 1182 | $(GENDIR)/src/core/profiling/stap_probes.h: src/core/profiling/stap_probes.d |
| 1183 | $(E) "[DTRACE] Compiling $<" |
| 1184 | $(Q) mkdir -p `dirname $@` |
| 1185 | $(Q) $(DTRACE) -C -h -s $< -o $@ |
| 1186 | else |
| 1187 | $(GENDIR)/src/core/profiling/stap_probes.h: systemtap_dep_error stop |
| 1188 | endif |
| 1189 | endif |
David Garcia Quintas | 611b736 | 2015-04-27 15:49:31 -0700 | [diff] [blame] | 1190 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1191 | $(OBJDIR)/$(CONFIG)/%.o : %.c |
| 1192 | $(E) "[C] Compiling $<" |
| 1193 | $(Q) mkdir -p `dirname $@` |
Nicolas "Pixel" Noble | 4500034 | 2016-01-28 05:04:45 +0100 | [diff] [blame] | 1194 | $(Q) $(CC) $(CPPFLAGS) $(CFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1195 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1196 | $(OBJDIR)/$(CONFIG)/%.o : $(GENDIR)/%.pb.cc |
| 1197 | $(E) "[CXX] Compiling $<" |
| 1198 | $(Q) mkdir -p `dirname $@` |
Nicolas "Pixel" Noble | 4500034 | 2016-01-28 05:04:45 +0100 | [diff] [blame] | 1199 | $(Q) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1200 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1201 | $(OBJDIR)/$(CONFIG)/src/compiler/%.o : src/compiler/%.cc |
| 1202 | $(E) "[HOSTCXX] Compiling $<" |
| 1203 | $(Q) mkdir -p `dirname $@` |
| 1204 | $(Q) $(HOST_CXX) $(HOST_CXXFLAGS) $(HOST_CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 1205 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1206 | $(OBJDIR)/$(CONFIG)/%.o : %.cc |
| 1207 | $(E) "[CXX] Compiling $<" |
| 1208 | $(Q) mkdir -p `dirname $@` |
Nicolas "Pixel" Noble | 4500034 | 2016-01-28 05:04:45 +0100 | [diff] [blame] | 1209 | $(Q) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1210 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1211 | install: install_c install_cxx install-plugins install-certs verify-install |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1212 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1213 | install_c: install-headers_c install-static_c install-shared_c |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1214 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1215 | install_cxx: install-headers_cxx install-static_cxx install-shared_cxx |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1216 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1217 | install_csharp: install-shared_csharp install_c |
Jan Tattermusch | 2ec0b3e | 2015-02-18 15:03:12 -0800 | [diff] [blame] | 1218 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1219 | install_grpc_csharp_ext: install_csharp |
Jan Tattermusch | 2ec0b3e | 2015-02-18 15:03:12 -0800 | [diff] [blame] | 1220 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1221 | install-headers: install-headers_c install-headers_cxx |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1222 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1223 | install-headers_c: |
| 1224 | $(E) "[INSTALL] Installing public C headers" |
| 1225 | $(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1 |
| 1226 | $(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1 |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1227 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1228 | install-headers_cxx: |
| 1229 | $(E) "[INSTALL] Installing public C++ headers" |
| 1230 | $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1 |
| 1231 | $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1 |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1232 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1233 | install-static: install-static_c install-static_cxx |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1234 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1235 | install-static_c: static_c strip-static_c install-pkg-config_c |
| 1236 | % for lib in libs: |
| 1237 | % if lib.language == "c": |
| 1238 | % if lib.build == "all": |
| 1239 | % if not lib.get('external_deps', None): |
| 1240 | $(E) "[INSTALL] Installing lib${lib.name}.a" |
| 1241 | $(Q) $(INSTALL) -d $(prefix)/lib |
| 1242 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(prefix)/lib/lib${lib.name}.a |
| 1243 | % endif |
| 1244 | % endif |
| 1245 | % endif |
| 1246 | % endfor |
| 1247 | ifeq ($(HAS_ZOOKEEPER),true) |
| 1248 | % for lib in libs: |
| 1249 | % if lib.language == "c": |
| 1250 | % if lib.build == "all": |
| 1251 | % if 'zookeeper' in lib.get('external_deps', []): |
| 1252 | $(E) "[INSTALL] Installing lib${lib.name}.a" |
| 1253 | $(Q) $(INSTALL) -d $(prefix)/lib |
| 1254 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(prefix)/lib/lib${lib.name}.a |
| 1255 | % endif |
| 1256 | % endif |
| 1257 | % endif |
| 1258 | % endfor |
| 1259 | endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1260 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1261 | install-static_cxx: static_cxx strip-static_cxx install-pkg-config_cxx |
| 1262 | % for lib in libs: |
| 1263 | % if lib.language == "c++": |
| 1264 | % if lib.build == "all": |
| 1265 | $(E) "[INSTALL] Installing lib${lib.name}.a" |
| 1266 | $(Q) $(INSTALL) -d $(prefix)/lib |
| 1267 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(prefix)/lib/lib${lib.name}.a |
| 1268 | % endif |
| 1269 | % endif |
| 1270 | % endfor |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1271 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1272 | <%def name="install_shared(lang_filter)">\ |
| 1273 | % for lib in libs: |
| 1274 | % if lib.language == lang_filter: |
| 1275 | % if lib.build == "all": |
| 1276 | % if not lib.get('external_deps', None): |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1277 | $(E) "[INSTALL] Installing $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" |
| 1278 | $(Q) $(INSTALL) -d $(prefix)/lib |
| 1279 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1280 | ifeq ($(SYSTEM),MINGW32) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1281 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}-imp.a $(prefix)/lib/lib${lib.name}-imp.a |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1282 | else ifneq ($(SYSTEM),Darwin) |
Craig Tiller | f008f06 | 2016-02-08 12:48:03 -0800 | [diff] [blame] | 1283 | $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so.${settings.core_version.major} |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1284 | $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1285 | endif |
| 1286 | % endif |
| 1287 | % endif |
| 1288 | % endif |
| 1289 | % endfor |
| 1290 | ifeq ($(HAS_ZOOKEEPER),true) |
| 1291 | % for lib in libs: |
| 1292 | % if lib.language == lang_filter: |
| 1293 | % if lib.build == "all": |
| 1294 | % if 'zookeeper' in lib.get('external_deps', []): |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1295 | $(E) "[INSTALL] Installing $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" |
| 1296 | $(Q) $(INSTALL) -d $(prefix)/lib |
| 1297 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1298 | ifeq ($(SYSTEM),MINGW32) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1299 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}-imp.a $(prefix)/lib/lib${lib.name}-imp.a |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1300 | else ifneq ($(SYSTEM),Darwin) |
Craig Tiller | f008f06 | 2016-02-08 12:48:03 -0800 | [diff] [blame] | 1301 | $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so.${settings.core_version.major} |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1302 | $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1303 | endif |
| 1304 | % endif |
| 1305 | % endif |
| 1306 | % endif |
| 1307 | % endfor |
| 1308 | endif |
| 1309 | ifneq ($(SYSTEM),MINGW32) |
| 1310 | ifneq ($(SYSTEM),Darwin) |
| 1311 | $(Q) ldconfig || true |
| 1312 | endif |
| 1313 | endif |
| 1314 | </%def> |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1315 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1316 | install-shared_c: shared_c strip-shared_c install-pkg-config_c |
| 1317 | ${install_shared("c")} |
Nicolas "Pixel" Noble | 522d712 | 2015-02-19 01:28:02 +0100 | [diff] [blame] | 1318 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1319 | install-shared_cxx: shared_cxx strip-shared_cxx install-shared_c install-pkg-config_cxx |
| 1320 | ${install_shared("c++")} |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1321 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1322 | install-shared_csharp: shared_csharp strip-shared_csharp |
| 1323 | ${install_shared("csharp")} |
Nicolas "Pixel" Noble | 522d712 | 2015-02-19 01:28:02 +0100 | [diff] [blame] | 1324 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1325 | install-plugins: $(PROTOC_PLUGINS) |
| 1326 | ifeq ($(SYSTEM),MINGW32) |
| 1327 | $(Q) false |
| 1328 | else |
| 1329 | $(E) "[INSTALL] Installing grpc protoc plugins" |
| 1330 | % for tgt in targets: |
| 1331 | % if tgt.build == 'protoc': |
| 1332 | $(Q) $(INSTALL) -d $(prefix)/bin |
| 1333 | $(Q) $(INSTALL) $(BINDIR)/$(CONFIG)/${tgt.name} $(prefix)/bin/${tgt.name} |
| 1334 | % endif |
| 1335 | % endfor |
| 1336 | endif |
Jan Tattermusch | 2ec0b3e | 2015-02-18 15:03:12 -0800 | [diff] [blame] | 1337 | |
yang-g | 2908d63 | 2016-02-04 09:46:51 -0800 | [diff] [blame] | 1338 | install-pkg-config_c: pc_c pc_c_unsecure pc_c_zookeeper |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1339 | $(E) "[INSTALL] Installing C pkg-config files" |
| 1340 | $(Q) $(INSTALL) -d $(prefix)/lib/pkgconfig |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1341 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc $(prefix)/lib/pkgconfig/grpc.pc |
| 1342 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc $(prefix)/lib/pkgconfig/grpc_unsecure.pc |
| 1343 | ifeq ($(HAS_ZOOKEEPER),true) |
| 1344 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_zookeeper.pc $(prefix)/lib/pkgconfig/grpc_zookeeper.pc |
| 1345 | endif |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 1346 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1347 | install-pkg-config_cxx: pc_cxx pc_cxx_unsecure |
| 1348 | $(E) "[INSTALL] Installing C++ pkg-config files" |
| 1349 | $(Q) $(INSTALL) -d $(prefix)/lib/pkgconfig |
| 1350 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc $(prefix)/lib/pkgconfig/grpc++.pc |
| 1351 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc $(prefix)/lib/pkgconfig/grpc++_unsecure.pc |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 1352 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1353 | install-certs: etc/roots.pem |
| 1354 | $(E) "[INSTALL] Installing root certificates" |
| 1355 | $(Q) $(INSTALL) -d $(prefix)/share/grpc |
| 1356 | $(Q) $(INSTALL) etc/roots.pem $(prefix)/share/grpc/roots.pem |
Nicolas "Pixel" Noble | 161ea23 | 2015-02-22 05:48:53 +0100 | [diff] [blame] | 1357 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1358 | verify-install: |
| 1359 | ifeq ($(INSTALL_OK),true) |
| 1360 | @echo "Your system looks ready to go." |
| 1361 | @echo |
| 1362 | else |
| 1363 | @echo "We couldn't find protoc 3.0.0+ installed on your system. While this" |
| 1364 | @echo "won't prevent grpc from working, you won't be able to compile" |
| 1365 | @echo "and run any meaningful code with it." |
| 1366 | @echo |
| 1367 | @echo |
| 1368 | @echo "Please download and install protobuf 3.0.0+ from:" |
| 1369 | @echo |
| 1370 | @echo " https://github.com/google/protobuf/releases" |
| 1371 | @echo |
| 1372 | @echo "Once you've done so, or if you think this message is in error," |
| 1373 | @echo "you can re-run this check by doing:" |
| 1374 | @echo |
| 1375 | @echo " make verify-install" |
| 1376 | endif |
Nicolas "Pixel" Noble | 98ab998 | 2015-02-21 04:22:16 +0100 | [diff] [blame] | 1377 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1378 | clean: |
| 1379 | $(E) "[CLEAN] Cleaning build directories." |
| 1380 | $(Q) $(RM) -rf $(OBJDIR) $(LIBDIR) $(BINDIR) $(GENDIR) cache.mk |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1381 | |
| 1382 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1383 | # The various libraries |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1384 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1385 | % for lib in libs: |
| 1386 | ${makelib(lib)} |
| 1387 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1388 | |
| 1389 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1390 | # All of the test targets, and protoc plugins |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1391 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1392 | % for tgt in targets: |
| 1393 | ${maketarget(tgt)} |
| 1394 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1395 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1396 | <%def name="makelib(lib)"> |
| 1397 | LIB${lib.name.upper()}_SRC = \\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1398 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1399 | % for src in lib.src: |
| 1400 | ${proto_to_cc(src)} \\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1401 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1402 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1403 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1404 | % if "public_headers" in lib: |
| 1405 | % if lib.language == "c++": |
| 1406 | PUBLIC_HEADERS_CXX += \\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1407 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1408 | % else: |
| 1409 | PUBLIC_HEADERS_C += \\ |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1410 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1411 | % endif |
| 1412 | % for hdr in lib.public_headers: |
| 1413 | ${hdr} \\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1414 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1415 | % endfor |
| 1416 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1417 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1418 | LIB${lib.name.upper()}_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIB${lib.name.upper()}_SRC)))) |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1419 | |
Nicolas "Pixel" Noble | 51b1aee | 2016-01-28 01:14:58 +0100 | [diff] [blame] | 1420 | % if lib.get('defaults', None): |
| 1421 | % for name, value in defaults.get(lib.defaults).iteritems(): |
| 1422 | $(LIB${lib.name.upper()}_OBJS): ${name} += ${value} |
| 1423 | % endfor |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 1424 | % endif |
| 1425 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1426 | ## If the library requires OpenSSL, let's add some restrictions. |
| 1427 | % if lib.get('secure', 'check') == True or lib.get('secure', 'check') == 'check': |
| 1428 | ifeq ($(NO_SECURE),true) |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 1429 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1430 | # You can't build secure libraries if you don't have OpenSSL. |
Nicolas Noble | 047b727 | 2015-01-16 13:55:05 -0800 | [diff] [blame] | 1431 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1432 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: openssl_dep_error |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 1433 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1434 | % if lib.build == "all": |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1435 | $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT): openssl_dep_error |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1436 | % endif |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 1437 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1438 | else |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 1439 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1440 | % if lib.language == 'c++': |
| 1441 | ifeq ($(NO_PROTOBUF),true) |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1442 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1443 | # You can't build a C++ library if you don't have protobuf - a bit overreached, but still okay. |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1444 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1445 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: protobuf_dep_error |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1446 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1447 | % if lib.build == "all": |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1448 | $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT): protobuf_dep_error |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1449 | % endif |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1450 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1451 | else |
| 1452 | % endif |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1453 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1454 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: $(ZLIB_DEP) $(OPENSSL_DEP)\ |
| 1455 | ## The else here corresponds to the if secure earlier. |
| 1456 | % else: |
| 1457 | % if lib.language == 'c++': |
| 1458 | ifeq ($(NO_PROTOBUF),true) |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1459 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1460 | # You can't build a C++ library if you don't have protobuf - a bit overreached, but still okay. |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1461 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1462 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: protobuf_dep_error |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1463 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1464 | % if lib.build == "all": |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1465 | $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT): protobuf_dep_error |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1466 | % endif |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1467 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1468 | else |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1469 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1470 | % endif |
Nicolas "Pixel" Noble | d649c21 | 2016-01-27 20:27:30 +0100 | [diff] [blame] | 1471 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: \ |
| 1472 | % if lib.name != 'z': |
| 1473 | $(ZLIB_DEP) \ |
| 1474 | % endif |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1475 | % endif |
| 1476 | % if lib.language == 'c++': |
| 1477 | $(PROTOBUF_DEP)\ |
| 1478 | % endif |
Nicolas "Pixel" Noble | f51a901 | 2016-02-03 07:39:43 +0100 | [diff] [blame] | 1479 | $(LIB${lib.name.upper()}_OBJS) \ |
| 1480 | % if lib.get('baselib', False): |
| 1481 | $(ZLIB_MERGE_OBJS) \ |
| 1482 | % if lib.get('secure', 'check') == True: |
| 1483 | $(OPENSSL_MERGE_OBJS) \ |
| 1484 | % endif |
| 1485 | % endif |
| 1486 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1487 | $(E) "[AR] Creating $@" |
| 1488 | $(Q) mkdir -p `dirname $@` |
| 1489 | $(Q) rm -f $(LIBDIR)/$(CONFIG)/lib${lib.name}.a |
Nicolas "Pixel" Noble | f51a901 | 2016-02-03 07:39:43 +0100 | [diff] [blame] | 1490 | $(Q) $(AR) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(LIB${lib.name.upper()}_OBJS) \ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1491 | % if lib.get('baselib', False): |
Nicolas "Pixel" Noble | f51a901 | 2016-02-03 07:39:43 +0100 | [diff] [blame] | 1492 | $(ZLIB_MERGE_OBJS) \ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1493 | % if lib.get('secure', 'check') == True: |
Nicolas "Pixel" Noble | f51a901 | 2016-02-03 07:39:43 +0100 | [diff] [blame] | 1494 | $(OPENSSL_MERGE_OBJS) \ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1495 | % endif |
| 1496 | % endif |
Nicolas "Pixel" Noble | f51a901 | 2016-02-03 07:39:43 +0100 | [diff] [blame] | 1497 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1498 | ifeq ($(SYSTEM),Darwin) |
| 1499 | $(Q) ranlib $(LIBDIR)/$(CONFIG)/lib${lib.name}.a |
| 1500 | endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1501 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1502 | <% |
Nicolas "Pixel" Noble | 010f1e7 | 2015-04-23 02:23:49 +0200 | [diff] [blame] | 1503 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1504 | if lib.language == 'c++': |
| 1505 | ld = '$(LDXX)' |
| 1506 | else: |
| 1507 | ld = '$(LD)' |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 1508 | |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1509 | out_mingbase = '$(LIBDIR)/$(CONFIG)/' + lib.name + '$(SHARED_VERSION)' |
| 1510 | out_libbase = '$(LIBDIR)/$(CONFIG)/lib' + lib.name + '$(SHARED_VERSION)' |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 1511 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1512 | common = '$(LIB' + lib.name.upper() + '_OBJS) $(LDLIBS)' |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 1513 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1514 | libs = '' |
| 1515 | lib_deps = ' $(ZLIB_DEP)' |
| 1516 | mingw_libs = '' |
| 1517 | mingw_lib_deps = ' $(ZLIB_DEP)' |
| 1518 | if lib.language == 'c++': |
| 1519 | lib_deps += ' $(PROTOBUF_DEP)' |
| 1520 | mingw_lib_deps += ' $(PROTOBUF_DEP)' |
Jan Tattermusch | 324140c | 2016-01-12 08:54:01 -0800 | [diff] [blame] | 1521 | if lib.get('deps_linkage', None) == 'static': |
| 1522 | for dep in lib.get('deps', []): |
| 1523 | lib_archive = '$(LIBDIR)/$(CONFIG)/lib' + dep + '.a' |
| 1524 | common = common + ' ' + lib_archive |
| 1525 | lib_deps = lib_deps + ' ' + lib_archive |
| 1526 | mingw_lib_deps = mingw_lib_deps + ' ' + lib_archive |
| 1527 | else: |
| 1528 | for dep in lib.get('deps', []): |
| 1529 | libs = libs + ' -l' + dep |
| 1530 | lib_deps = lib_deps + ' $(LIBDIR)/$(CONFIG)/lib' + dep + '.$(SHARED_EXT)' |
| 1531 | mingw_libs = mingw_libs + ' -l' + dep + '-imp' |
| 1532 | mingw_lib_deps = mingw_lib_deps + ' $(LIBDIR)/$(CONFIG)/' + dep + '.$(SHARED_EXT)' |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 1533 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1534 | security = lib.get('secure', 'check') |
| 1535 | if security == True: |
| 1536 | common = common + ' $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE)' |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 1537 | common = common + ' $(ZLIB_MERGE_LIBS)' |
Nicolas "Pixel" Noble | a7c162c | 2015-07-24 20:21:51 +0200 | [diff] [blame] | 1538 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1539 | if security in [True, 'check']: |
| 1540 | for src in lib.src: |
| 1541 | if not proto_re.match(src): |
| 1542 | sources_that_need_openssl.add(src) |
| 1543 | else: |
| 1544 | for src in lib.src: |
| 1545 | sources_that_don_t_need_openssl.add(src) |
Nicolas "Pixel" Noble | 061690d | 2015-03-06 22:58:58 +0100 | [diff] [blame] | 1546 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1547 | if 'zookeeper' in lib.get('external_deps', []): |
| 1548 | libs = libs + ' -lzookeeper_mt' |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 1549 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1550 | if lib.get('secure', 'check') == True or lib.get('secure', 'check') == 'check': |
| 1551 | lib_deps = lib_deps + ' $(OPENSSL_DEP)' |
| 1552 | mingw_lib_deps = mingw_lib_deps + ' $(OPENSSL_DEP)' |
Nicolas "Pixel" Noble | dda049c | 2015-02-21 00:39:32 +0100 | [diff] [blame] | 1553 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1554 | if lib.language == 'c++': |
| 1555 | common = common + ' $(LDLIBSXX) $(LDLIBS_PROTOBUF)' |
Craig Tiller | 4bef7ce | 2016-02-02 08:38:43 -0800 | [diff] [blame] | 1556 | |
| 1557 | ldflags = '$(LDFLAGS)' |
| 1558 | if lib.get('LDFLAGS', None): |
| 1559 | ldflags += ' ' + lib['LDFLAGS'] |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1560 | %> |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 1561 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1562 | % if lib.build == "all": |
| 1563 | ifeq ($(SYSTEM),MINGW32) |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1564 | ${out_mingbase}.$(SHARED_EXT): $(LIB${lib.name.upper()}_OBJS) ${mingw_lib_deps} |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1565 | $(E) "[LD] Linking $@" |
| 1566 | $(Q) mkdir -p `dirname $@` |
Nicolas "Pixel" Noble | 89d8ed1 | 2016-02-03 01:12:14 +0100 | [diff] [blame] | 1567 | $(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -shared ${lib.name}.def -Wl,--output-def=${out_mingbase}.def -Wl,--out-implib=${out_libbase}-dll.a -o ${out_mingbase}.$(SHARED_EXT) ${common}${mingw_libs} |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1568 | else |
| 1569 | ${out_libbase}.$(SHARED_EXT): $(LIB${lib.name.upper()}_OBJS) ${lib_deps} |
| 1570 | $(E) "[LD] Linking $@" |
| 1571 | $(Q) mkdir -p `dirname $@` |
| 1572 | ifeq ($(SYSTEM),Darwin) |
Nicolas "Pixel" Noble | 89d8ed1 | 2016-02-03 01:12:14 +0100 | [diff] [blame] | 1573 | $(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) -dynamiclib -o ${out_libbase}.$(SHARED_EXT) ${common}${libs} |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1574 | else |
Craig Tiller | f008f06 | 2016-02-08 12:48:03 -0800 | [diff] [blame] | 1575 | $(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,lib${lib.name}.so.${settings.core_version.major} -o ${out_libbase}.$(SHARED_EXT) ${common}${libs} |
| 1576 | $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) ${out_libbase}.so.${settings.core_version.major} |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1577 | $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) ${out_libbase}.so |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1578 | endif |
| 1579 | endif |
| 1580 | % endif |
| 1581 | % if lib.get('secure', 'check') == True or lib.get('secure', 'check') == 'check': |
| 1582 | ## If the lib was secure, we have to close the Makefile's if that tested |
| 1583 | ## the presence of OpenSSL. |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1584 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1585 | endif |
| 1586 | % endif |
| 1587 | % if lib.language == 'c++': |
| 1588 | ## If the lib was C++, we have to close the Makefile's if that tested |
| 1589 | ## the presence of protobuf 3.0.0+ |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 1590 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1591 | endif |
| 1592 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1593 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1594 | % if lib.get('secure', 'check') == True or lib.get('secure', 'check') == 'check': |
| 1595 | ifneq ($(NO_SECURE),true) |
| 1596 | % endif |
| 1597 | ifneq ($(NO_DEPS),true) |
| 1598 | -include $(LIB${lib.name.upper()}_OBJS:.o=.dep) |
| 1599 | endif |
| 1600 | % if lib.get('secure', 'check') == True or lib.get('secure', 'check') == 'check': |
| 1601 | endif |
| 1602 | % endif |
| 1603 | % for src in lib.src: |
| 1604 | % if not proto_re.match(src) and any(proto_re.match(src2) for src2 in lib.src): |
| 1605 | $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: ${' '.join(proto_to_cc(src2) for src2 in lib.src if proto_re.match(src2))} |
| 1606 | % endif |
| 1607 | % endfor |
| 1608 | </%def> |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1609 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1610 | <%def name="maketarget(tgt)"><% has_no_sources = not tgt.src %> |
| 1611 | % if not has_no_sources: |
| 1612 | ${tgt.name.upper()}_SRC = \\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1613 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1614 | % for src in tgt.src: |
| 1615 | ${proto_to_cc(src)} \\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1616 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1617 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1618 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1619 | ${tgt.name.upper()}_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(${tgt.name.upper()}_SRC)))) |
| 1620 | % endif |
| 1621 | % if tgt.get('secure', 'check') == True or tgt.get('secure', 'check') == 'check': |
| 1622 | ifeq ($(NO_SECURE),true) |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 1623 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1624 | # You can't build secure targets if you don't have OpenSSL. |
Nicolas Noble | 047b727 | 2015-01-16 13:55:05 -0800 | [diff] [blame] | 1625 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1626 | $(BINDIR)/$(CONFIG)/${tgt.name}: openssl_dep_error |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 1627 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1628 | else |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 1629 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1630 | % endif |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 1631 | |
| 1632 | % if tgt.boringssl: |
| 1633 | # boringssl needs an override to ensure that it does not include |
| 1634 | # system openssl headers regardless of other configuration |
| 1635 | # we do so here with a target specific variable assignment |
| 1636 | $(${tgt.name.upper()}_OBJS): CFLAGS := -Ithird_party/boringssl/include $(CFLAGS) -Wno-sign-conversion -Wno-conversion -Wno-unused-value |
| 1637 | $(${tgt.name.upper()}_OBJS): CXXFLAGS := -Ithird_party/boringssl/include $(CXXFLAGS) |
| 1638 | $(${tgt.name.upper()}_OBJS): CPPFLAGS += -DOPENSSL_NO_ASM -D_GNU_SOURCE |
| 1639 | % else: |
| 1640 | % endif |
| 1641 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1642 | ## |
| 1643 | ## We're not trying to add a dependency on building zlib and openssl here, |
| 1644 | ## as it's already done in the libraries. We're assuming that the build |
| 1645 | ## trickles down, and that a secure target requires a secure version of |
| 1646 | ## a library. |
| 1647 | ## |
| 1648 | ## That simplifies the codegen a bit, but prevents a fully defined Makefile. |
| 1649 | ## I can live with that. |
| 1650 | ## |
| 1651 | % if tgt.build == 'protoc' or tgt.language == 'c++': |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1652 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1653 | ifeq ($(NO_PROTOBUF),true) |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1654 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1655 | # You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+. |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1656 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1657 | $(BINDIR)/$(CONFIG)/${tgt.name}: protobuf_dep_error |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1658 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1659 | else |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1660 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1661 | $(BINDIR)/$(CONFIG)/${tgt.name}: \ |
| 1662 | % if not has_no_sources: |
| 1663 | $(PROTOBUF_DEP) $(${tgt.name.upper()}_OBJS)\ |
| 1664 | % endif |
| 1665 | % else: |
| 1666 | $(BINDIR)/$(CONFIG)/${tgt.name}: \ |
| 1667 | % if not has_no_sources: |
| 1668 | $(${tgt.name.upper()}_OBJS)\ |
| 1669 | % endif |
| 1670 | % endif |
| 1671 | % for dep in tgt.deps: |
| 1672 | $(LIBDIR)/$(CONFIG)/lib${dep}.a\ |
| 1673 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1674 | |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 1675 | % if tgt.language == "c++" or tgt.boringssl: |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1676 | ## C++ targets specificies. |
| 1677 | % if tgt.build == 'protoc': |
| 1678 | $(E) "[HOSTLD] Linking $@" |
| 1679 | $(Q) mkdir -p `dirname $@` |
| 1680 | $(Q) $(HOST_LDXX) $(HOST_LDFLAGS) \ |
| 1681 | % if not has_no_sources: |
| 1682 | $(${tgt.name.upper()}_OBJS)\ |
| 1683 | % endif |
| 1684 | % else: |
| 1685 | $(E) "[LD] Linking $@" |
| 1686 | $(Q) mkdir -p `dirname $@` |
| 1687 | $(Q) $(LDXX) $(LDFLAGS) \ |
| 1688 | % if not has_no_sources: |
| 1689 | $(${tgt.name.upper()}_OBJS)\ |
| 1690 | % endif |
| 1691 | % endif |
| 1692 | % else: |
| 1693 | ## C-only targets specificities. |
| 1694 | $(E) "[LD] Linking $@" |
| 1695 | $(Q) mkdir -p `dirname $@` |
| 1696 | $(Q) $(LD) $(LDFLAGS) \ |
| 1697 | % if not has_no_sources: |
| 1698 | $(${tgt.name.upper()}_OBJS)\ |
| 1699 | % endif |
| 1700 | % endif |
| 1701 | % for dep in tgt.deps: |
| 1702 | $(LIBDIR)/$(CONFIG)/lib${dep}.a\ |
| 1703 | % endfor |
| 1704 | % if 'zookeeper' in tgt.get('external_deps', []): |
| 1705 | -lzookeeper_mt\ |
| 1706 | % endif |
| 1707 | % if tgt.language == "c++": |
| 1708 | % if tgt.build == 'protoc': |
| 1709 | $(HOST_LDLIBSXX) $(HOST_LDLIBS_PROTOC)\ |
| 1710 | % else: |
| 1711 | $(LDLIBSXX) $(LDLIBS_PROTOBUF)\ |
| 1712 | % endif |
| 1713 | % endif |
| 1714 | % if tgt.build == 'protoc': |
| 1715 | $(HOST_LDLIBS)\ |
| 1716 | % else: |
| 1717 | $(LDLIBS)\ |
| 1718 | % endif |
| 1719 | % if tgt.build == 'protoc': |
| 1720 | $(HOST_LDLIBS_PROTOC)\ |
| 1721 | % elif tgt.get('secure', 'check') == True or tgt.get('secure', 'check') == 'check': |
| 1722 | $(LDLIBS_SECURE)\ |
| 1723 | % endif |
| 1724 | % if tgt.language == 'c++' and tgt.build == 'test': |
| 1725 | $(GTEST_LIB)\ |
| 1726 | % elif tgt.language == 'c++' and tgt.build == 'benchmark': |
| 1727 | $(GTEST_LIB)\ |
| 1728 | % endif |
| 1729 | -o $(BINDIR)/$(CONFIG)/${tgt.name} |
| 1730 | % if tgt.build == 'protoc' or tgt.language == 'c++': |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1731 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1732 | endif |
| 1733 | % endif |
| 1734 | % if tgt.get('secure', 'check') == True or tgt.get('secure', 'check') == 'check': |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 1735 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1736 | endif |
| 1737 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1738 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1739 | % for src in tgt.src: |
| 1740 | $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: \ |
| 1741 | % for dep in tgt.deps: |
| 1742 | $(LIBDIR)/$(CONFIG)/lib${dep}.a\ |
| 1743 | % endfor |
Craig Tiller | f5371ef | 2015-01-12 16:40:18 -0800 | [diff] [blame] | 1744 | |
Craig Tiller | ab23045 | 2016-01-04 08:18:43 -0800 | [diff] [blame] | 1745 | % if tgt.language == 'c89': |
| 1746 | % for src in tgt.src: |
Craig Tiller | ea21ca2 | 2016-01-04 12:34:29 -0800 | [diff] [blame] | 1747 | $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o : ${src} |
| 1748 | $(E) "[C] Compiling $<" |
| 1749 | $(Q) mkdir -p `dirname $@` |
Nicolas "Pixel" Noble | 4500034 | 2016-01-28 05:04:45 +0100 | [diff] [blame] | 1750 | $(Q) $(CC) $(CPPFLAGS) $(CFLAGS) -std=c89 -pedantic -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< |
Craig Tiller | ab23045 | 2016-01-04 08:18:43 -0800 | [diff] [blame] | 1751 | % endfor |
| 1752 | % endif |
| 1753 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1754 | % endfor |
| 1755 | % if not has_no_sources: |
| 1756 | deps_${tgt.name}: $(${tgt.name.upper()}_OBJS:.o=.dep) |
| 1757 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1758 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1759 | % if not has_no_sources: |
| 1760 | % if tgt.get('secure', 'check') == True or tgt.get('secure', 'check') == 'check': |
| 1761 | ifneq ($(NO_SECURE),true) |
| 1762 | % endif |
| 1763 | ifneq ($(NO_DEPS),true) |
| 1764 | -include $(${tgt.name.upper()}_OBJS:.o=.dep) |
| 1765 | endif |
| 1766 | % if tgt.get('secure', 'check') == True or tgt.get('secure', 'check') == 'check': |
| 1767 | endif |
| 1768 | % endif |
| 1769 | % endif |
Nicolas "Pixel" Noble | 472bb68 | 2015-11-03 19:09:01 +0100 | [diff] [blame] | 1770 | % for src in tgt.src: |
| 1771 | % if not proto_re.match(src) and any(proto_re.match(src2) for src2 in tgt.src): |
| 1772 | $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: ${' '.join(proto_to_cc(src2) for src2 in tgt.src if proto_re.match(src2))} |
| 1773 | % endif |
| 1774 | % endfor |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1775 | </%def> |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1776 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1777 | ifneq ($(OPENSSL_DEP),) |
| 1778 | # This is to ensure the embedded OpenSSL is built beforehand, properly |
| 1779 | # installing headers to their final destination on the drive. We need this |
| 1780 | # otherwise parallel compilation will fail if a source is compiled first. |
| 1781 | % for src in sorted(sources_that_need_openssl): |
| 1782 | % if src not in sources_that_don_t_need_openssl: |
| 1783 | ${src}: $(OPENSSL_DEP) |
| 1784 | % endif |
| 1785 | % endfor |
| 1786 | endif |
Nicolas "Pixel" Noble | 010f1e7 | 2015-04-23 02:23:49 +0200 | [diff] [blame] | 1787 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1788 | .PHONY: all strip tools \ |
| 1789 | dep_error openssl_dep_error openssl_dep_message git_update stop \ |
| 1790 | buildtests buildtests_c buildtests_cxx \ |
| 1791 | test test_c test_cxx \ |
| 1792 | install install_c install_cxx \ |
| 1793 | install-headers install-headers_c install-headers_cxx \ |
| 1794 | install-shared install-shared_c install-shared_cxx \ |
| 1795 | install-static install-static_c install-static_cxx \ |
| 1796 | strip strip-shared strip-static \ |
| 1797 | strip_c strip-shared_c strip-static_c \ |
| 1798 | strip_cxx strip-shared_cxx strip-static_cxx \ |
| 1799 | dep_c dep_cxx bins_dep_c bins_dep_cxx \ |
| 1800 | clean |