Makefile.template 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515
  1. # GRPC global makefile
  2. # This currently builds C and C++ code.
  3. # This file has been automatically generated from a template file.
  4. # Please look at the templates directory instead.
  5. # This file can be regenerated from the template by running
  6. # tools/buildgen/generate_projects.sh
  7. # Copyright 2015, Google Inc.
  8. # All rights reserved.
  9. #
  10. # Redistribution and use in source and binary forms, with or without
  11. # modification, are permitted provided that the following conditions are
  12. # met:
  13. #
  14. # * Redistributions of source code must retain the above copyright
  15. # notice, this list of conditions and the following disclaimer.
  16. # * Redistributions in binary form must reproduce the above
  17. # copyright notice, this list of conditions and the following disclaimer
  18. # in the documentation and/or other materials provided with the
  19. # distribution.
  20. # * Neither the name of Google Inc. nor the names of its
  21. # contributors may be used to endorse or promote products derived from
  22. # this software without specific prior written permission.
  23. #
  24. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  25. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  26. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  27. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  28. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  29. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  30. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  31. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  32. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  33. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  34. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. <%!
  36. import re
  37. import os
  38. proto_re = re.compile('(.*)\\.proto')
  39. def proto_to_cc(filename):
  40. m = proto_re.match(filename)
  41. if not m:
  42. return filename
  43. return '$(GENDIR)/' + m.group(1) + '.pb.cc $(GENDIR)/' + m.group(1) + '.grpc.pb.cc'
  44. sources_that_need_openssl = set()
  45. sources_that_don_t_need_openssl = set()
  46. %>
  47. # Basic platform detection
  48. HOST_SYSTEM = $(shell uname | cut -f 1 -d_)
  49. ifeq ($(SYSTEM),)
  50. SYSTEM = $(HOST_SYSTEM)
  51. endif
  52. ifeq ($(SYSTEM),MSYS)
  53. SYSTEM = MINGW32
  54. endif
  55. ifeq ($(SYSTEM),MINGW64)
  56. SYSTEM = MINGW32
  57. endif
  58. ifndef BUILDDIR
  59. BUILDDIR = .
  60. endif
  61. HAS_GCC = $(shell which gcc > /dev/null 2> /dev/null && echo true || echo false)
  62. HAS_CC = $(shell which cc > /dev/null 2> /dev/null && echo true || echo false)
  63. HAS_CLANG = $(shell which clang > /dev/null 2> /dev/null && echo true || echo false)
  64. ifeq ($(HAS_CC),true)
  65. DEFAULT_CC = cc
  66. DEFAULT_CXX = c++
  67. else
  68. ifeq ($(HAS_GCC),true)
  69. DEFAULT_CC = gcc
  70. DEFAULT_CXX = g++
  71. else
  72. ifeq ($(HAS_CLANG),true)
  73. DEFAULT_CC = clang
  74. DEFAULT_CXX = clang++
  75. else
  76. DEFAULT_CC = no_c_compiler
  77. DEFAULT_CXX = no_c++_compiler
  78. endif
  79. endif
  80. endif
  81. BINDIR = $(BUILDDIR)/bins
  82. OBJDIR = $(BUILDDIR)/objs
  83. LIBDIR = $(BUILDDIR)/libs
  84. GENDIR = $(BUILDDIR)/gens
  85. # Configurations
  86. VALID_CONFIG_opt = 1
  87. CC_opt = $(DEFAULT_CC)
  88. CXX_opt = $(DEFAULT_CXX)
  89. LD_opt = $(DEFAULT_CC)
  90. LDXX_opt = $(DEFAULT_CXX)
  91. CPPFLAGS_opt = -O2
  92. LDFLAGS_opt =
  93. DEFINES_opt = NDEBUG
  94. VALID_CONFIG_basicprof = 1
  95. CC_basicprof = $(DEFAULT_CC)
  96. CXX_basicprof = $(DEFAULT_CXX)
  97. LD_basicprof = $(DEFAULT_CC)
  98. LDXX_basicprof = $(DEFAULT_CXX)
  99. CPPFLAGS_basicprof = -O2 -DGRPC_BASIC_PROFILER -DGRPC_TIMERS_RDTSC
  100. LDFLAGS_basicprof =
  101. DEFINES_basicprof = NDEBUG
  102. VALID_CONFIG_stapprof = 1
  103. CC_stapprof = $(DEFAULT_CC)
  104. CXX_stapprof = $(DEFAULT_CXX)
  105. LD_stapprof = $(DEFAULT_CC)
  106. LDXX_stapprof = $(DEFAULT_CXX)
  107. CPPFLAGS_stapprof = -O2 -DGRPC_STAP_PROFILER
  108. LDFLAGS_stapprof =
  109. DEFINES_stapprof = NDEBUG
  110. VALID_CONFIG_dbg = 1
  111. CC_dbg = $(DEFAULT_CC)
  112. CXX_dbg = $(DEFAULT_CXX)
  113. LD_dbg = $(DEFAULT_CC)
  114. LDXX_dbg = $(DEFAULT_CXX)
  115. CPPFLAGS_dbg = -O0
  116. LDFLAGS_dbg =
  117. DEFINES_dbg = _DEBUG DEBUG
  118. VALID_CONFIG_mutrace = 1
  119. CC_mutrace = $(DEFAULT_CC)
  120. CXX_mutrace = $(DEFAULT_CXX)
  121. LD_mutrace = $(DEFAULT_CC)
  122. LDXX_mutrace = $(DEFAULT_CXX)
  123. CPPFLAGS_mutrace = -O0
  124. LDFLAGS_mutrace = -rdynamic
  125. DEFINES_mutrace = _DEBUG DEBUG
  126. VALID_CONFIG_valgrind = 1
  127. REQUIRE_CUSTOM_LIBRARIES_valgrind = 1
  128. CC_valgrind = $(DEFAULT_CC)
  129. CXX_valgrind = $(DEFAULT_CXX)
  130. LD_valgrind = $(DEFAULT_CC)
  131. LDXX_valgrind = $(DEFAULT_CXX)
  132. CPPFLAGS_valgrind = -O0
  133. OPENSSL_CFLAGS_valgrind = -DPURIFY
  134. LDFLAGS_valgrind =
  135. DEFINES_valgrind = _DEBUG DEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=20
  136. VALID_CONFIG_tsan = 1
  137. REQUIRE_CUSTOM_LIBRARIES_tsan = 1
  138. CC_tsan = clang
  139. CXX_tsan = clang++
  140. LD_tsan = clang
  141. LDXX_tsan = clang++
  142. CPPFLAGS_tsan = -O0 -fsanitize=thread -fno-omit-frame-pointer
  143. LDFLAGS_tsan = -fsanitize=thread
  144. DEFINES_tsan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=10
  145. VALID_CONFIG_asan = 1
  146. REQUIRE_CUSTOM_LIBRARIES_asan = 1
  147. CC_asan = clang
  148. CXX_asan = clang++
  149. LD_asan = clang
  150. LDXX_asan = clang++
  151. CPPFLAGS_asan = -O0 -fsanitize=address -fno-omit-frame-pointer
  152. LDFLAGS_asan = -fsanitize=address
  153. DEFINES_asan = GRPC_TEST_SLOWDOWN_BUILD_FACTOR=5
  154. VALID_CONFIG_msan = 1
  155. REQUIRE_CUSTOM_LIBRARIES_msan = 1
  156. CC_msan = clang
  157. CXX_msan = clang++-libc++
  158. LD_msan = clang
  159. LDXX_msan = clang++-libc++
  160. CPPFLAGS_msan = -O0 -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1
  161. OPENSSL_CFLAGS_msan = -DPURIFY
  162. LDFLAGS_msan = -fsanitize=memory -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1
  163. DEFINES_msan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=20
  164. VALID_CONFIG_ubsan = 1
  165. REQUIRE_CUSTOM_LIBRARIES_ubsan = 1
  166. CC_ubsan = clang
  167. CXX_ubsan = clang++
  168. LD_ubsan = clang
  169. LDXX_ubsan = clang++
  170. CPPFLAGS_ubsan = -O1 -fsanitize=undefined -fno-omit-frame-pointer
  171. OPENSSL_CFLAGS_ubsan = -DPURIFY
  172. LDFLAGS_ubsan = -fsanitize=undefined
  173. DEFINES_ubsan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=10
  174. VALID_CONFIG_gcov = 1
  175. CC_gcov = gcc
  176. CXX_gcov = g++
  177. LD_gcov = gcc
  178. LDXX_gcov = g++
  179. CPPFLAGS_gcov = -O0 -fprofile-arcs -ftest-coverage
  180. LDFLAGS_gcov = -fprofile-arcs -ftest-coverage
  181. DEFINES_gcov = _DEBUG DEBUG
  182. # General settings.
  183. # You may want to change these depending on your system.
  184. prefix ?= /usr/local
  185. PROTOC = protoc
  186. DTRACE = dtrace
  187. CONFIG ?= opt
  188. CC = $(CC_$(CONFIG))
  189. CXX = $(CXX_$(CONFIG))
  190. LD = $(LD_$(CONFIG))
  191. LDXX = $(LDXX_$(CONFIG))
  192. AR = ar
  193. ifeq ($(SYSTEM),Linux)
  194. STRIP = strip --strip-unneeded
  195. else
  196. ifeq ($(SYSTEM),Darwin)
  197. STRIP = strip -x
  198. else
  199. STRIP = strip
  200. endif
  201. endif
  202. INSTALL = install
  203. RM = rm -f
  204. ifndef VALID_CONFIG_$(CONFIG)
  205. $(error Invalid CONFIG value '$(CONFIG)')
  206. endif
  207. ifeq ($(SYSTEM),Linux)
  208. TMPOUT = /dev/null
  209. else
  210. TMPOUT = `mktemp /tmp/test-out-XXXXXX`
  211. endif
  212. # Detect if we can use C++11
  213. CXX11_CHECK_CMD = $(CXX) -std=c++11 -o $(TMPOUT) -c test/build/c++11.cc
  214. HAS_CXX11 = $(shell $(CXX11_CHECK_CMD) 2> /dev/null && echo true || echo false)
  215. # The HOST compiler settings are used to compile the protoc plugins.
  216. # In most cases, you won't have to change anything, but if you are
  217. # cross-compiling, you can override these variables from GNU make's
  218. # command line: make CC=cross-gcc HOST_CC=gcc
  219. HOST_CC = $(CC)
  220. HOST_CXX = $(CXX)
  221. HOST_LD = $(LD)
  222. HOST_LDXX = $(LDXX)
  223. CPPFLAGS += $(CPPFLAGS_$(CONFIG))
  224. DEFINES += $(DEFINES_$(CONFIG)) INSTALL_PREFIX=\"$(prefix)\"
  225. LDFLAGS += $(LDFLAGS_$(CONFIG))
  226. ifdef EXTRA_DEFINES
  227. DEFINES += $(EXTRA_DEFINES)
  228. endif
  229. CFLAGS += -std=c89 -pedantic
  230. ifeq ($(HAS_CXX11),true)
  231. CXXFLAGS += -std=c++11
  232. else
  233. CXXFLAGS += -std=c++0x
  234. endif
  235. CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter
  236. LDFLAGS += -g
  237. ifneq ($(SYSTEM),MINGW32)
  238. PIC_CPPFLAGS = -fPIC
  239. CPPFLAGS += -fPIC
  240. LDFLAGS += -fPIC
  241. endif
  242. INCLUDES = . include $(GENDIR)
  243. LDFLAGS += -Llibs/$(CONFIG)
  244. ifeq ($(SYSTEM),Darwin)
  245. ifneq ($(wildcard /usr/local/ssl/include),)
  246. INCLUDES += /usr/local/ssl/include
  247. endif
  248. ifneq ($(wildcard /opt/local/include),)
  249. INCLUDES += /opt/local/include
  250. endif
  251. ifneq ($(wildcard /usr/local/include),)
  252. INCLUDES += /usr/local/include
  253. endif
  254. LIBS = m z
  255. ifneq ($(wildcard /usr/local/ssl/lib),)
  256. LDFLAGS += -L/usr/local/ssl/lib
  257. endif
  258. ifneq ($(wildcard /opt/local/lib),)
  259. LDFLAGS += -L/opt/local/lib
  260. endif
  261. ifneq ($(wildcard /usr/local/lib),)
  262. LDFLAGS += -L/usr/local/lib
  263. endif
  264. endif
  265. ifeq ($(SYSTEM),Linux)
  266. LIBS = rt m z pthread
  267. LDFLAGS += -pthread
  268. endif
  269. ifeq ($(SYSTEM),MINGW32)
  270. LIBS = m z pthread
  271. LDFLAGS += -pthread
  272. endif
  273. ifneq ($(wildcard /usr/src/gtest/src/gtest-all.cc),)
  274. GTEST_LIB = /usr/src/gtest/src/gtest-all.cc -I/usr/src/gtest
  275. else
  276. GTEST_LIB = -lgtest
  277. endif
  278. GTEST_LIB += -lgflags
  279. ifeq ($(V),1)
  280. E = @:
  281. Q =
  282. else
  283. E = @echo
  284. Q = @
  285. endif
  286. VERSION = ${settings.version.major}.${settings.version.minor}.${settings.version.micro}.${settings.version.build}
  287. CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
  288. CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
  289. LDFLAGS += $(ARCH_FLAGS)
  290. LDLIBS += $(addprefix -l, $(LIBS))
  291. LDLIBSXX += $(addprefix -l, $(LIBSXX))
  292. HOST_CPPFLAGS = $(CPPFLAGS)
  293. HOST_CFLAGS = $(CFLAGS)
  294. HOST_CXXFLAGS = $(CXXFLAGS)
  295. HOST_LDFLAGS = $(LDFLAGS)
  296. HOST_LDLIBS = $(LDLIBS)
  297. # These are automatically computed variables.
  298. # There shouldn't be any need to change anything from now on.
  299. HAS_PKG_CONFIG = $(shell command -v pkg-config >/dev/null 2>&1 && echo true || echo false)
  300. ifeq ($(SYSTEM),MINGW32)
  301. SHARED_EXT = dll
  302. endif
  303. ifeq ($(SYSTEM),Darwin)
  304. SHARED_EXT = dylib
  305. endif
  306. ifeq ($(SHARED_EXT),)
  307. SHARED_EXT = so.$(VERSION)
  308. endif
  309. ifeq ($(wildcard .git),)
  310. IS_GIT_FOLDER = false
  311. else
  312. IS_GIT_FOLDER = true
  313. endif
  314. ifeq ($(SYSTEM),Linux)
  315. OPENSSL_REQUIRES_DL = true
  316. endif
  317. ifeq ($(SYSTEM),Darwin)
  318. OPENSSL_REQUIRES_DL = true
  319. endif
  320. ifeq ($(HAS_PKG_CONFIG),true)
  321. OPENSSL_ALPN_CHECK_CMD = pkg-config --atleast-version=1.0.2 openssl
  322. ZLIB_CHECK_CMD = pkg-config --exists zlib
  323. PERFTOOLS_CHECK_CMD = pkg-config --exists profiler
  324. PROTOBUF_CHECK_CMD = pkg-config --atleast-version=3.0.0-alpha-3 protobuf
  325. else # HAS_PKG_CONFIG
  326. ifeq ($(SYSTEM),MINGW32)
  327. OPENSSL_LIBS = ssl32 eay32
  328. else
  329. OPENSSL_LIBS = ssl crypto
  330. endif
  331. OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c $(addprefix -l, $(OPENSSL_LIBS)) $(LDFLAGS)
  332. ZLIB_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/zlib.c -lz $(LDFLAGS)
  333. PERFTOOLS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/perftools.c -lprofiler $(LDFLAGS)
  334. PROTOBUF_CHECK_CMD = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/protobuf.cc -lprotobuf $(LDFLAGS)
  335. ifeq ($(OPENSSL_REQUIRES_DL),true)
  336. OPENSSL_ALPN_CHECK_CMD += -ldl
  337. endif
  338. endif # HAS_PKG_CONFIG
  339. PROTOC_CHECK_CMD = which protoc > /dev/null
  340. PROTOC_CHECK_VERSION_CMD = protoc --version | grep -q libprotoc.3
  341. DTRACE_CHECK_CMD = which dtrace > /dev/null
  342. SYSTEMTAP_HEADERS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/systemtap.c $(LDFLAGS)
  343. ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG)
  344. HAS_SYSTEM_PERFTOOLS = $(shell $(PERFTOOLS_CHECK_CMD) 2> /dev/null && echo true || echo false)
  345. ifeq ($(HAS_SYSTEM_PERFTOOLS),true)
  346. DEFINES += GRPC_HAVE_PERFTOOLS
  347. LIBS += profiler
  348. endif
  349. endif
  350. HAS_SYSTEM_PROTOBUF_VERIFY = $(shell $(PROTOBUF_CHECK_CMD) 2> /dev/null && echo true || echo false)
  351. ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG)
  352. HAS_SYSTEM_OPENSSL_ALPN = $(shell $(OPENSSL_ALPN_CHECK_CMD) 2> /dev/null && echo true || echo false)
  353. HAS_SYSTEM_ZLIB = $(shell $(ZLIB_CHECK_CMD) 2> /dev/null && echo true || echo false)
  354. HAS_SYSTEM_PROTOBUF = $(HAS_SYSTEM_PROTOBUF_VERIFY)
  355. else
  356. # override system libraries if the config requires a custom compiled library
  357. HAS_SYSTEM_OPENSSL_ALPN = false
  358. HAS_SYSTEM_ZLIB = false
  359. HAS_SYSTEM_PROTOBUF = false
  360. endif
  361. HAS_PROTOC = $(shell $(PROTOC_CHECK_CMD) 2> /dev/null && echo true || echo false)
  362. ifeq ($(HAS_PROTOC),true)
  363. HAS_VALID_PROTOC = $(shell $(PROTOC_CHECK_VERSION_CMD) 2> /dev/null && echo true || echo false)
  364. else
  365. HAS_VALID_PROTOC = false
  366. endif
  367. # Check for Systemtap (https://sourceware.org/systemtap/), first by making sure <sys/sdt.h> is present
  368. # in the system and secondly by checking for the "dtrace" binary (on Linux, this is part of the Systemtap
  369. # distribution. It's part of the base system on BSD/Solaris machines).
  370. HAS_SYSTEMTAP_HEADERS = $(shell $(SYSTEMTAP_HEADERS_CHECK_CMD) 2> /dev/null && echo true || echo false)
  371. HAS_DTRACE = $(shell $(DTRACE_CHECK_CMD) 2> /dev/null && echo true || echo false)
  372. HAS_SYSTEMTAP = false
  373. ifeq ($(HAS_SYSTEMTAP_HEADERS),true)
  374. ifeq ($(HAS_DTRACE),true)
  375. HAS_SYSTEMTAP = true
  376. endif
  377. endif
  378. ifeq ($(wildcard third_party/openssl/ssl/ssl.h),)
  379. HAS_EMBEDDED_OPENSSL_ALPN = false
  380. else
  381. HAS_EMBEDDED_OPENSSL_ALPN = true
  382. endif
  383. ifeq ($(wildcard third_party/zlib/zlib.h),)
  384. HAS_EMBEDDED_ZLIB = false
  385. else
  386. HAS_EMBEDDED_ZLIB = true
  387. endif
  388. ifeq ($(wildcard third_party/protobuf/src/google/protobuf/descriptor.pb.h),)
  389. HAS_EMBEDDED_PROTOBUF = false
  390. ifneq ($(HAS_VALID_PROTOC),true)
  391. NO_PROTOC = true
  392. endif
  393. else
  394. HAS_EMBEDDED_PROTOBUF = true
  395. endif
  396. ifeq ($(HAS_SYSTEM_ZLIB),false)
  397. ifeq ($(HAS_EMBEDDED_ZLIB),true)
  398. ZLIB_DEP = $(LIBDIR)/$(CONFIG)/zlib/libz.a
  399. CPPFLAGS += -Ithird_party/zlib
  400. LDFLAGS += -L$(LIBDIR)/$(CONFIG)/zlib
  401. else
  402. DEP_MISSING += zlib
  403. endif
  404. else
  405. ifeq ($(HAS_PKG_CONFIG),true)
  406. CPPFLAGS += $(shell pkg-config --cflags zlib)
  407. LDFLAGS += $(shell pkg-config --libs-only-L zlib)
  408. endif
  409. endif
  410. OPENSSL_PKG_CONFIG = false
  411. ifeq ($(HAS_SYSTEM_OPENSSL_ALPN),true)
  412. ifeq ($(HAS_PKG_CONFIG),true)
  413. OPENSSL_PKG_CONFIG = true
  414. CPPFLAGS := $(shell pkg-config --cflags openssl) $(CPPFLAGS)
  415. LDFLAGS_OPENSSL_PKG_CONFIG = $(shell pkg-config --libs-only-L openssl)
  416. ifeq ($(SYSTEM),Linux)
  417. ifneq ($(LDFLAGS_OPENSSL_PKG_CONFIG),)
  418. LDFLAGS_OPENSSL_PKG_CONFIG += $(shell pkg-config --libs-only-L openssl | sed s/L/Wl,-rpath,/)
  419. endif
  420. endif
  421. LDFLAGS := $(LDFLAGS_OPENSSL_PKG_CONFIG) $(LDFLAGS)
  422. else
  423. LIBS_SECURE = $(OPENSSL_LIBS)
  424. ifeq ($(OPENSSL_REQUIRES_DL),true)
  425. LIBS_SECURE += dl
  426. endif
  427. endif
  428. else
  429. ifeq ($(HAS_EMBEDDED_OPENSSL_ALPN),true)
  430. OPENSSL_DEP = $(LIBDIR)/$(CONFIG)/openssl/libssl.a
  431. OPENSSL_MERGE_LIBS += $(LIBDIR)/$(CONFIG)/openssl/libssl.a $(LIBDIR)/$(CONFIG)/openssl/libcrypto.a
  432. # need to prefix these to ensure overriding system libraries
  433. CPPFLAGS := -Ithird_party/openssl/include $(CPPFLAGS)
  434. LDFLAGS := -L$(LIBDIR)/$(CONFIG)/openssl $(LDFLAGS)
  435. ifeq ($(OPENSSL_REQUIRES_DL),true)
  436. LIBS_SECURE = dl
  437. endif
  438. else
  439. NO_SECURE = true
  440. endif
  441. endif
  442. ifeq ($(OPENSSL_PKG_CONFIG),true)
  443. LDLIBS_SECURE += $(shell pkg-config --libs-only-l openssl)
  444. else
  445. LDLIBS_SECURE += $(addprefix -l, $(LIBS_SECURE))
  446. endif
  447. PROTOBUF_PKG_CONFIG = false
  448. ifeq ($(HAS_SYSTEM_PROTOBUF),true)
  449. ifeq ($(HAS_PKG_CONFIG),true)
  450. PROTOBUF_PKG_CONFIG = true
  451. CPPFLAGS := $(shell pkg-config --cflags protobuf) $(CPPFLAGS)
  452. LDFLAGS_PROTOBUF_PKG_CONFIG = $(shell pkg-config --libs-only-L protobuf)
  453. ifeq ($(SYSTEM),Linux)
  454. ifneq ($(LDFLAGS_PROTOBUF_PKG_CONFIG),)
  455. LDFLAGS_PROTOBUF_PKG_CONFIG += $(shell pkg-config --libs-only-L protobuf | sed s/L/Wl,-rpath,/)
  456. endif
  457. endif
  458. endif
  459. else
  460. ifeq ($(HAS_EMBEDDED_PROTOBUF),true)
  461. PROTOBUF_DEP = $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a
  462. CPPFLAGS := -Ithird_party/protobuf/src $(CPPFLAGS)
  463. LDFLAGS := -L$(LIBDIR)/$(CONFIG)/protobuf $(LDFLAGS)
  464. PROTOC = $(BINDIR)/$(CONFIG)/protobuf/protoc
  465. else
  466. NO_PROTOBUF = true
  467. endif
  468. endif
  469. LIBS_PROTOBUF = protobuf
  470. LIBS_PROTOC = protoc protobuf
  471. HOST_LDLIBS_PROTOC += $(addprefix -l, $(LIBS_PROTOC))
  472. ifeq ($(PROTOBUF_PKG_CONFIG),true)
  473. LDLIBS_PROTOBUF += $(shell pkg-config --libs-only-l protobuf)
  474. else
  475. LDLIBS_PROTOBUF += $(addprefix -l, $(LIBS_PROTOBUF))
  476. endif
  477. ifeq ($(MAKECMDGOALS),clean)
  478. NO_DEPS = true
  479. endif
  480. INSTALL_OK = false
  481. ifeq ($(HAS_VALID_PROTOC),true)
  482. ifeq ($(HAS_SYSTEM_PROTOBUF_VERIFY),true)
  483. INSTALL_OK = true
  484. endif
  485. endif
  486. .SECONDARY = %.pb.h %.pb.cc
  487. PROTOC_PLUGINS =\
  488. % for tgt in targets:
  489. % if tgt.build == 'protoc':
  490. $(BINDIR)/$(CONFIG)/${tgt.name}\
  491. % endif
  492. % endfor
  493. ifeq ($(DEP_MISSING),)
  494. all: static shared plugins\
  495. % for tgt in targets:
  496. % if tgt.build == 'all':
  497. $(BINDIR)/$(CONFIG)/${tgt.name}\
  498. % endif
  499. % endfor
  500. dep_error:
  501. @echo "You shouldn't see this message - all of your dependencies are correct."
  502. else
  503. all: dep_error git_update stop
  504. dep_error:
  505. @echo
  506. @echo "DEPENDENCY ERROR"
  507. @echo
  508. @echo "You are missing system dependencies that are essential to build grpc,"
  509. @echo "and the third_party directory doesn't have them:"
  510. @echo
  511. @echo " $(DEP_MISSING)"
  512. @echo
  513. @echo "Installing the development packages for your system will solve"
  514. @echo "this issue. Please consult INSTALL to get more information."
  515. @echo
  516. @echo "If you need information about why these tests failed, run:"
  517. @echo
  518. @echo " make run_dep_checks"
  519. @echo
  520. endif
  521. git_update:
  522. ifeq ($(IS_GIT_FOLDER),true)
  523. @echo "Additionally, since you are in a git clone, you can download the"
  524. @echo "missing dependencies in third_party by running the following command:"
  525. @echo
  526. @echo " git submodule update --init"
  527. @echo
  528. endif
  529. openssl_dep_error: openssl_dep_message git_update stop
  530. protobuf_dep_error: protobuf_dep_message git_update stop
  531. protoc_dep_error: protoc_dep_message git_update stop
  532. openssl_dep_message:
  533. @echo
  534. @echo "DEPENDENCY ERROR"
  535. @echo
  536. @echo "The target you are trying to run requires OpenSSL with ALPN support."
  537. @echo "Your system doesn't have it, and neither does the third_party directory."
  538. @echo
  539. @echo "Please consult INSTALL to get more information."
  540. @echo
  541. @echo "If you need information about why these tests failed, run:"
  542. @echo
  543. @echo " make run_dep_checks"
  544. @echo
  545. protobuf_dep_message:
  546. @echo
  547. @echo "DEPENDENCY ERROR"
  548. @echo
  549. @echo "The target you are trying to run requires protobuf 3.0.0+"
  550. @echo "Your system doesn't have it, and neither does the third_party directory."
  551. @echo
  552. @echo "Please consult INSTALL to get more information."
  553. @echo
  554. @echo "If you need information about why these tests failed, run:"
  555. @echo
  556. @echo " make run_dep_checks"
  557. @echo
  558. protoc_dep_message:
  559. @echo
  560. @echo "DEPENDENCY ERROR"
  561. @echo
  562. @echo "The target you are trying to run requires protobuf-compiler 3.0.0+"
  563. @echo "Your system doesn't have it, and neither does the third_party directory."
  564. @echo
  565. @echo "Please consult INSTALL to get more information."
  566. @echo
  567. @echo "If you need information about why these tests failed, run:"
  568. @echo
  569. @echo " make run_dep_checks"
  570. @echo
  571. systemtap_dep_error:
  572. @echo
  573. @echo "DEPENDENCY ERROR"
  574. @echo
  575. @echo "Under the '$(CONFIG)' configutation, the target you are trying "
  576. @echo "to build requires systemtap 2.7+ (on Linux) or dtrace (on other "
  577. @echo "platforms such as Solaris and *BSD). "
  578. @echo
  579. @echo "Please consult INSTALL to get more information."
  580. @echo
  581. stop:
  582. @false
  583. % for tgt in targets:
  584. ${tgt.name}: $(BINDIR)/$(CONFIG)/${tgt.name}
  585. % endfor
  586. run_dep_checks:
  587. $(OPENSSL_ALPN_CHECK_CMD) || true
  588. $(ZLIB_CHECK_CMD) || true
  589. $(PERFTOOLS_CHECK_CMD) || true
  590. $(PROTOBUF_CHECK_CMD) || true
  591. $(PROTOC_CHECK_VERSION_CMD) || true
  592. $(LIBDIR)/$(CONFIG)/zlib/libz.a:
  593. $(E) "[MAKE] Building zlib"
  594. $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="$(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG))" ./configure --static)
  595. $(Q)$(MAKE) -C third_party/zlib clean
  596. $(Q)$(MAKE) -C third_party/zlib
  597. $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/zlib
  598. $(Q)cp third_party/zlib/libz.a $(LIBDIR)/$(CONFIG)/zlib
  599. $(LIBDIR)/$(CONFIG)/openssl/libssl.a:
  600. $(E) "[MAKE] Building openssl for $(SYSTEM)"
  601. ifeq ($(SYSTEM),Darwin)
  602. $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./Configure darwin64-x86_64-cc)
  603. else
  604. ifeq ($(SYSTEM),MINGW32)
  605. @echo "We currently don't have a good way to compile OpenSSL in-place under msys."
  606. @echo "Please provide an ALPN-capable OpenSSL in your mingw32 system."
  607. @echo
  608. @echo "Note that you can find a compatible version of the libraries here:"
  609. @echo
  610. @echo "http://slproweb.com/products/Win32OpenSSL.html"
  611. @echo
  612. @echo "If you decide to install that one, take the full version. The light"
  613. @echo "version only contains compiled DLLs, without the development files."
  614. @echo
  615. @echo "When installing, chose to copy the OpenSSL dlls to the OpenSSL binaries"
  616. @echo "directory. This way we'll link to them directly."
  617. @echo
  618. @echo "You can then re-start the build the following way:"
  619. @echo
  620. @echo " CPPFLAGS=-I/c/OpenSSL-Win64/include LDFLAGS=-L/c/OpenSSL-Win64 make"
  621. @false
  622. else
  623. $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./config no-asm $(OPENSSL_CONFIG_$(CONFIG)))
  624. endif
  625. endif
  626. $(Q)$(MAKE) -C third_party/openssl clean
  627. $(Q)(unset CPPFLAGS; $(MAKE) -C third_party/openssl build_crypto build_ssl)
  628. $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/openssl
  629. $(Q)cp third_party/openssl/libssl.a third_party/openssl/libcrypto.a $(LIBDIR)/$(CONFIG)/openssl
  630. third_party/protobuf/configure:
  631. $(E) "[AUTOGEN] Preparing protobuf"
  632. $(Q)(cd third_party/protobuf ; autoreconf -f -i -Wall,no-obsolete)
  633. $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure
  634. $(E) "[MAKE] Building protobuf"
  635. $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static)
  636. $(Q)$(MAKE) -C third_party/protobuf clean
  637. $(Q)$(MAKE) -C third_party/protobuf
  638. $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/protobuf
  639. $(Q)mkdir -p $(BINDIR)/$(CONFIG)/protobuf
  640. $(Q)cp third_party/protobuf/src/.libs/libprotoc.a $(LIBDIR)/$(CONFIG)/protobuf
  641. $(Q)cp third_party/protobuf/src/.libs/libprotobuf.a $(LIBDIR)/$(CONFIG)/protobuf
  642. $(Q)cp third_party/protobuf/src/protoc $(BINDIR)/$(CONFIG)/protobuf
  643. static: static_c static_cxx
  644. static_c: \
  645. % for lib in libs:
  646. % if lib.build == 'all' and lib.language == 'c':
  647. $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\
  648. % endif
  649. % endfor
  650. static_cxx: \
  651. % for lib in libs:
  652. % if lib.build == 'all' and lib.language == 'c++':
  653. $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\
  654. % endif
  655. % endfor
  656. shared: shared_c shared_cxx
  657. shared_c: \
  658. % for lib in libs:
  659. % if lib.build == 'all' and lib.language == 'c':
  660. $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\
  661. % endif
  662. % endfor
  663. shared_cxx: \
  664. % for lib in libs:
  665. % if lib.build == 'all' and lib.language == 'c++':
  666. $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\
  667. % endif
  668. % endfor
  669. shared_csharp: shared_c \
  670. % for lib in libs:
  671. % if lib.build == 'all' and lib.language == 'csharp':
  672. $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\
  673. % endif
  674. % endfor
  675. grpc_csharp_ext: shared_csharp
  676. plugins: $(PROTOC_PLUGINS)
  677. privatelibs: privatelibs_c privatelibs_cxx
  678. privatelibs_c: \
  679. % for lib in libs:
  680. % if lib.build == 'private' and lib.language == 'c':
  681. $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\
  682. % endif
  683. % endfor
  684. privatelibs_cxx: \
  685. % for lib in libs:
  686. % if lib.build == 'private' and lib.language == 'c++':
  687. $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\
  688. % endif
  689. % endfor
  690. buildtests: buildtests_c buildtests_cxx
  691. buildtests_c: privatelibs_c\
  692. % for tgt in targets:
  693. % if tgt.build == 'test' and not tgt.language == 'c++':
  694. $(BINDIR)/$(CONFIG)/${tgt.name}\
  695. % endif
  696. % endfor
  697. buildtests_cxx: privatelibs_cxx\
  698. % for tgt in targets:
  699. % if tgt.build == 'test' and tgt.language == 'c++':
  700. $(BINDIR)/$(CONFIG)/${tgt.name}\
  701. % endif
  702. % endfor
  703. test: test_c test_cxx
  704. flaky_test: flaky_test_c flaky_test_cxx
  705. test_c: buildtests_c
  706. % for tgt in targets:
  707. % if tgt.build == 'test' and tgt.get('run', True) and not tgt.language == 'c++' and not tgt.get('flaky', False):
  708. $(E) "[RUN] Testing ${tgt.name}"
  709. $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 )
  710. % endif
  711. % endfor
  712. flaky_test_c: buildtests_c
  713. % for tgt in targets:
  714. % if tgt.build == 'test' and tgt.get('run', True) and not tgt.language == 'c++' and tgt.get('flaky', False):
  715. $(E) "[RUN] Testing ${tgt.name}"
  716. $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 )
  717. % endif
  718. % endfor
  719. test_cxx: buildtests_cxx
  720. % for tgt in targets:
  721. % if tgt.build == 'test' and tgt.get('run', True) and tgt.language == 'c++' and not tgt.get('flaky', False):
  722. $(E) "[RUN] Testing ${tgt.name}"
  723. $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 )
  724. % endif
  725. % endfor
  726. flaky_test_cxx: buildtests_cxx
  727. % for tgt in targets:
  728. % if tgt.build == 'test' and tgt.get('run', True) and tgt.language == 'c++' and tgt.get('flaky', False):
  729. $(E) "[RUN] Testing ${tgt.name}"
  730. $(Q) $(BINDIR)/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 )
  731. % endif
  732. % endfor
  733. test_python: static_c
  734. $(E) "[RUN] Testing python code"
  735. $(Q) tools/run_tests/run_tests.py -lpython -c$(CONFIG)
  736. tools: tools_c tools_cxx
  737. tools_c: privatelibs_c\
  738. % for tgt in targets:
  739. % if tgt.build == 'tool' and not tgt.language=='c++':
  740. $(BINDIR)/$(CONFIG)/${tgt.name}\
  741. % endif
  742. % endfor
  743. tools_cxx: privatelibs_cxx\
  744. % for tgt in targets:
  745. % if tgt.build == 'tool' and tgt.language=='c++':
  746. $(BINDIR)/$(CONFIG)/${tgt.name}\
  747. % endif
  748. % endfor
  749. buildbenchmarks: privatelibs\
  750. % for tgt in targets:
  751. % if tgt.build == 'benchmark':
  752. $(BINDIR)/$(CONFIG)/${tgt.name}\
  753. % endif
  754. % endfor
  755. benchmarks: buildbenchmarks
  756. strip: strip-static strip-shared
  757. strip-static: strip-static_c strip-static_cxx
  758. strip-shared: strip-shared_c strip-shared_cxx
  759. # TODO(nnoble): the strip target is stripping in-place, instead
  760. # of copying files in a temporary folder.
  761. # This prevents proper debugging after running make install.
  762. strip-static_c: static_c
  763. ifeq ($(CONFIG),opt)
  764. % for lib in libs:
  765. % if lib.language == "c":
  766. % if lib.build == "all":
  767. $(E) "[STRIP] Stripping lib${lib.name}.a"
  768. $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a
  769. % endif
  770. % endif
  771. % endfor
  772. endif
  773. strip-static_cxx: static_cxx
  774. ifeq ($(CONFIG),opt)
  775. % for lib in libs:
  776. % if lib.language == "c++":
  777. % if lib.build == "all":
  778. $(E) "[STRIP] Stripping lib${lib.name}.a"
  779. $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a
  780. % endif
  781. % endif
  782. % endfor
  783. endif
  784. strip-shared_c: shared_c
  785. ifeq ($(CONFIG),opt)
  786. % for lib in libs:
  787. % if lib.language == "c":
  788. % if lib.build == "all":
  789. $(E) "[STRIP] Stripping lib${lib.name}.so"
  790. $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)
  791. % endif
  792. % endif
  793. % endfor
  794. endif
  795. strip-shared_cxx: shared_cxx
  796. ifeq ($(CONFIG),opt)
  797. % for lib in libs:
  798. % if lib.language == "c++":
  799. % if lib.build == "all":
  800. $(E) "[STRIP] Stripping lib${lib.name}.so"
  801. $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)
  802. % endif
  803. % endif
  804. % endfor
  805. endif
  806. strip-shared_csharp: shared_csharp
  807. ifeq ($(CONFIG),opt)
  808. % for lib in libs:
  809. % if lib.language == "csharp":
  810. % if lib.build == "all":
  811. $(E) "[STRIP] Stripping lib${lib.name}.so"
  812. $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)
  813. % endif
  814. % endif
  815. % endfor
  816. endif
  817. % for p in protos:
  818. ifeq ($(NO_PROTOC),true)
  819. $(GENDIR)/${p}.pb.cc: protoc_dep_error
  820. $(GENDIR)/${p}.grpc.pb.cc: protoc_dep_error
  821. else
  822. $(GENDIR)/${p}.pb.cc: ${p}.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
  823. $(E) "[PROTOC] Generating protobuf CC file from $<"
  824. $(Q) mkdir -p `dirname $@`
  825. $(Q) $(PROTOC) --cpp_out=$(GENDIR) $<
  826. $(GENDIR)/${p}.grpc.pb.cc: ${p}.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
  827. $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<"
  828. $(Q) mkdir -p `dirname $@`
  829. $(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $<
  830. endif
  831. % endfor
  832. ifeq ($(CONFIG),stapprof)
  833. src/core/profiling/stap_timers.c: $(GENDIR)/src/core/profiling/stap_probes.h
  834. ifeq ($(HAS_SYSTEMTAP),true)
  835. $(GENDIR)/src/core/profiling/stap_probes.h: src/core/profiling/stap_probes.d
  836. $(E) "[DTRACE] Compiling $<"
  837. $(Q) mkdir -p `dirname $@`
  838. $(Q) $(DTRACE) -C -h -s $< -o $@
  839. else
  840. $(GENDIR)/src/core/profiling/stap_probes.h: systemtap_dep_error stop
  841. endif
  842. endif
  843. $(OBJDIR)/$(CONFIG)/%.o : %.c
  844. $(E) "[C] Compiling $<"
  845. $(Q) mkdir -p `dirname $@`
  846. $(Q) $(CC) $(CFLAGS) $(CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $<
  847. $(OBJDIR)/$(CONFIG)/%.o : $(GENDIR)/%.pb.cc
  848. $(E) "[CXX] Compiling $<"
  849. $(Q) mkdir -p `dirname $@`
  850. $(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $<
  851. $(OBJDIR)/$(CONFIG)/src/compiler/%.o : src/compiler/%.cc
  852. $(E) "[HOSTCXX] Compiling $<"
  853. $(Q) mkdir -p `dirname $@`
  854. $(Q) $(HOST_CXX) $(HOST_CXXFLAGS) $(HOST_CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $<
  855. $(OBJDIR)/$(CONFIG)/%.o : %.cc
  856. $(E) "[CXX] Compiling $<"
  857. $(Q) mkdir -p `dirname $@`
  858. $(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $<
  859. install: install_c install_cxx install-plugins install-certs verify-install
  860. install_c: install-headers_c install-static_c install-shared_c
  861. install_cxx: install-headers_cxx install-static_cxx install-shared_cxx
  862. install_csharp: install-shared_csharp install_c
  863. install_grpc_csharp_ext: install_csharp
  864. install-headers: install-headers_c install-headers_cxx
  865. install-headers_c:
  866. $(E) "[INSTALL] Installing public C headers"
  867. $(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1
  868. $(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
  869. install-headers_cxx:
  870. $(E) "[INSTALL] Installing public C++ headers"
  871. $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1
  872. $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
  873. install-static: install-static_c install-static_cxx
  874. install-static_c: static_c strip-static_c
  875. % for lib in libs:
  876. % if lib.language == "c":
  877. % if lib.build == "all":
  878. $(E) "[INSTALL] Installing lib${lib.name}.a"
  879. $(Q) $(INSTALL) -d $(prefix)/lib
  880. $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(prefix)/lib/lib${lib.name}.a
  881. % endif
  882. % endif
  883. % endfor
  884. install-static_cxx: static_cxx strip-static_cxx
  885. % for lib in libs:
  886. % if lib.language == "c++":
  887. % if lib.build == "all":
  888. $(E) "[INSTALL] Installing lib${lib.name}.a"
  889. $(Q) $(INSTALL) -d $(prefix)/lib
  890. $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(prefix)/lib/lib${lib.name}.a
  891. % endif
  892. % endif
  893. % endfor
  894. <%def name="install_shared(lang_filter)">\
  895. % for lib in libs:
  896. % if lib.language == lang_filter:
  897. % if lib.build == "all":
  898. ifeq ($(SYSTEM),MINGW32)
  899. $(E) "[INSTALL] Installing ${lib.name}.$(SHARED_EXT)"
  900. $(Q) $(INSTALL) -d $(prefix)/lib
  901. $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/${lib.name}.$(SHARED_EXT) $(prefix)/lib/${lib.name}.$(SHARED_EXT)
  902. $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}-imp.a $(prefix)/lib/lib${lib.name}-imp.a
  903. else
  904. $(E) "[INSTALL] Installing lib${lib.name}.$(SHARED_EXT)"
  905. $(Q) $(INSTALL) -d $(prefix)/lib
  906. $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.$(SHARED_EXT)
  907. ifneq ($(SYSTEM),Darwin)
  908. $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so.${settings.version.major}
  909. $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so
  910. endif
  911. endif
  912. % endif
  913. % endif
  914. % endfor
  915. ifneq ($(SYSTEM),MINGW32)
  916. ifneq ($(SYSTEM),Darwin)
  917. $(Q) ldconfig || true
  918. endif
  919. endif
  920. </%def>
  921. install-shared_c: shared_c strip-shared_c
  922. ${install_shared("c")}
  923. install-shared_cxx: shared_cxx strip-shared_cxx install-shared_c
  924. ${install_shared("c++")}
  925. install-shared_csharp: shared_csharp strip-shared_csharp
  926. ${install_shared("csharp")}
  927. install-plugins: $(PROTOC_PLUGINS)
  928. ifeq ($(SYSTEM),MINGW32)
  929. $(Q) false
  930. else
  931. $(E) "[INSTALL] Installing grpc protoc plugins"
  932. % for tgt in targets:
  933. % if tgt.build == 'protoc':
  934. $(Q) $(INSTALL) -d $(prefix)/bin
  935. $(Q) $(INSTALL) $(BINDIR)/$(CONFIG)/${tgt.name} $(prefix)/bin/${tgt.name}
  936. % endif
  937. % endfor
  938. endif
  939. install-certs: etc/roots.pem
  940. $(E) "[INSTALL] Installing root certificates"
  941. $(Q) $(INSTALL) -d $(prefix)/share/grpc
  942. $(Q) $(INSTALL) etc/roots.pem $(prefix)/share/grpc/roots.pem
  943. verify-install:
  944. ifeq ($(INSTALL_OK),true)
  945. @echo "Your system looks ready to go."
  946. @echo
  947. else
  948. @echo "We couldn't find protoc 3.0.0+ installed on your system. While this"
  949. @echo "won't prevent grpc from working, you won't be able to compile"
  950. @echo "and run any meaningful code with it."
  951. @echo
  952. @echo
  953. @echo "Please download and install protobuf 3.0.0+ from:"
  954. @echo
  955. @echo " https://github.com/google/protobuf/releases"
  956. @echo
  957. @echo "Once you've done so, or if you think this message is in error,"
  958. @echo "you can re-run this check by doing:"
  959. @echo
  960. @echo " make verify-install"
  961. endif
  962. clean:
  963. $(E) "[CLEAN] Cleaning build directories."
  964. $(Q) $(RM) -rf $(OBJDIR) $(LIBDIR) $(BINDIR) $(GENDIR)
  965. # The various libraries
  966. % for lib in libs:
  967. ${makelib(lib)}
  968. % endfor
  969. # All of the test targets, and protoc plugins
  970. % for tgt in targets:
  971. ${maketarget(tgt)}
  972. % endfor
  973. <%def name="makelib(lib)">
  974. LIB${lib.name.upper()}_SRC = \\
  975. % for src in lib.src:
  976. ${proto_to_cc(src)} \\
  977. % endfor
  978. % if "public_headers" in lib:
  979. % if lib.language == "c++":
  980. PUBLIC_HEADERS_CXX += \\
  981. % else:
  982. PUBLIC_HEADERS_C += \\
  983. % endif
  984. % for hdr in lib.public_headers:
  985. ${hdr} \\
  986. % endfor
  987. % endif
  988. LIB${lib.name.upper()}_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIB${lib.name.upper()}_SRC))))
  989. ## If the library requires OpenSSL with ALPN, let's add some restrictions.
  990. % if lib.get('secure', 'check') == 'yes' or lib.get('secure', 'check') == 'check':
  991. ifeq ($(NO_SECURE),true)
  992. # You can't build secure libraries if you don't have OpenSSL with ALPN.
  993. $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: openssl_dep_error
  994. % if lib.build == "all":
  995. ifeq ($(SYSTEM),MINGW32)
  996. $(LIBDIR)/$(CONFIG)/${lib.name}.$(SHARED_EXT): openssl_dep_error
  997. else
  998. $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT): openssl_dep_error
  999. endif
  1000. % endif
  1001. else
  1002. % if lib.language == 'c++':
  1003. ifeq ($(NO_PROTOBUF),true)
  1004. # You can't build a C++ library if you don't have protobuf - a bit overreached, but still okay.
  1005. $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: protobuf_dep_error
  1006. % if lib.build == "all":
  1007. ifeq ($(SYSTEM),MINGW32)
  1008. $(LIBDIR)/$(CONFIG)/${lib.name}.$(SHARED_EXT): protobuf_dep_error
  1009. else
  1010. $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT): protobuf_dep_error
  1011. endif
  1012. % endif
  1013. else
  1014. % endif
  1015. $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: $(ZLIB_DEP) $(OPENSSL_DEP)\
  1016. ## The else here corresponds to the if secure earlier.
  1017. % else:
  1018. % if lib.language == 'c++':
  1019. ifeq ($(NO_PROTOBUF),true)
  1020. # You can't build a C++ library if you don't have protobuf - a bit overreached, but still okay.
  1021. $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: protobuf_dep_error
  1022. % if lib.build == "all":
  1023. ifeq ($(SYSTEM),MINGW32)
  1024. $(LIBDIR)/$(CONFIG)/${lib.name}.$(SHARED_EXT): protobuf_dep_error
  1025. else
  1026. $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT): protobuf_dep_error
  1027. endif
  1028. % endif
  1029. else
  1030. % endif
  1031. $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: $(ZLIB_DEP)\
  1032. % endif
  1033. % if lib.language == 'c++':
  1034. $(PROTOBUF_DEP)\
  1035. % endif
  1036. $(LIB${lib.name.upper()}_OBJS)
  1037. $(E) "[AR] Creating $@"
  1038. $(Q) mkdir -p `dirname $@`
  1039. $(Q) rm -f $(LIBDIR)/$(CONFIG)/lib${lib.name}.a
  1040. $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(LIB${lib.name.upper()}_OBJS)
  1041. % if lib.get('baselib', False):
  1042. % if lib.get('secure', 'check') == 'yes':
  1043. $(Q) rm -rf tmp-merge-${lib.name}
  1044. $(Q) mkdir tmp-merge-${lib.name}
  1045. $(Q) ( cd tmp-merge-${lib.name} ; $(AR) x ../$(LIBDIR)/$(CONFIG)/lib${lib.name}.a )
  1046. $(Q) for l in $(OPENSSL_MERGE_LIBS) ; do ( cd tmp-merge-${lib.name} ; <%text>ar x ../$${l}</%text> ) ; done
  1047. $(Q) rm -f $(LIBDIR)/$(CONFIG)/lib${lib.name}.a tmp-merge-${lib.name}/__.SYMDEF*
  1048. $(Q) ar rcs $(LIBDIR)/$(CONFIG)/lib${lib.name}.a tmp-merge-${lib.name}/*
  1049. $(Q) rm -rf tmp-merge-${lib.name}
  1050. % endif
  1051. % endif
  1052. ifeq ($(SYSTEM),Darwin)
  1053. $(Q) ranlib $(LIBDIR)/$(CONFIG)/lib${lib.name}.a
  1054. endif
  1055. <%
  1056. if lib.language == 'c++':
  1057. ld = '$(LDXX)'
  1058. else:
  1059. ld = '$(LD)'
  1060. out_base = '$(LIBDIR)/$(CONFIG)/' + lib.name
  1061. out_libbase = '$(LIBDIR)/$(CONFIG)/lib' + lib.name
  1062. common = '$(LIB' + lib.name.upper() + '_OBJS) $(LDLIBS)'
  1063. libs = ''
  1064. lib_deps = ' $(ZLIB_DEP)'
  1065. mingw_libs = ''
  1066. mingw_lib_deps = ' $(ZLIB_DEP)'
  1067. if lib.language == 'c++':
  1068. lib_deps += ' $(PROTOBUF_DEP)'
  1069. mingw_lib_deps += ' $(PROTOBUF_DEP)'
  1070. for dep in lib.get('deps', []):
  1071. libs = libs + ' -l' + dep
  1072. lib_deps = lib_deps + ' $(LIBDIR)/$(CONFIG)/lib' + dep + '.$(SHARED_EXT)'
  1073. mingw_libs = mingw_libs + ' -l' + dep + '-imp'
  1074. mingw_lib_deps = mingw_lib_deps + ' $(LIBDIR)/$(CONFIG)/' + dep + '.$(SHARED_EXT)'
  1075. if lib.get('secure', 'check') == 'yes':
  1076. common = common + ' $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE)'
  1077. for src in lib.src:
  1078. sources_that_need_openssl.add(src)
  1079. else:
  1080. for src in lib.src:
  1081. sources_that_don_t_need_openssl.add(src)
  1082. if lib.get('secure', 'check') == 'yes' or lib.get('secure', 'check') == 'check':
  1083. lib_deps = lib_deps + ' $(OPENSSL_DEP)'
  1084. mingw_lib_deps = mingw_lib_deps + ' $(OPENSSL_DEP)'
  1085. if lib.language == 'c++':
  1086. common = common + ' $(LDLIBSXX) $(LDLIBS_PROTOBUF)'
  1087. %>
  1088. % if lib.build == "all":
  1089. ifeq ($(SYSTEM),MINGW32)
  1090. ${out_base}.$(SHARED_EXT): $(LIB${lib.name.upper()}_OBJS) ${mingw_lib_deps}
  1091. $(E) "[LD] Linking $@"
  1092. $(Q) mkdir -p `dirname $@`
  1093. $(Q) ${ld} $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=${out_base}.def -Wl,--out-implib=${out_libbase}-imp.a -o ${out_base}.$(SHARED_EXT) ${common}${mingw_libs}
  1094. else
  1095. ${out_libbase}.$(SHARED_EXT): $(LIB${lib.name.upper()}_OBJS) ${lib_deps}
  1096. $(E) "[LD] Linking $@"
  1097. $(Q) mkdir -p `dirname $@`
  1098. ifeq ($(SYSTEM),Darwin)
  1099. $(Q) ${ld} $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name lib${lib.name}.$(SHARED_EXT) -dynamiclib -o ${out_libbase}.$(SHARED_EXT) ${common}${libs}
  1100. else
  1101. $(Q) ${ld} $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,lib${lib.name}.so.${settings.version.major} -o ${out_libbase}.$(SHARED_EXT) ${common}${libs}
  1102. $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) ${out_libbase}.so.${settings.version.major}
  1103. $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) ${out_libbase}.so
  1104. endif
  1105. endif
  1106. % endif
  1107. % if lib.get('secure', 'check') == 'yes' or lib.get('secure', 'check') == 'check':
  1108. ## If the lib was secure, we have to close the Makefile's if that tested
  1109. ## the presence of an ALPN-capable OpenSSL.
  1110. endif
  1111. % endif
  1112. % if lib.language == 'c++':
  1113. ## If the lib was C++, we have to close the Makefile's if that tested
  1114. ## the presence of protobuf 3.0.0+
  1115. endif
  1116. % endif
  1117. % if lib.get('secure', 'check') == 'yes' or lib.get('secure', 'check') == 'check':
  1118. ifneq ($(NO_SECURE),true)
  1119. % endif
  1120. ifneq ($(NO_DEPS),true)
  1121. -include $(LIB${lib.name.upper()}_OBJS:.o=.dep)
  1122. endif
  1123. % if lib.get('secure', 'check') == 'yes' or lib.get('secure', 'check') == 'check':
  1124. endif
  1125. % endif
  1126. % for src in lib.src:
  1127. % if not proto_re.match(src) and any(proto_re.match(src2) for src2 in lib.src):
  1128. $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: ${' '.join(proto_to_cc(src2) for src2 in lib.src if proto_re.match(src2))}
  1129. % endif
  1130. % endfor
  1131. </%def>
  1132. <%def name="maketarget(tgt)"><% has_no_sources = not tgt.src %>
  1133. % if not has_no_sources:
  1134. ${tgt.name.upper()}_SRC = \\
  1135. % for src in tgt.src:
  1136. ${proto_to_cc(src)} \\
  1137. % endfor
  1138. ${tgt.name.upper()}_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(${tgt.name.upper()}_SRC))))
  1139. % endif
  1140. % if tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
  1141. ifeq ($(NO_SECURE),true)
  1142. # You can't build secure targets if you don't have OpenSSL with ALPN.
  1143. $(BINDIR)/$(CONFIG)/${tgt.name}: openssl_dep_error
  1144. else
  1145. % endif
  1146. ##
  1147. ## We're not trying to add a dependency on building zlib and openssl here,
  1148. ## as it's already done in the libraries. We're assuming that the build
  1149. ## trickles down, and that a secure target requires a secure version of
  1150. ## a library.
  1151. ##
  1152. ## That simplifies the codegen a bit, but prevents a fully defined Makefile.
  1153. ## I can live with that.
  1154. ##
  1155. % if tgt.build == 'protoc' or tgt.language == 'c++':
  1156. ifeq ($(NO_PROTOBUF),true)
  1157. # You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
  1158. $(BINDIR)/$(CONFIG)/${tgt.name}: protobuf_dep_error
  1159. else
  1160. $(BINDIR)/$(CONFIG)/${tgt.name}: \
  1161. % if not has_no_sources:
  1162. $(PROTOBUF_DEP) $(${tgt.name.upper()}_OBJS)\
  1163. % endif
  1164. % else:
  1165. $(BINDIR)/$(CONFIG)/${tgt.name}: \
  1166. % if not has_no_sources:
  1167. $(${tgt.name.upper()}_OBJS)\
  1168. % endif
  1169. % endif
  1170. % for dep in tgt.deps:
  1171. $(LIBDIR)/$(CONFIG)/lib${dep}.a\
  1172. % endfor
  1173. % if tgt.language == "c++":
  1174. ## C++ targets specificies.
  1175. % if tgt.build == 'protoc':
  1176. $(E) "[HOSTLD] Linking $@"
  1177. $(Q) mkdir -p `dirname $@`
  1178. $(Q) $(HOST_LDXX) $(HOST_LDFLAGS) \
  1179. % if not has_no_sources:
  1180. $(${tgt.name.upper()}_OBJS)\
  1181. % endif
  1182. % else:
  1183. $(E) "[LD] Linking $@"
  1184. $(Q) mkdir -p `dirname $@`
  1185. $(Q) $(LDXX) $(LDFLAGS) \
  1186. % if not has_no_sources:
  1187. $(${tgt.name.upper()}_OBJS)\
  1188. % endif
  1189. % endif
  1190. % else:
  1191. ## C-only targets specificities.
  1192. $(E) "[LD] Linking $@"
  1193. $(Q) mkdir -p `dirname $@`
  1194. $(Q) $(LD) $(LDFLAGS) \
  1195. % if not has_no_sources:
  1196. $(${tgt.name.upper()}_OBJS)\
  1197. % endif
  1198. % endif
  1199. % for dep in tgt.deps:
  1200. $(LIBDIR)/$(CONFIG)/lib${dep}.a\
  1201. % endfor
  1202. % if tgt.language == "c++":
  1203. % if tgt.build == 'protoc':
  1204. $(HOST_LDLIBSXX) $(HOST_LDLIBS_PROTOC)\
  1205. % else:
  1206. $(LDLIBSXX) $(LDLIBS_PROTOBUF)\
  1207. % endif
  1208. % endif
  1209. % if tgt.build == 'protoc':
  1210. $(HOST_LDLIBS)\
  1211. % else:
  1212. $(LDLIBS)\
  1213. % endif
  1214. % if tgt.build == 'protoc':
  1215. $(HOST_LDLIBS_PROTOC)\
  1216. % elif tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
  1217. $(LDLIBS_SECURE)\
  1218. % endif
  1219. % if tgt.language == 'c++' and tgt.build == 'test':
  1220. $(GTEST_LIB)\
  1221. % elif tgt.language == 'c++' and tgt.build == 'benchmark':
  1222. $(GTEST_LIB)\
  1223. % endif
  1224. -o $(BINDIR)/$(CONFIG)/${tgt.name}
  1225. % if tgt.build == 'protoc' or tgt.language == 'c++':
  1226. endif
  1227. % endif
  1228. % if tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
  1229. endif
  1230. % endif
  1231. % for src in tgt.src:
  1232. $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: \
  1233. % for dep in tgt.deps:
  1234. $(LIBDIR)/$(CONFIG)/lib${dep}.a\
  1235. % endfor
  1236. % endfor
  1237. % if not has_no_sources:
  1238. deps_${tgt.name}: $(${tgt.name.upper()}_OBJS:.o=.dep)
  1239. % endif
  1240. % if not has_no_sources:
  1241. % if tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
  1242. ifneq ($(NO_SECURE),true)
  1243. % endif
  1244. ifneq ($(NO_DEPS),true)
  1245. -include $(${tgt.name.upper()}_OBJS:.o=.dep)
  1246. endif
  1247. % if tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
  1248. endif
  1249. % endif
  1250. % endif
  1251. </%def>
  1252. ifneq ($(OPENSSL_DEP),)
  1253. # This is to ensure the embedded OpenSSL is built beforehand, properly
  1254. # installing headers to their final destination on the drive. We need this
  1255. # otherwise parallel compilation will fail if a source is compiled first.
  1256. % for src in sorted(sources_that_need_openssl):
  1257. % if src not in sources_that_don_t_need_openssl:
  1258. ${src}: $(OPENSSL_DEP)
  1259. % endif
  1260. % endfor
  1261. endif
  1262. .PHONY: all strip tools \
  1263. dep_error openssl_dep_error openssl_dep_message git_update stop \
  1264. buildtests buildtests_c buildtests_cxx \
  1265. test test_c test_cxx \
  1266. install install_c install_cxx \
  1267. install-headers install-headers_c install-headers_cxx \
  1268. install-shared install-shared_c install-shared_cxx \
  1269. install-static install-static_c install-static_cxx \
  1270. strip strip-shared strip-static \
  1271. strip_c strip-shared_c strip-static_c \
  1272. strip_cxx strip-shared_cxx strip-static_cxx \
  1273. dep_c dep_cxx bins_dep_c bins_dep_cxx \
  1274. clean