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 |
Nicolas "Pixel" Noble | 0912179 | 2016-01-30 09:01:53 +0100 | [diff] [blame] | 554 | PC_DESCRIPTION = High performance general RPC framework |
| 555 | PC_CFLAGS = -pthread |
| 556 | PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC) $(PC_REQUIRES_SECURE) -lpthread |
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 |
Nicolas "Pixel" Noble | 0912179 | 2016-01-30 09:01:53 +0100 | [diff] [blame] | 559 | ifneq ($(SYSTEM),Darwin) |
| 560 | PC_LIBS_PRIVATE += -lrt |
| 561 | endif |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 562 | GRPC_PC_FILE := $(PC_TEMPLATE) |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 563 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 564 | # gprc_unsecure .pc file |
| 565 | PC_NAME = gRPC unsecure |
Nicolas "Pixel" Noble | 0912179 | 2016-01-30 09:01:53 +0100 | [diff] [blame] | 566 | PC_DESCRIPTION = High performance general RPC framework without SSL |
| 567 | PC_CFLAGS = -pthread |
| 568 | PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC) -lpthread |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 569 | PC_LIBS_PRIVATE = $(PC_LIBS_GRPC) |
| 570 | PC_LIB = -lgrpc |
Nicolas "Pixel" Noble | 0912179 | 2016-01-30 09:01:53 +0100 | [diff] [blame] | 571 | ifneq ($(SYSTEM),Darwin) |
| 572 | PC_LIBS_PRIVATE += -lrt |
| 573 | endif |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 574 | GRPC_UNSECURE_PC_FILE := $(PC_TEMPLATE) |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 575 | |
Nicolas "Pixel" Noble | 0912179 | 2016-01-30 09:01:53 +0100 | [diff] [blame] | 576 | # grpc_zookeeper .pc file |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 577 | PC_NAME = gRPC zookeeper |
| 578 | PC_DESCRIPTION = gRPC's zookeeper plugin |
| 579 | PC_CFLAGS = |
| 580 | PC_REQUIRES_PRIVATE = |
| 581 | PC_LIBS_PRIVATE = -lzookeeper_mt |
| 582 | GRPC_ZOOKEEPER_PC_FILE := $(PC_TEMPLATE) |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 583 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 584 | PROTOBUF_PKG_CONFIG = false |
murgatroid99 | da7a994 | 2015-06-29 14:57:37 -0700 | [diff] [blame] | 585 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 586 | PC_REQUIRES_GRPCXX = |
| 587 | PC_LIBS_GRPCXX = |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 588 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 589 | CPPFLAGS := -Ithird_party/googletest/include $(CPPFLAGS) |
Craig Tiller | 16f6dac | 2015-08-24 17:00:04 -0700 | [diff] [blame] | 590 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 591 | ifeq ($(HAS_SYSTEM_PROTOBUF),true) |
| 592 | ifeq ($(HAS_PKG_CONFIG),true) |
| 593 | PROTOBUF_PKG_CONFIG = true |
| 594 | PC_REQUIRES_GRPCXX = protobuf |
| 595 | CPPFLAGS := $(shell $(PKG_CONFIG) --cflags protobuf) $(CPPFLAGS) |
| 596 | LDFLAGS_PROTOBUF_PKG_CONFIG = $(shell $(PKG_CONFIG) --libs-only-L protobuf) |
| 597 | ifeq ($(SYSTEM),Linux) |
| 598 | ifneq ($(LDFLAGS_PROTOBUF_PKG_CONFIG),) |
| 599 | LDFLAGS_PROTOBUF_PKG_CONFIG += $(shell $(PKG_CONFIG) --libs-only-L protobuf | sed s/L/Wl,-rpath,/) |
| 600 | endif |
| 601 | endif |
| 602 | else |
| 603 | PC_LIBS_GRPCXX = -lprotobuf |
| 604 | endif |
| 605 | else |
| 606 | ifeq ($(HAS_EMBEDDED_PROTOBUF),true) |
| 607 | PROTOBUF_DEP = $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a |
| 608 | CPPFLAGS := -Ithird_party/protobuf/src $(CPPFLAGS) |
| 609 | LDFLAGS := -L$(LIBDIR)/$(CONFIG)/protobuf $(LDFLAGS) |
| 610 | PROTOC = $(BINDIR)/$(CONFIG)/protobuf/protoc |
| 611 | else |
| 612 | NO_PROTOBUF = true |
| 613 | endif |
| 614 | endif |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 615 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 616 | LIBS_PROTOBUF = protobuf |
| 617 | LIBS_PROTOC = protoc protobuf |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 618 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 619 | HOST_LDLIBS_PROTOC += $(addprefix -l, $(LIBS_PROTOC)) |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 620 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 621 | ifeq ($(PROTOBUF_PKG_CONFIG),true) |
| 622 | LDLIBS_PROTOBUF += $(shell $(PKG_CONFIG) --libs-only-l protobuf) |
| 623 | else |
| 624 | LDLIBS_PROTOBUF += $(addprefix -l, $(LIBS_PROTOBUF)) |
| 625 | endif |
murgatroid99 | 24e2f4a | 2015-06-29 11:12:01 -0700 | [diff] [blame] | 626 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 627 | # grpc++ .pc file |
| 628 | PC_NAME = gRPC++ |
| 629 | PC_DESCRIPTION = C++ wrapper for gRPC |
| 630 | PC_CFLAGS = |
| 631 | PC_REQUIRES_PRIVATE = grpc $(PC_REQUIRES_GRPCXX) |
| 632 | PC_LIBS_PRIVATE = $(PC_LIBS_GRPCXX) |
| 633 | PC_LIB = -lgrpc++ |
| 634 | GRPCXX_PC_FILE := $(PC_TEMPLATE) |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 635 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 636 | # grpc++_unsecure .pc file |
| 637 | PC_NAME = gRPC++ unsecure |
| 638 | PC_DESCRIPTION = C++ wrapper for gRPC without SSL |
| 639 | PC_CFLAGS = |
| 640 | PC_REQUIRES_PRIVATE = grpc_unsecure $(PC_REQUIRES_GRPCXX) |
| 641 | PC_LIBS_PRIVATE = $(PC_LIBS_GRPCXX) |
| 642 | PC_LIB = -lgrpc++ |
| 643 | GRPCXX_UNSECURE_PC_FILE := $(PC_TEMPLATE) |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 644 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 645 | ifeq ($(MAKECMDGOALS),clean) |
| 646 | NO_DEPS = true |
| 647 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 648 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 649 | INSTALL_OK = false |
| 650 | ifeq ($(HAS_VALID_PROTOC),true) |
| 651 | ifeq ($(HAS_SYSTEM_PROTOBUF_VERIFY),true) |
| 652 | INSTALL_OK = true |
| 653 | endif |
| 654 | endif |
Nicolas "Pixel" Noble | 98ab998 | 2015-02-21 04:22:16 +0100 | [diff] [blame] | 655 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 656 | .SECONDARY = %.pb.h %.pb.cc |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 657 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 658 | PROTOC_PLUGINS =\ |
| 659 | % for tgt in targets: |
| 660 | % if tgt.build == 'protoc': |
| 661 | $(BINDIR)/$(CONFIG)/${tgt.name}\ |
| 662 | % endif |
| 663 | % endfor |
Craig Tiller | f58b9ef | 2015-01-15 09:09:12 -0800 | [diff] [blame] | 664 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 665 | ifeq ($(DEP_MISSING),) |
| 666 | all: static shared plugins\ |
| 667 | % for tgt in targets: |
| 668 | % if tgt.build == 'all': |
| 669 | $(BINDIR)/$(CONFIG)/${tgt.name}\ |
| 670 | % endif |
| 671 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 672 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 673 | dep_error: |
| 674 | @echo "You shouldn't see this message - all of your dependencies are correct." |
| 675 | else |
| 676 | all: dep_error git_update stop |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 677 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 678 | dep_error: |
| 679 | @echo |
| 680 | @echo "DEPENDENCY ERROR" |
| 681 | @echo |
| 682 | @echo "You are missing system dependencies that are essential to build grpc," |
| 683 | @echo "and the third_party directory doesn't have them:" |
| 684 | @echo |
| 685 | @echo " $(DEP_MISSING)" |
| 686 | @echo |
| 687 | @echo "Installing the development packages for your system will solve" |
| 688 | @echo "this issue. Please consult INSTALL to get more information." |
| 689 | @echo |
| 690 | @echo "If you need information about why these tests failed, run:" |
| 691 | @echo |
| 692 | @echo " make run_dep_checks" |
| 693 | @echo |
| 694 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 695 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 696 | git_update: |
| 697 | ifeq ($(IS_GIT_FOLDER),true) |
| 698 | @echo "Additionally, since you are in a git clone, you can download the" |
| 699 | @echo "missing dependencies in third_party by running the following command:" |
| 700 | @echo |
| 701 | @echo " git submodule update --init" |
| 702 | @echo |
| 703 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 704 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 705 | openssl_dep_error: openssl_dep_message git_update stop |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 706 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 707 | protobuf_dep_error: protobuf_dep_message git_update stop |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 708 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 709 | protoc_dep_error: protoc_dep_message git_update stop |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 710 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 711 | openssl_dep_message: |
| 712 | @echo |
| 713 | @echo "DEPENDENCY ERROR" |
| 714 | @echo |
| 715 | @echo "The target you are trying to run requires OpenSSL." |
| 716 | @echo "Your system doesn't have it, and neither does the third_party directory." |
| 717 | @echo |
| 718 | @echo "Please consult INSTALL to get more information." |
| 719 | @echo |
| 720 | @echo "If you need information about why these tests failed, run:" |
| 721 | @echo |
| 722 | @echo " make run_dep_checks" |
| 723 | @echo |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 724 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 725 | protobuf_dep_message: |
| 726 | @echo |
| 727 | @echo "DEPENDENCY ERROR" |
| 728 | @echo |
| 729 | @echo "The target you are trying to run requires protobuf 3.0.0+" |
| 730 | @echo "Your system doesn't have it, and neither does the third_party directory." |
| 731 | @echo |
| 732 | @echo "Please consult INSTALL to get more information." |
| 733 | @echo |
| 734 | @echo "If you need information about why these tests failed, run:" |
| 735 | @echo |
| 736 | @echo " make run_dep_checks" |
| 737 | @echo |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 738 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 739 | protoc_dep_message: |
| 740 | @echo |
| 741 | @echo "DEPENDENCY ERROR" |
| 742 | @echo |
| 743 | @echo "The target you are trying to run requires protobuf-compiler 3.0.0+" |
| 744 | @echo "Your system doesn't have it, and neither does the third_party directory." |
| 745 | @echo |
| 746 | @echo "Please consult INSTALL to get more information." |
| 747 | @echo |
| 748 | @echo "If you need information about why these tests failed, run:" |
| 749 | @echo |
| 750 | @echo " make run_dep_checks" |
| 751 | @echo |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 752 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 753 | systemtap_dep_error: |
| 754 | @echo |
| 755 | @echo "DEPENDENCY ERROR" |
| 756 | @echo |
| 757 | @echo "Under the '$(CONFIG)' configutation, the target you are trying " |
| 758 | @echo "to build requires systemtap 2.7+ (on Linux) or dtrace (on other " |
| 759 | @echo "platforms such as Solaris and *BSD). " |
| 760 | @echo |
| 761 | @echo "Please consult INSTALL to get more information." |
| 762 | @echo |
David Garcia Quintas | 8954e90 | 2015-04-29 09:46:33 -0700 | [diff] [blame] | 763 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 764 | stop: |
| 765 | @false |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 766 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 767 | % for tgt in targets: |
| 768 | ${tgt.name}: $(BINDIR)/$(CONFIG)/${tgt.name} |
| 769 | % endfor |
ctiller | 09cb6d5 | 2014-12-19 17:38:22 -0800 | [diff] [blame] | 770 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 771 | run_dep_checks: |
| 772 | $(OPENSSL_ALPN_CHECK_CMD) || true |
| 773 | $(OPENSSL_NPN_CHECK_CMD) || true |
| 774 | $(ZLIB_CHECK_CMD) || true |
| 775 | $(PERFTOOLS_CHECK_CMD) || true |
| 776 | $(PROTOBUF_CHECK_CMD) || true |
| 777 | $(PROTOC_CHECK_VERSION_CMD) || true |
| 778 | $(ZOOKEEPER_CHECK_CMD) || true |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 779 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 780 | third_party/protobuf/configure: |
| 781 | $(E) "[AUTOGEN] Preparing protobuf" |
| 782 | $(Q)(cd third_party/protobuf ; autoreconf -f -i -Wall,no-obsolete) |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 783 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 784 | $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure |
| 785 | $(E) "[MAKE] Building protobuf" |
| 786 | $(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) |
| 787 | $(Q)$(MAKE) -C third_party/protobuf clean |
| 788 | $(Q)$(MAKE) -C third_party/protobuf |
| 789 | $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/protobuf |
| 790 | $(Q)mkdir -p $(BINDIR)/$(CONFIG)/protobuf |
| 791 | $(Q)cp third_party/protobuf/src/.libs/libprotoc.a $(LIBDIR)/$(CONFIG)/protobuf |
| 792 | $(Q)cp third_party/protobuf/src/.libs/libprotobuf.a $(LIBDIR)/$(CONFIG)/protobuf |
| 793 | $(Q)cp third_party/protobuf/src/protoc $(BINDIR)/$(CONFIG)/protobuf |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 794 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 795 | static: static_c static_cxx |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 796 | |
Nicolas "Pixel" Noble | 0912179 | 2016-01-30 09:01:53 +0100 | [diff] [blame] | 797 | static_c: pc_c pc_c_unsecure cache.mk pc_c_zookeeper\ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 798 | % for lib in libs: |
| 799 | % if lib.build == 'all' and lib.language == 'c' and not lib.get('external_deps', None): |
| 800 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ |
| 801 | % endif |
| 802 | % endfor |
| 803 | static_zookeeper_libs |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 804 | |
| 805 | |
Nicolas "Pixel" Noble | 0912179 | 2016-01-30 09:01:53 +0100 | [diff] [blame] | 806 | static_cxx: pc_cxx pc_cxx_unsecure cache.mk \ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 807 | % for lib in libs: |
| 808 | % if lib.build == 'all' and lib.language == 'c++': |
| 809 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ |
| 810 | % endif |
| 811 | % endfor |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 812 | |
| 813 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 814 | shared: shared_c shared_cxx |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 815 | |
Nicolas "Pixel" Noble | 0912179 | 2016-01-30 09:01:53 +0100 | [diff] [blame] | 816 | shared_c: pc_c pc_c_unsecure cache.mk pc_c_zookeeper\ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 817 | % for lib in libs: |
| 818 | % 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] | 819 | $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 820 | % endif |
| 821 | % endfor |
| 822 | shared_zookeeper_libs |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 823 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 824 | shared_cxx: pc_cxx pc_cxx_unsecure cache.mk\ |
| 825 | % for lib in libs: |
| 826 | % if lib.build == 'all' and lib.language == 'c++': |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 827 | $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 828 | % endif |
| 829 | % endfor |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 830 | |
| 831 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 832 | shared_csharp: shared_c \ |
| 833 | % for lib in libs: |
| 834 | % if lib.build == 'all' and lib.language == 'csharp': |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 835 | $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 836 | % endif |
| 837 | % endfor |
Jan Tattermusch | 2ec0b3e | 2015-02-18 15:03:12 -0800 | [diff] [blame] | 838 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 839 | ifeq ($(HAS_ZOOKEEPER),true) |
| 840 | static_zookeeper_libs:\ |
| 841 | % for lib in libs: |
| 842 | % if lib.build == 'all' and lib.language == 'c' and 'zookeeper' in lib.get('external_deps', []): |
| 843 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ |
| 844 | % endif |
| 845 | % endfor |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 846 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 847 | shared_zookeeper_libs:\ |
| 848 | % for lib in libs: |
| 849 | % 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] | 850 | $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 851 | % endif |
| 852 | % endfor |
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 | else |
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 | static_zookeeper_libs: |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 857 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 858 | shared_zookeeper_libs: |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 859 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 860 | endif |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 861 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 862 | grpc_csharp_ext: shared_csharp |
Jan Tattermusch | 2ec0b3e | 2015-02-18 15:03:12 -0800 | [diff] [blame] | 863 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 864 | plugins: $(PROTOC_PLUGINS) |
Nicolas "Pixel" Noble | 522d712 | 2015-02-19 01:28:02 +0100 | [diff] [blame] | 865 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 866 | privatelibs: privatelibs_c privatelibs_cxx |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 867 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 868 | privatelibs_c: \ |
| 869 | % for lib in libs: |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 870 | % 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] | 871 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ |
| 872 | % endif |
| 873 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 874 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 875 | pc_c: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 876 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 877 | pc_c_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 878 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 879 | ifeq ($(HAS_ZOOKEEPER),true) |
| 880 | pc_c_zookeeper: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_zookeeper.pc |
| 881 | else |
| 882 | pc_c_zookeeper: |
| 883 | endif |
Hongwei Wang | a3780a8 | 2015-07-17 15:27:18 -0700 | [diff] [blame] | 884 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 885 | pc_cxx: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 886 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 887 | pc_cxx_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 888 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 889 | privatelibs_cxx: \ |
| 890 | % for lib in libs: |
| 891 | % if lib.build == 'private' and lib.language == 'c++' and not lib.get('external_deps', None): |
| 892 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ |
| 893 | % endif |
| 894 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 895 | |
| 896 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 897 | ifeq ($(HAS_ZOOKEEPER),true) |
| 898 | privatelibs_zookeeper: \ |
| 899 | % for lib in libs: |
| 900 | % if lib.build == 'private' and lib.language == 'c++' and zookeeper in lib.get('external_deps', []): |
| 901 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ |
| 902 | % endif |
| 903 | % endfor |
Hongwei Wang | 8e04d41 | 2015-07-31 15:12:51 -0700 | [diff] [blame] | 904 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 905 | else |
| 906 | privatelibs_zookeeper: |
| 907 | endif |
Hongwei Wang | 8e04d41 | 2015-07-31 15:12:51 -0700 | [diff] [blame] | 908 | |
| 909 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 910 | buildtests: buildtests_c buildtests_cxx buildtests_zookeeper |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 911 | |
Craig Tiller | 3824b6e | 2015-12-09 11:19:59 -0800 | [diff] [blame] | 912 | buildtests_c: privatelibs_c <%text>\</%text> |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 913 | % for tgt in targets: |
| 914 | % 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] | 915 | $(BINDIR)/$(CONFIG)/${tgt.name} <%text>\</%text> |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 916 | % endif |
| 917 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 918 | |
| 919 | |
Craig Tiller | 3824b6e | 2015-12-09 11:19:59 -0800 | [diff] [blame] | 920 | buildtests_cxx: buildtests_zookeeper privatelibs_cxx <%text>\</%text> |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 921 | % for tgt in targets: |
| 922 | % 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] | 923 | $(BINDIR)/$(CONFIG)/${tgt.name} <%text>\</%text> |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 924 | % endif |
| 925 | % endfor |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 926 | |
| 927 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 928 | ifeq ($(HAS_ZOOKEEPER),true) |
Craig Tiller | 3824b6e | 2015-12-09 11:19:59 -0800 | [diff] [blame] | 929 | buildtests_zookeeper: privatelibs_zookeeper <%text>\</%text> |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 930 | % for tgt in targets: |
| 931 | % 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] | 932 | $(BINDIR)/$(CONFIG)/${tgt.name} <%text>\</%text> |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 933 | % endif |
| 934 | % endfor |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 935 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 936 | else |
| 937 | buildtests_zookeeper: |
| 938 | endif |
Hongwei Wang | 8e04d41 | 2015-07-31 15:12:51 -0700 | [diff] [blame] | 939 | |
| 940 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 941 | test: test_c test_cxx test_zookeeper |
Hongwei Wang | 8e04d41 | 2015-07-31 15:12:51 -0700 | [diff] [blame] | 942 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 943 | flaky_test: flaky_test_c flaky_test_cxx flaky_test_zookeeper |
Nicolas "Pixel" Noble | 4251d56 | 2015-05-22 19:43:39 +0200 | [diff] [blame] | 944 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 945 | test_c: buildtests_c |
| 946 | % for tgt in targets: |
| 947 | % 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): |
| 948 | $(E) "[RUN] Testing ${tgt.name}" |
| 949 | $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) |
| 950 | % endif |
| 951 | % endfor |
Nicolas "Pixel" Noble | 4251d56 | 2015-05-22 19:43:39 +0200 | [diff] [blame] | 952 | |
| 953 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 954 | flaky_test_c: buildtests_c |
| 955 | % for tgt in targets: |
| 956 | % 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): |
| 957 | $(E) "[RUN] Testing ${tgt.name}" |
| 958 | $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) |
| 959 | % endif |
| 960 | % endfor |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 961 | |
| 962 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 963 | test_cxx: test_zookeeper buildtests_cxx |
| 964 | % for tgt in targets: |
| 965 | % 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): |
| 966 | $(E) "[RUN] Testing ${tgt.name}" |
| 967 | $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) |
| 968 | % endif |
| 969 | % endfor |
Nicolas "Pixel" Noble | 4251d56 | 2015-05-22 19:43:39 +0200 | [diff] [blame] | 970 | |
| 971 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 972 | flaky_test_cxx: buildtests_cxx |
| 973 | % for tgt in targets: |
| 974 | % 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): |
| 975 | $(E) "[RUN] Testing ${tgt.name}" |
| 976 | $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) |
| 977 | % endif |
| 978 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 979 | |
| 980 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 981 | ifeq ($(HAS_ZOOKEEPER),true) |
| 982 | test_zookeeper: buildtests_zookeeper |
| 983 | % for tgt in targets: |
| 984 | % 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', []): |
| 985 | $(E) "[RUN] Testing ${tgt.name}" |
| 986 | $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) |
| 987 | % endif |
| 988 | % endfor |
Hongwei Wang | 8e04d41 | 2015-07-31 15:12:51 -0700 | [diff] [blame] | 989 | |
| 990 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 991 | flaky_test_zookeeper: buildtests_zookeeper |
| 992 | % for tgt in targets: |
| 993 | % 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', []): |
| 994 | $(E) "[RUN] Testing ${tgt.name}" |
| 995 | $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) |
| 996 | % endif |
| 997 | % endfor |
Hongwei Wang | 8e04d41 | 2015-07-31 15:12:51 -0700 | [diff] [blame] | 998 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 999 | else |
| 1000 | test_zookeeper: |
| 1001 | flaky_test_zookeeper: |
| 1002 | endif |
Hongwei Wang | 8e04d41 | 2015-07-31 15:12:51 -0700 | [diff] [blame] | 1003 | |
| 1004 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1005 | test_python: static_c |
| 1006 | $(E) "[RUN] Testing python code" |
| 1007 | $(Q) tools/run_tests/run_tests.py -lpython -c$(CONFIG) |
Nicolas "Pixel" Noble | 051a28f | 2015-03-17 22:54:54 +0100 | [diff] [blame] | 1008 | |
| 1009 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1010 | tools: tools_c tools_cxx |
Craig Tiller | 7552f0f | 2015-06-19 17:46:20 -0700 | [diff] [blame] | 1011 | |
| 1012 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1013 | tools_c: privatelibs_c\ |
| 1014 | % for tgt in targets: |
| 1015 | % if tgt.build == 'tool' and not tgt.language=='c++': |
| 1016 | $(BINDIR)/$(CONFIG)/${tgt.name}\ |
| 1017 | % endif |
| 1018 | % endfor |
Craig Tiller | 7552f0f | 2015-06-19 17:46:20 -0700 | [diff] [blame] | 1019 | |
| 1020 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1021 | tools_cxx: privatelibs_cxx\ |
| 1022 | % for tgt in targets: |
| 1023 | % if tgt.build == 'tool' and tgt.language=='c++': |
| 1024 | $(BINDIR)/$(CONFIG)/${tgt.name}\ |
| 1025 | % endif |
| 1026 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1027 | |
| 1028 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1029 | buildbenchmarks: privatelibs\ |
| 1030 | % for tgt in targets: |
| 1031 | % if tgt.build == 'benchmark': |
| 1032 | $(BINDIR)/$(CONFIG)/${tgt.name}\ |
| 1033 | % endif |
| 1034 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1035 | |
| 1036 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1037 | benchmarks: buildbenchmarks |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1038 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1039 | strip: strip-static strip-shared |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1040 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1041 | strip-static: strip-static_c strip-static_cxx |
nnoble | 20e2e3f | 2014-12-16 15:37:57 -0800 | [diff] [blame] | 1042 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1043 | strip-shared: strip-shared_c strip-shared_cxx |
nnoble | 20e2e3f | 2014-12-16 15:37:57 -0800 | [diff] [blame] | 1044 | |
Nicolas Noble | 047b727 | 2015-01-16 13:55:05 -0800 | [diff] [blame] | 1045 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1046 | # TODO(nnoble): the strip target is stripping in-place, instead |
| 1047 | # of copying files in a temporary folder. |
| 1048 | # This prevents proper debugging after running make install. |
Nicolas Noble | 047b727 | 2015-01-16 13:55:05 -0800 | [diff] [blame] | 1049 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1050 | strip-static_c: static_c |
| 1051 | ifeq ($(CONFIG),opt) |
| 1052 | % for lib in libs: |
| 1053 | % if lib.language == "c": |
| 1054 | % if lib.build == "all": |
| 1055 | % if not lib.get('external_deps', None): |
| 1056 | $(E) "[STRIP] Stripping lib${lib.name}.a" |
| 1057 | $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a |
| 1058 | % endif |
| 1059 | % endif |
| 1060 | % endif |
| 1061 | % endfor |
| 1062 | ifeq ($(HAS_ZOOKEEPER),true) |
| 1063 | % for lib in libs: |
| 1064 | % if lib.language == "c": |
| 1065 | % if lib.build == "all": |
| 1066 | % if 'zookeeper' in lib.get('external_deps', []): |
| 1067 | $(E) "[STRIP] Stripping lib${lib.name}.a" |
| 1068 | $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a |
| 1069 | % endif |
| 1070 | % endif |
| 1071 | % endif |
| 1072 | % endfor |
| 1073 | endif |
| 1074 | endif |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1075 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1076 | strip-static_cxx: static_cxx |
| 1077 | ifeq ($(CONFIG),opt) |
| 1078 | % for lib in libs: |
| 1079 | % if lib.language == "c++": |
| 1080 | % if lib.build == "all": |
| 1081 | $(E) "[STRIP] Stripping lib${lib.name}.a" |
| 1082 | $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a |
| 1083 | % endif |
| 1084 | % endif |
| 1085 | % endfor |
| 1086 | endif |
Nicolas "Pixel" Noble | 4ef9b86 | 2015-08-14 19:35:24 +0200 | [diff] [blame] | 1087 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1088 | strip-shared_c: shared_c |
| 1089 | ifeq ($(CONFIG),opt) |
| 1090 | % for lib in libs: |
| 1091 | % if lib.language == "c": |
| 1092 | % if lib.build == "all": |
| 1093 | % if not lib.get('external_deps', None): |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1094 | $(E) "[STRIP] Stripping $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" |
| 1095 | $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1096 | % endif |
| 1097 | % endif |
| 1098 | % endif |
| 1099 | % endfor |
| 1100 | ifeq ($(HAS_ZOOKEEPER),true) |
| 1101 | % for lib in libs: |
| 1102 | % if lib.language == "c": |
| 1103 | % if lib.build == "all": |
| 1104 | % if 'zookeeper' in lib.get('external_deps', []): |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1105 | $(E) "[STRIP] Stripping $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" |
| 1106 | $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1107 | % endif |
| 1108 | % endif |
| 1109 | % endif |
| 1110 | % endfor |
| 1111 | endif |
| 1112 | endif |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1113 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1114 | strip-shared_cxx: shared_cxx |
| 1115 | ifeq ($(CONFIG),opt) |
| 1116 | % for lib in libs: |
| 1117 | % if lib.language == "c++": |
| 1118 | % if lib.build == "all": |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1119 | $(E) "[STRIP] Stripping $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" |
| 1120 | $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1121 | % endif |
| 1122 | % endif |
| 1123 | % endfor |
| 1124 | endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1125 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1126 | strip-shared_csharp: shared_csharp |
| 1127 | ifeq ($(CONFIG),opt) |
| 1128 | % for lib in libs: |
| 1129 | % if lib.language == "csharp": |
| 1130 | % if lib.build == "all": |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1131 | $(E) "[STRIP] Stripping $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" |
| 1132 | $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1133 | % endif |
| 1134 | % endif |
| 1135 | % endfor |
| 1136 | endif |
Jan Tattermusch | 2ec0b3e | 2015-02-18 15:03:12 -0800 | [diff] [blame] | 1137 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1138 | cache.mk:: |
| 1139 | $(E) "[MAKE] Generating $@" |
| 1140 | $(Q) echo "$(CACHE_MK)" | tr , '\n' >$@ |
murgatroid99 | aa52157 | 2015-07-10 14:49:12 -0700 | [diff] [blame] | 1141 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1142 | $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc: |
| 1143 | $(E) "[MAKE] Generating $@" |
| 1144 | $(Q) mkdir -p $(@D) |
| 1145 | $(Q) echo "$(GRPC_PC_FILE)" | tr , '\n' >$@ |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 1146 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1147 | $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc: |
| 1148 | $(E) "[MAKE] Generating $@" |
| 1149 | $(Q) mkdir -p $(@D) |
| 1150 | $(Q) echo "$(GRPC_UNSECURE_PC_FILE)" | tr , '\n' >$@ |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 1151 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1152 | $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_zookeeper.pc: |
| 1153 | $(E) "[MAKE] Generating $@" |
| 1154 | $(Q) mkdir -p $(@D) |
| 1155 | $(Q) echo -e "$(GRPC_ZOOKEEPER_PC_FILE)" >$@ |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 1156 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1157 | $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc: |
| 1158 | $(E) "[MAKE] Generating $@" |
| 1159 | $(Q) mkdir -p $(@D) |
| 1160 | $(Q) echo "$(GRPCXX_PC_FILE)" | tr , '\n' >$@ |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 1161 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1162 | $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc: |
| 1163 | $(E) "[MAKE] Generating $@" |
| 1164 | $(Q) mkdir -p $(@D) |
| 1165 | $(Q) echo "$(GRPCXX_UNSECURE_PC_FILE)" | tr , '\n' >$@ |
murgatroid99 | 8faab23 | 2015-06-30 17:24:21 -0700 | [diff] [blame] | 1166 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1167 | % for p in protos: |
| 1168 | ifeq ($(NO_PROTOC),true) |
| 1169 | $(GENDIR)/${p}.pb.cc: protoc_dep_error |
| 1170 | $(GENDIR)/${p}.grpc.pb.cc: protoc_dep_error |
| 1171 | else |
Craig Tiller | 1b4e330 | 2015-12-17 16:35:00 -0800 | [diff] [blame] | 1172 | $(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] | 1173 | $(E) "[PROTOC] Generating protobuf CC file from $<" |
| 1174 | $(Q) mkdir -p `dirname $@` |
| 1175 | $(Q) $(PROTOC) --cpp_out=$(GENDIR) $< |
Nicolas "Pixel" Noble | 0caebbf | 2015-04-09 23:08:51 +0200 | [diff] [blame] | 1176 | |
Craig Tiller | 1b4e330 | 2015-12-17 16:35:00 -0800 | [diff] [blame] | 1177 | $(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] | 1178 | $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" |
| 1179 | $(Q) mkdir -p `dirname $@` |
| 1180 | $(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $< |
| 1181 | endif |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 1182 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1183 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1184 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1185 | ifeq ($(CONFIG),stapprof) |
| 1186 | src/core/profiling/stap_timers.c: $(GENDIR)/src/core/profiling/stap_probes.h |
| 1187 | ifeq ($(HAS_SYSTEMTAP),true) |
| 1188 | $(GENDIR)/src/core/profiling/stap_probes.h: src/core/profiling/stap_probes.d |
| 1189 | $(E) "[DTRACE] Compiling $<" |
| 1190 | $(Q) mkdir -p `dirname $@` |
| 1191 | $(Q) $(DTRACE) -C -h -s $< -o $@ |
| 1192 | else |
| 1193 | $(GENDIR)/src/core/profiling/stap_probes.h: systemtap_dep_error stop |
| 1194 | endif |
| 1195 | endif |
David Garcia Quintas | 611b736 | 2015-04-27 15:49:31 -0700 | [diff] [blame] | 1196 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1197 | $(OBJDIR)/$(CONFIG)/%.o : %.c |
| 1198 | $(E) "[C] Compiling $<" |
| 1199 | $(Q) mkdir -p `dirname $@` |
Nicolas "Pixel" Noble | 4500034 | 2016-01-28 05:04:45 +0100 | [diff] [blame] | 1200 | $(Q) $(CC) $(CPPFLAGS) $(CFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1201 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1202 | $(OBJDIR)/$(CONFIG)/%.o : $(GENDIR)/%.pb.cc |
| 1203 | $(E) "[CXX] Compiling $<" |
| 1204 | $(Q) mkdir -p `dirname $@` |
Nicolas "Pixel" Noble | 4500034 | 2016-01-28 05:04:45 +0100 | [diff] [blame] | 1205 | $(Q) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1206 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1207 | $(OBJDIR)/$(CONFIG)/src/compiler/%.o : src/compiler/%.cc |
| 1208 | $(E) "[HOSTCXX] Compiling $<" |
| 1209 | $(Q) mkdir -p `dirname $@` |
| 1210 | $(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] | 1211 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1212 | $(OBJDIR)/$(CONFIG)/%.o : %.cc |
| 1213 | $(E) "[CXX] Compiling $<" |
| 1214 | $(Q) mkdir -p `dirname $@` |
Nicolas "Pixel" Noble | 4500034 | 2016-01-28 05:04:45 +0100 | [diff] [blame] | 1215 | $(Q) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1216 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1217 | install: install_c install_cxx install-plugins install-certs verify-install |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1218 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1219 | install_c: install-headers_c install-static_c install-shared_c |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1220 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1221 | install_cxx: install-headers_cxx install-static_cxx install-shared_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_csharp: install-shared_csharp install_c |
Jan Tattermusch | 2ec0b3e | 2015-02-18 15:03:12 -0800 | [diff] [blame] | 1224 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1225 | install_grpc_csharp_ext: install_csharp |
Jan Tattermusch | 2ec0b3e | 2015-02-18 15:03:12 -0800 | [diff] [blame] | 1226 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1227 | install-headers: install-headers_c install-headers_cxx |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1228 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1229 | install-headers_c: |
| 1230 | $(E) "[INSTALL] Installing public C headers" |
| 1231 | $(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1 |
| 1232 | $(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] | 1233 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1234 | install-headers_cxx: |
| 1235 | $(E) "[INSTALL] Installing public C++ headers" |
| 1236 | $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1 |
| 1237 | $(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] | 1238 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1239 | install-static: install-static_c install-static_cxx |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1240 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1241 | install-static_c: static_c strip-static_c install-pkg-config_c |
| 1242 | % for lib in libs: |
| 1243 | % if lib.language == "c": |
| 1244 | % if lib.build == "all": |
| 1245 | % if not lib.get('external_deps', None): |
| 1246 | $(E) "[INSTALL] Installing lib${lib.name}.a" |
| 1247 | $(Q) $(INSTALL) -d $(prefix)/lib |
| 1248 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(prefix)/lib/lib${lib.name}.a |
| 1249 | % endif |
| 1250 | % endif |
| 1251 | % endif |
| 1252 | % endfor |
| 1253 | ifeq ($(HAS_ZOOKEEPER),true) |
| 1254 | % for lib in libs: |
| 1255 | % if lib.language == "c": |
| 1256 | % if lib.build == "all": |
| 1257 | % if 'zookeeper' in lib.get('external_deps', []): |
| 1258 | $(E) "[INSTALL] Installing lib${lib.name}.a" |
| 1259 | $(Q) $(INSTALL) -d $(prefix)/lib |
| 1260 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(prefix)/lib/lib${lib.name}.a |
| 1261 | % endif |
| 1262 | % endif |
| 1263 | % endif |
| 1264 | % endfor |
| 1265 | endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1266 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1267 | install-static_cxx: static_cxx strip-static_cxx install-pkg-config_cxx |
| 1268 | % for lib in libs: |
| 1269 | % if lib.language == "c++": |
| 1270 | % if lib.build == "all": |
| 1271 | $(E) "[INSTALL] Installing lib${lib.name}.a" |
| 1272 | $(Q) $(INSTALL) -d $(prefix)/lib |
| 1273 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(prefix)/lib/lib${lib.name}.a |
| 1274 | % endif |
| 1275 | % endif |
| 1276 | % endfor |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1277 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1278 | <%def name="install_shared(lang_filter)">\ |
| 1279 | % for lib in libs: |
| 1280 | % if lib.language == lang_filter: |
| 1281 | % if lib.build == "all": |
| 1282 | % if not lib.get('external_deps', None): |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1283 | $(E) "[INSTALL] Installing $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" |
| 1284 | $(Q) $(INSTALL) -d $(prefix)/lib |
| 1285 | $(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] | 1286 | ifeq ($(SYSTEM),MINGW32) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1287 | $(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] | 1288 | else ifneq ($(SYSTEM),Darwin) |
Craig Tiller | f008f06 | 2016-02-08 12:48:03 -0800 | [diff] [blame^] | 1289 | $(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] | 1290 | $(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] | 1291 | endif |
| 1292 | % endif |
| 1293 | % endif |
| 1294 | % endif |
| 1295 | % endfor |
| 1296 | ifeq ($(HAS_ZOOKEEPER),true) |
| 1297 | % for lib in libs: |
| 1298 | % if lib.language == lang_filter: |
| 1299 | % if lib.build == "all": |
| 1300 | % if 'zookeeper' in lib.get('external_deps', []): |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1301 | $(E) "[INSTALL] Installing $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" |
| 1302 | $(Q) $(INSTALL) -d $(prefix)/lib |
| 1303 | $(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] | 1304 | ifeq ($(SYSTEM),MINGW32) |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1305 | $(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] | 1306 | else ifneq ($(SYSTEM),Darwin) |
Craig Tiller | f008f06 | 2016-02-08 12:48:03 -0800 | [diff] [blame^] | 1307 | $(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] | 1308 | $(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] | 1309 | endif |
| 1310 | % endif |
| 1311 | % endif |
| 1312 | % endif |
| 1313 | % endfor |
| 1314 | endif |
| 1315 | ifneq ($(SYSTEM),MINGW32) |
| 1316 | ifneq ($(SYSTEM),Darwin) |
| 1317 | $(Q) ldconfig || true |
| 1318 | endif |
| 1319 | endif |
| 1320 | </%def> |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1321 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1322 | install-shared_c: shared_c strip-shared_c install-pkg-config_c |
| 1323 | ${install_shared("c")} |
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-shared_cxx: shared_cxx strip-shared_cxx install-shared_c install-pkg-config_cxx |
| 1326 | ${install_shared("c++")} |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1327 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1328 | install-shared_csharp: shared_csharp strip-shared_csharp |
| 1329 | ${install_shared("csharp")} |
Nicolas "Pixel" Noble | 522d712 | 2015-02-19 01:28:02 +0100 | [diff] [blame] | 1330 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1331 | install-plugins: $(PROTOC_PLUGINS) |
| 1332 | ifeq ($(SYSTEM),MINGW32) |
| 1333 | $(Q) false |
| 1334 | else |
| 1335 | $(E) "[INSTALL] Installing grpc protoc plugins" |
| 1336 | % for tgt in targets: |
| 1337 | % if tgt.build == 'protoc': |
| 1338 | $(Q) $(INSTALL) -d $(prefix)/bin |
| 1339 | $(Q) $(INSTALL) $(BINDIR)/$(CONFIG)/${tgt.name} $(prefix)/bin/${tgt.name} |
| 1340 | % endif |
| 1341 | % endfor |
| 1342 | endif |
Jan Tattermusch | 2ec0b3e | 2015-02-18 15:03:12 -0800 | [diff] [blame] | 1343 | |
yang-g | 2908d63 | 2016-02-04 09:46:51 -0800 | [diff] [blame] | 1344 | install-pkg-config_c: pc_c pc_c_unsecure pc_c_zookeeper |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1345 | $(E) "[INSTALL] Installing C pkg-config files" |
| 1346 | $(Q) $(INSTALL) -d $(prefix)/lib/pkgconfig |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1347 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc $(prefix)/lib/pkgconfig/grpc.pc |
| 1348 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc $(prefix)/lib/pkgconfig/grpc_unsecure.pc |
| 1349 | ifeq ($(HAS_ZOOKEEPER),true) |
| 1350 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_zookeeper.pc $(prefix)/lib/pkgconfig/grpc_zookeeper.pc |
| 1351 | endif |
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-pkg-config_cxx: pc_cxx pc_cxx_unsecure |
| 1354 | $(E) "[INSTALL] Installing C++ pkg-config files" |
| 1355 | $(Q) $(INSTALL) -d $(prefix)/lib/pkgconfig |
| 1356 | $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc $(prefix)/lib/pkgconfig/grpc++.pc |
| 1357 | $(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] | 1358 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1359 | install-certs: etc/roots.pem |
| 1360 | $(E) "[INSTALL] Installing root certificates" |
| 1361 | $(Q) $(INSTALL) -d $(prefix)/share/grpc |
| 1362 | $(Q) $(INSTALL) etc/roots.pem $(prefix)/share/grpc/roots.pem |
Nicolas "Pixel" Noble | 161ea23 | 2015-02-22 05:48:53 +0100 | [diff] [blame] | 1363 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1364 | verify-install: |
| 1365 | ifeq ($(INSTALL_OK),true) |
| 1366 | @echo "Your system looks ready to go." |
| 1367 | @echo |
| 1368 | else |
| 1369 | @echo "We couldn't find protoc 3.0.0+ installed on your system. While this" |
| 1370 | @echo "won't prevent grpc from working, you won't be able to compile" |
| 1371 | @echo "and run any meaningful code with it." |
| 1372 | @echo |
| 1373 | @echo |
| 1374 | @echo "Please download and install protobuf 3.0.0+ from:" |
| 1375 | @echo |
| 1376 | @echo " https://github.com/google/protobuf/releases" |
| 1377 | @echo |
| 1378 | @echo "Once you've done so, or if you think this message is in error," |
| 1379 | @echo "you can re-run this check by doing:" |
| 1380 | @echo |
| 1381 | @echo " make verify-install" |
| 1382 | endif |
Nicolas "Pixel" Noble | 98ab998 | 2015-02-21 04:22:16 +0100 | [diff] [blame] | 1383 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1384 | clean: |
| 1385 | $(E) "[CLEAN] Cleaning build directories." |
| 1386 | $(Q) $(RM) -rf $(OBJDIR) $(LIBDIR) $(BINDIR) $(GENDIR) cache.mk |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1387 | |
| 1388 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1389 | # The various libraries |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1390 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1391 | % for lib in libs: |
| 1392 | ${makelib(lib)} |
| 1393 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1394 | |
| 1395 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1396 | # All of the test targets, and protoc plugins |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1397 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1398 | % for tgt in targets: |
| 1399 | ${maketarget(tgt)} |
| 1400 | % endfor |
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 | <%def name="makelib(lib)"> |
| 1403 | LIB${lib.name.upper()}_SRC = \\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1404 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1405 | % for src in lib.src: |
| 1406 | ${proto_to_cc(src)} \\ |
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 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1409 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1410 | % if "public_headers" in lib: |
| 1411 | % if lib.language == "c++": |
| 1412 | PUBLIC_HEADERS_CXX += \\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1413 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1414 | % else: |
| 1415 | PUBLIC_HEADERS_C += \\ |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 1416 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1417 | % endif |
| 1418 | % for hdr in lib.public_headers: |
| 1419 | ${hdr} \\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1420 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1421 | % endfor |
| 1422 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1423 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1424 | 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] | 1425 | |
Nicolas "Pixel" Noble | 51b1aee | 2016-01-28 01:14:58 +0100 | [diff] [blame] | 1426 | % if lib.get('defaults', None): |
| 1427 | % for name, value in defaults.get(lib.defaults).iteritems(): |
| 1428 | $(LIB${lib.name.upper()}_OBJS): ${name} += ${value} |
| 1429 | % endfor |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 1430 | % endif |
| 1431 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1432 | ## If the library requires OpenSSL, let's add some restrictions. |
| 1433 | % if lib.get('secure', 'check') == True or lib.get('secure', 'check') == 'check': |
| 1434 | ifeq ($(NO_SECURE),true) |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 1435 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1436 | # You can't build secure libraries if you don't have OpenSSL. |
Nicolas Noble | 047b727 | 2015-01-16 13:55:05 -0800 | [diff] [blame] | 1437 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1438 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: openssl_dep_error |
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.build == "all": |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1441 | $(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] | 1442 | % endif |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 1443 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1444 | else |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 1445 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1446 | % if lib.language == 'c++': |
| 1447 | ifeq ($(NO_PROTOBUF),true) |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1448 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1449 | # 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] | 1450 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1451 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: protobuf_dep_error |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1452 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1453 | % if lib.build == "all": |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1454 | $(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] | 1455 | % endif |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1456 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1457 | else |
| 1458 | % endif |
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 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: $(ZLIB_DEP) $(OPENSSL_DEP)\ |
| 1461 | ## The else here corresponds to the if secure earlier. |
| 1462 | % else: |
| 1463 | % if lib.language == 'c++': |
| 1464 | ifeq ($(NO_PROTOBUF),true) |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1465 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1466 | # 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] | 1467 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1468 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: protobuf_dep_error |
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 | % if lib.build == "all": |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1471 | $(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] | 1472 | % endif |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1473 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1474 | else |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1475 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1476 | % endif |
Nicolas "Pixel" Noble | d649c21 | 2016-01-27 20:27:30 +0100 | [diff] [blame] | 1477 | $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: \ |
| 1478 | % if lib.name != 'z': |
| 1479 | $(ZLIB_DEP) \ |
| 1480 | % endif |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1481 | % endif |
| 1482 | % if lib.language == 'c++': |
| 1483 | $(PROTOBUF_DEP)\ |
| 1484 | % endif |
Nicolas "Pixel" Noble | f51a901 | 2016-02-03 07:39:43 +0100 | [diff] [blame] | 1485 | $(LIB${lib.name.upper()}_OBJS) \ |
| 1486 | % if lib.get('baselib', False): |
| 1487 | $(ZLIB_MERGE_OBJS) \ |
| 1488 | % if lib.get('secure', 'check') == True: |
| 1489 | $(OPENSSL_MERGE_OBJS) \ |
| 1490 | % endif |
| 1491 | % endif |
| 1492 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1493 | $(E) "[AR] Creating $@" |
| 1494 | $(Q) mkdir -p `dirname $@` |
| 1495 | $(Q) rm -f $(LIBDIR)/$(CONFIG)/lib${lib.name}.a |
Nicolas "Pixel" Noble | f51a901 | 2016-02-03 07:39:43 +0100 | [diff] [blame] | 1496 | $(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] | 1497 | % if lib.get('baselib', False): |
Nicolas "Pixel" Noble | f51a901 | 2016-02-03 07:39:43 +0100 | [diff] [blame] | 1498 | $(ZLIB_MERGE_OBJS) \ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1499 | % if lib.get('secure', 'check') == True: |
Nicolas "Pixel" Noble | f51a901 | 2016-02-03 07:39:43 +0100 | [diff] [blame] | 1500 | $(OPENSSL_MERGE_OBJS) \ |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1501 | % endif |
| 1502 | % endif |
Nicolas "Pixel" Noble | f51a901 | 2016-02-03 07:39:43 +0100 | [diff] [blame] | 1503 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1504 | ifeq ($(SYSTEM),Darwin) |
| 1505 | $(Q) ranlib $(LIBDIR)/$(CONFIG)/lib${lib.name}.a |
| 1506 | endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1507 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1508 | <% |
Nicolas "Pixel" Noble | 010f1e7 | 2015-04-23 02:23:49 +0200 | [diff] [blame] | 1509 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1510 | if lib.language == 'c++': |
| 1511 | ld = '$(LDXX)' |
| 1512 | else: |
| 1513 | ld = '$(LD)' |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 1514 | |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1515 | out_mingbase = '$(LIBDIR)/$(CONFIG)/' + lib.name + '$(SHARED_VERSION)' |
| 1516 | out_libbase = '$(LIBDIR)/$(CONFIG)/lib' + lib.name + '$(SHARED_VERSION)' |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 1517 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1518 | common = '$(LIB' + lib.name.upper() + '_OBJS) $(LDLIBS)' |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 1519 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1520 | libs = '' |
| 1521 | lib_deps = ' $(ZLIB_DEP)' |
| 1522 | mingw_libs = '' |
| 1523 | mingw_lib_deps = ' $(ZLIB_DEP)' |
| 1524 | if lib.language == 'c++': |
| 1525 | lib_deps += ' $(PROTOBUF_DEP)' |
| 1526 | mingw_lib_deps += ' $(PROTOBUF_DEP)' |
Jan Tattermusch | 324140c | 2016-01-12 08:54:01 -0800 | [diff] [blame] | 1527 | if lib.get('deps_linkage', None) == 'static': |
| 1528 | for dep in lib.get('deps', []): |
| 1529 | lib_archive = '$(LIBDIR)/$(CONFIG)/lib' + dep + '.a' |
| 1530 | common = common + ' ' + lib_archive |
| 1531 | lib_deps = lib_deps + ' ' + lib_archive |
| 1532 | mingw_lib_deps = mingw_lib_deps + ' ' + lib_archive |
| 1533 | else: |
| 1534 | for dep in lib.get('deps', []): |
| 1535 | libs = libs + ' -l' + dep |
| 1536 | lib_deps = lib_deps + ' $(LIBDIR)/$(CONFIG)/lib' + dep + '.$(SHARED_EXT)' |
| 1537 | mingw_libs = mingw_libs + ' -l' + dep + '-imp' |
| 1538 | mingw_lib_deps = mingw_lib_deps + ' $(LIBDIR)/$(CONFIG)/' + dep + '.$(SHARED_EXT)' |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 1539 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1540 | security = lib.get('secure', 'check') |
| 1541 | if security == True: |
| 1542 | common = common + ' $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE)' |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 1543 | common = common + ' $(ZLIB_MERGE_LIBS)' |
Nicolas "Pixel" Noble | a7c162c | 2015-07-24 20:21:51 +0200 | [diff] [blame] | 1544 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1545 | if security in [True, 'check']: |
| 1546 | for src in lib.src: |
| 1547 | if not proto_re.match(src): |
| 1548 | sources_that_need_openssl.add(src) |
| 1549 | else: |
| 1550 | for src in lib.src: |
| 1551 | sources_that_don_t_need_openssl.add(src) |
Nicolas "Pixel" Noble | 061690d | 2015-03-06 22:58:58 +0100 | [diff] [blame] | 1552 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1553 | if 'zookeeper' in lib.get('external_deps', []): |
| 1554 | libs = libs + ' -lzookeeper_mt' |
Hongwei Wang | a8cc439 | 2015-07-16 17:37:47 -0700 | [diff] [blame] | 1555 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1556 | if lib.get('secure', 'check') == True or lib.get('secure', 'check') == 'check': |
| 1557 | lib_deps = lib_deps + ' $(OPENSSL_DEP)' |
| 1558 | mingw_lib_deps = mingw_lib_deps + ' $(OPENSSL_DEP)' |
Nicolas "Pixel" Noble | dda049c | 2015-02-21 00:39:32 +0100 | [diff] [blame] | 1559 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1560 | if lib.language == 'c++': |
| 1561 | common = common + ' $(LDLIBSXX) $(LDLIBS_PROTOBUF)' |
Craig Tiller | 4bef7ce | 2016-02-02 08:38:43 -0800 | [diff] [blame] | 1562 | |
| 1563 | ldflags = '$(LDFLAGS)' |
| 1564 | if lib.get('LDFLAGS', None): |
| 1565 | ldflags += ' ' + lib['LDFLAGS'] |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1566 | %> |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 1567 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1568 | % if lib.build == "all": |
| 1569 | ifeq ($(SYSTEM),MINGW32) |
Nicolas "Pixel" Noble | c4e57e3 | 2016-01-30 21:05:35 +0100 | [diff] [blame] | 1570 | ${out_mingbase}.$(SHARED_EXT): $(LIB${lib.name.upper()}_OBJS) ${mingw_lib_deps} |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1571 | $(E) "[LD] Linking $@" |
| 1572 | $(Q) mkdir -p `dirname $@` |
Nicolas "Pixel" Noble | 89d8ed1 | 2016-02-03 01:12:14 +0100 | [diff] [blame] | 1573 | $(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] | 1574 | else |
| 1575 | ${out_libbase}.$(SHARED_EXT): $(LIB${lib.name.upper()}_OBJS) ${lib_deps} |
| 1576 | $(E) "[LD] Linking $@" |
| 1577 | $(Q) mkdir -p `dirname $@` |
| 1578 | ifeq ($(SYSTEM),Darwin) |
Nicolas "Pixel" Noble | 89d8ed1 | 2016-02-03 01:12:14 +0100 | [diff] [blame] | 1579 | $(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] | 1580 | else |
Craig Tiller | f008f06 | 2016-02-08 12:48:03 -0800 | [diff] [blame^] | 1581 | $(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,lib${lib.name}.so.${settings.core_version.major} -o ${out_libbase}.$(SHARED_EXT) ${common}${libs} |
| 1582 | $(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] | 1583 | $(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] | 1584 | endif |
| 1585 | endif |
| 1586 | % endif |
| 1587 | % if lib.get('secure', 'check') == True or lib.get('secure', 'check') == 'check': |
| 1588 | ## If the lib was secure, we have to close the Makefile's if that tested |
| 1589 | ## the presence of OpenSSL. |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1590 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1591 | endif |
| 1592 | % endif |
| 1593 | % if lib.language == 'c++': |
| 1594 | ## If the lib was C++, we have to close the Makefile's if that tested |
| 1595 | ## the presence of protobuf 3.0.0+ |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 1596 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1597 | endif |
| 1598 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1599 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1600 | % if lib.get('secure', 'check') == True or lib.get('secure', 'check') == 'check': |
| 1601 | ifneq ($(NO_SECURE),true) |
| 1602 | % endif |
| 1603 | ifneq ($(NO_DEPS),true) |
| 1604 | -include $(LIB${lib.name.upper()}_OBJS:.o=.dep) |
| 1605 | endif |
| 1606 | % if lib.get('secure', 'check') == True or lib.get('secure', 'check') == 'check': |
| 1607 | endif |
| 1608 | % endif |
| 1609 | % for src in lib.src: |
| 1610 | % if not proto_re.match(src) and any(proto_re.match(src2) for src2 in lib.src): |
| 1611 | $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: ${' '.join(proto_to_cc(src2) for src2 in lib.src if proto_re.match(src2))} |
| 1612 | % endif |
| 1613 | % endfor |
| 1614 | </%def> |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1615 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1616 | <%def name="maketarget(tgt)"><% has_no_sources = not tgt.src %> |
| 1617 | % if not has_no_sources: |
| 1618 | ${tgt.name.upper()}_SRC = \\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1619 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1620 | % for src in tgt.src: |
| 1621 | ${proto_to_cc(src)} \\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1622 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1623 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1624 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1625 | ${tgt.name.upper()}_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(${tgt.name.upper()}_SRC)))) |
| 1626 | % endif |
| 1627 | % if tgt.get('secure', 'check') == True or tgt.get('secure', 'check') == 'check': |
| 1628 | ifeq ($(NO_SECURE),true) |
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 | # You can't build secure targets if you don't have OpenSSL. |
Nicolas Noble | 047b727 | 2015-01-16 13:55:05 -0800 | [diff] [blame] | 1631 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1632 | $(BINDIR)/$(CONFIG)/${tgt.name}: openssl_dep_error |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 1633 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1634 | else |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 1635 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1636 | % endif |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 1637 | |
| 1638 | % if tgt.boringssl: |
| 1639 | # boringssl needs an override to ensure that it does not include |
| 1640 | # system openssl headers regardless of other configuration |
| 1641 | # we do so here with a target specific variable assignment |
| 1642 | $(${tgt.name.upper()}_OBJS): CFLAGS := -Ithird_party/boringssl/include $(CFLAGS) -Wno-sign-conversion -Wno-conversion -Wno-unused-value |
| 1643 | $(${tgt.name.upper()}_OBJS): CXXFLAGS := -Ithird_party/boringssl/include $(CXXFLAGS) |
| 1644 | $(${tgt.name.upper()}_OBJS): CPPFLAGS += -DOPENSSL_NO_ASM -D_GNU_SOURCE |
| 1645 | % else: |
| 1646 | % endif |
| 1647 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1648 | ## |
| 1649 | ## We're not trying to add a dependency on building zlib and openssl here, |
| 1650 | ## as it's already done in the libraries. We're assuming that the build |
| 1651 | ## trickles down, and that a secure target requires a secure version of |
| 1652 | ## a library. |
| 1653 | ## |
| 1654 | ## That simplifies the codegen a bit, but prevents a fully defined Makefile. |
| 1655 | ## I can live with that. |
| 1656 | ## |
| 1657 | % if tgt.build == 'protoc' or tgt.language == 'c++': |
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 | ifeq ($(NO_PROTOBUF),true) |
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 | # 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] | 1662 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1663 | $(BINDIR)/$(CONFIG)/${tgt.name}: protobuf_dep_error |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1664 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1665 | else |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1666 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1667 | $(BINDIR)/$(CONFIG)/${tgt.name}: \ |
| 1668 | % if not has_no_sources: |
| 1669 | $(PROTOBUF_DEP) $(${tgt.name.upper()}_OBJS)\ |
| 1670 | % endif |
| 1671 | % else: |
| 1672 | $(BINDIR)/$(CONFIG)/${tgt.name}: \ |
| 1673 | % if not has_no_sources: |
| 1674 | $(${tgt.name.upper()}_OBJS)\ |
| 1675 | % endif |
| 1676 | % endif |
| 1677 | % for dep in tgt.deps: |
| 1678 | $(LIBDIR)/$(CONFIG)/lib${dep}.a\ |
| 1679 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1680 | |
Craig Tiller | 0fe5ee7 | 2015-12-22 12:50:36 -0800 | [diff] [blame] | 1681 | % if tgt.language == "c++" or tgt.boringssl: |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1682 | ## C++ targets specificies. |
| 1683 | % if tgt.build == 'protoc': |
| 1684 | $(E) "[HOSTLD] Linking $@" |
| 1685 | $(Q) mkdir -p `dirname $@` |
| 1686 | $(Q) $(HOST_LDXX) $(HOST_LDFLAGS) \ |
| 1687 | % if not has_no_sources: |
| 1688 | $(${tgt.name.upper()}_OBJS)\ |
| 1689 | % endif |
| 1690 | % else: |
| 1691 | $(E) "[LD] Linking $@" |
| 1692 | $(Q) mkdir -p `dirname $@` |
| 1693 | $(Q) $(LDXX) $(LDFLAGS) \ |
| 1694 | % if not has_no_sources: |
| 1695 | $(${tgt.name.upper()}_OBJS)\ |
| 1696 | % endif |
| 1697 | % endif |
| 1698 | % else: |
| 1699 | ## C-only targets specificities. |
| 1700 | $(E) "[LD] Linking $@" |
| 1701 | $(Q) mkdir -p `dirname $@` |
| 1702 | $(Q) $(LD) $(LDFLAGS) \ |
| 1703 | % if not has_no_sources: |
| 1704 | $(${tgt.name.upper()}_OBJS)\ |
| 1705 | % endif |
| 1706 | % endif |
| 1707 | % for dep in tgt.deps: |
| 1708 | $(LIBDIR)/$(CONFIG)/lib${dep}.a\ |
| 1709 | % endfor |
| 1710 | % if 'zookeeper' in tgt.get('external_deps', []): |
| 1711 | -lzookeeper_mt\ |
| 1712 | % endif |
| 1713 | % if tgt.language == "c++": |
| 1714 | % if tgt.build == 'protoc': |
| 1715 | $(HOST_LDLIBSXX) $(HOST_LDLIBS_PROTOC)\ |
| 1716 | % else: |
| 1717 | $(LDLIBSXX) $(LDLIBS_PROTOBUF)\ |
| 1718 | % endif |
| 1719 | % endif |
| 1720 | % if tgt.build == 'protoc': |
| 1721 | $(HOST_LDLIBS)\ |
| 1722 | % else: |
| 1723 | $(LDLIBS)\ |
| 1724 | % endif |
| 1725 | % if tgt.build == 'protoc': |
| 1726 | $(HOST_LDLIBS_PROTOC)\ |
| 1727 | % elif tgt.get('secure', 'check') == True or tgt.get('secure', 'check') == 'check': |
| 1728 | $(LDLIBS_SECURE)\ |
| 1729 | % endif |
| 1730 | % if tgt.language == 'c++' and tgt.build == 'test': |
| 1731 | $(GTEST_LIB)\ |
| 1732 | % elif tgt.language == 'c++' and tgt.build == 'benchmark': |
| 1733 | $(GTEST_LIB)\ |
| 1734 | % endif |
| 1735 | -o $(BINDIR)/$(CONFIG)/${tgt.name} |
| 1736 | % if tgt.build == 'protoc' or tgt.language == 'c++': |
Nicolas Noble | 5383062 | 2015-02-12 16:56:38 -0800 | [diff] [blame] | 1737 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1738 | endif |
| 1739 | % endif |
| 1740 | % if tgt.get('secure', 'check') == True or tgt.get('secure', 'check') == 'check': |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 1741 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1742 | endif |
| 1743 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1744 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1745 | % for src in tgt.src: |
| 1746 | $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: \ |
| 1747 | % for dep in tgt.deps: |
| 1748 | $(LIBDIR)/$(CONFIG)/lib${dep}.a\ |
| 1749 | % endfor |
Craig Tiller | f5371ef | 2015-01-12 16:40:18 -0800 | [diff] [blame] | 1750 | |
Craig Tiller | ab23045 | 2016-01-04 08:18:43 -0800 | [diff] [blame] | 1751 | % if tgt.language == 'c89': |
| 1752 | % for src in tgt.src: |
Craig Tiller | ea21ca2 | 2016-01-04 12:34:29 -0800 | [diff] [blame] | 1753 | $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o : ${src} |
| 1754 | $(E) "[C] Compiling $<" |
| 1755 | $(Q) mkdir -p `dirname $@` |
Nicolas "Pixel" Noble | 4500034 | 2016-01-28 05:04:45 +0100 | [diff] [blame] | 1756 | $(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] | 1757 | % endfor |
| 1758 | % endif |
| 1759 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1760 | % endfor |
| 1761 | % if not has_no_sources: |
| 1762 | deps_${tgt.name}: $(${tgt.name.upper()}_OBJS:.o=.dep) |
| 1763 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1764 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1765 | % if not has_no_sources: |
| 1766 | % if tgt.get('secure', 'check') == True or tgt.get('secure', 'check') == 'check': |
| 1767 | ifneq ($(NO_SECURE),true) |
| 1768 | % endif |
| 1769 | ifneq ($(NO_DEPS),true) |
| 1770 | -include $(${tgt.name.upper()}_OBJS:.o=.dep) |
| 1771 | endif |
| 1772 | % if tgt.get('secure', 'check') == True or tgt.get('secure', 'check') == 'check': |
| 1773 | endif |
| 1774 | % endif |
| 1775 | % endif |
Nicolas "Pixel" Noble | 472bb68 | 2015-11-03 19:09:01 +0100 | [diff] [blame] | 1776 | % for src in tgt.src: |
| 1777 | % if not proto_re.match(src) and any(proto_re.match(src2) for src2 in tgt.src): |
| 1778 | $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: ${' '.join(proto_to_cc(src2) for src2 in tgt.src if proto_re.match(src2))} |
| 1779 | % endif |
| 1780 | % endfor |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1781 | </%def> |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1782 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1783 | ifneq ($(OPENSSL_DEP),) |
| 1784 | # This is to ensure the embedded OpenSSL is built beforehand, properly |
| 1785 | # installing headers to their final destination on the drive. We need this |
| 1786 | # otherwise parallel compilation will fail if a source is compiled first. |
| 1787 | % for src in sorted(sources_that_need_openssl): |
| 1788 | % if src not in sources_that_don_t_need_openssl: |
| 1789 | ${src}: $(OPENSSL_DEP) |
| 1790 | % endif |
| 1791 | % endfor |
| 1792 | endif |
Nicolas "Pixel" Noble | 010f1e7 | 2015-04-23 02:23:49 +0200 | [diff] [blame] | 1793 | |
Craig Tiller | 841c880 | 2015-09-10 13:06:37 -0700 | [diff] [blame] | 1794 | .PHONY: all strip tools \ |
| 1795 | dep_error openssl_dep_error openssl_dep_message git_update stop \ |
| 1796 | buildtests buildtests_c buildtests_cxx \ |
| 1797 | test test_c test_cxx \ |
| 1798 | install install_c install_cxx \ |
| 1799 | install-headers install-headers_c install-headers_cxx \ |
| 1800 | install-shared install-shared_c install-shared_cxx \ |
| 1801 | install-static install-static_c install-static_cxx \ |
| 1802 | strip strip-shared strip-static \ |
| 1803 | strip_c strip-shared_c strip-static_c \ |
| 1804 | strip_cxx strip-shared_cxx strip-static_cxx \ |
| 1805 | dep_c dep_cxx bins_dep_c bins_dep_cxx \ |
| 1806 | clean |