blob: 3350f18d66cd9964eb3f0a279a9c58cd8a8cfca2 [file] [log] [blame]
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08001# GRPC global makefile
2# This currently builds C and C++ code.
3<%!
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08004 import re
5
nnoblec87b1c52015-01-05 17:15:18 -08006 proto_re = re.compile('(.*)\\.proto')
nnoble72309c62014-12-12 11:42:26 -08007
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -08008 def excluded(filename, exclude_res):
9 for r in exclude_res:
10 if r.match(filename):
11 return True
12 return False
nnoble72309c62014-12-12 11:42:26 -080013
14 def proto_to_cc(filename):
15 m = proto_re.match(filename)
16 if not m:
17 return filename
18 return 'gens/' + m.group(1) + '.pb.cc'
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -080019%>
20
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -080021# General settings.
22# You may want to change these depending on your system.
23
24prefix ?= /usr/local
25
26PROTOC = protoc
27CC = gcc
28CXX = g++
29LD = gcc
30LDXX = g++
31AR = ar
32STRIP = strip --strip-unneeded
33INSTALL = install -D
34RM = rm -f
35
nnoble72309c62014-12-12 11:42:26 -080036HOST_CC = $(CC)
37HOST_CXX = $(CXX)
38HOST_LD = $(LD)
39HOST_LDXX = $(LDXX)
40
ctillercab52e72015-01-06 13:10:23 -080041CONFIG ?= opt
42
43VALID_CONFIG_opt = 1
44CPPFLAGS_opt = -O2
45DEFINES_opt = NDEBUG
46
47VALID_CONFIG_dbg = 1
48CPPFLAGS_dbg = -O0
49DEFINES_dbg = _DEBUG DEBUG
50
51ifndef VALID_CONFIG_$(CONFIG)
52$(error Invalid CONFIG value '$(CONFIG)')
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -080053endif
54
ctillercab52e72015-01-06 13:10:23 -080055CPPFLAGS += $(CPPFLAGS_$(CONFIG))
56DEFINES += $(DEFINES_$(CONFIG))
57
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -080058CFLAGS += -std=c89 -pedantic
59CXXFLAGS += -std=c++11
60CPPFLAGS += -g -fPIC -Wall -Werror -Wno-long-long
61LDFLAGS += -g -pthread -fPIC
62
63INCLUDES = . include gens
64LIBS = rt m z event event_pthreads pthread
65LIBSXX = protobuf
nnoblec78b3402014-12-11 16:06:57 -080066LIBS_PROTOC = protoc protobuf
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -080067
68ifneq ($(wildcard /usr/src/gtest/src/gtest-all.cc),)
69GTEST_LIB = /usr/src/gtest/src/gtest-all.cc -I/usr/src/gtest
70else
71GTEST_LIB = -lgtest
72endif
chenwa8fd44a2014-12-10 15:13:55 -080073GTEST_LIB += -lgflags
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -080074ifeq ($(V),1)
75E = @:
76Q =
77else
78E = @echo
79Q = @
80endif
81
82VERSION = ${settings.version.major}.${settings.version.minor}.${settings.version.micro}.${settings.version.build}
83
84CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
85CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
86
87LDFLAGS += $(ARCH_FLAGS)
88LDLIBS += $(addprefix -l, $(LIBS))
89LDLIBSXX += $(addprefix -l, $(LIBSXX))
nnoble72309c62014-12-12 11:42:26 -080090HOST_LDLIBS_PROTOC += $(addprefix -l, $(LIBS_PROTOC))
91
92HOST_CPPFLAGS = $(CPPFLAGS)
93HOST_CFLAGS = $(CFLAGS)
94HOST_CXXFLAGS = $(CXXFLAGS)
95HOST_LDFLAGS = $(LDFLAGS)
96HOST_LDLIBS = $(LDLIBS)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -080097
nnoble69ac39f2014-12-12 15:43:38 -080098
99# These are automatically computed variables.
100# There shouldn't be any need to change anything from now on.
101
102HOST_SYSTEM = $(shell uname | cut -f 1 -d_)
103ifeq ($(SYSTEM),)
104SYSTEM = $(HOST_SYSTEM)
105endif
106
nnoble5b7f32a2014-12-22 08:12:44 -0800107ifeq ($(SYSTEM),MINGW32)
108SHARED_EXT = dll
109endif
110ifeq ($(SYSTEM),Darwin)
111SHARED_EXT = dylib
112endif
113ifeq ($(SHARED_EXT),)
114SHARED_EXT = so.$(VERSION)
115endif
116
nnoble69ac39f2014-12-12 15:43:38 -0800117ifeq ($(wildcard .git),)
118IS_GIT_FOLDER = false
119else
120IS_GIT_FOLDER = true
121endif
122
123EVENT2_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o /dev/null test/build/event2.c -levent $(LDFLAGS)
nnoble7e012cf2014-12-22 17:53:44 -0800124OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o /dev/null test/build/openssl-alpn.c -lssl -lcrypto -ldl $(LDFLAGS)
125ZLIB_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o /dev/null test/build/zlib.c -lz $(LDFLAGS)
nnoble69ac39f2014-12-12 15:43:38 -0800126
nnoble60825402014-12-15 14:43:51 -0800127HAS_SYSTEM_EVENT2 = $(shell $(EVENT2_CHECK_CMD) 2> /dev/null && echo true || echo false)
128HAS_SYSTEM_OPENSSL_ALPN = $(shell $(OPENSSL_ALPN_CHECK_CMD) 2> /dev/null && echo true || echo false)
129HAS_SYSTEM_ZLIB = $(shell $(ZLIB_CHECK_CMD) 2> /dev/null && echo true || echo false)
nnoble69ac39f2014-12-12 15:43:38 -0800130
131ifeq ($(wildcard third_party/libevent/include/event2/event.h),)
132HAS_EMBEDDED_EVENT2 = false
133else
134HAS_EMBEDDED_EVENT2 = true
135endif
136
137ifeq ($(wildcard third_party/openssl/ssl/ssl.h),)
138HAS_EMBEDDED_OPENSSL_ALPN = false
139else
140HAS_EMBEDDED_OPENSSL_ALPN = true
141endif
142
143ifeq ($(wildcard third_party/zlib/zlib.h),)
144HAS_EMBEDDED_ZLIB = false
145else
146HAS_EMBEDDED_ZLIB = true
147endif
148
149ifneq ($(SYSTEM),MINGW32)
150ifeq ($(HAS_SYSTEM_EVENT2),false)
151DEP_MISSING += libevent
152endif
153endif
154
155ifeq ($(HAS_SYSTEM_ZLIB),false)
156ifeq ($(HAS_EMBEDDED_ZLIB),true)
157ZLIB_DEP = third_party/zlib/libz.a
158CPPFLAGS += -Ithird_party/zlib
159LDFLAGS += -Lthird_party/zlib
160else
161DEP_MISSING += zlib
162endif
163endif
164
165ifeq ($(HAS_SYSTEM_OPENSSL_ALPN),false)
166ifeq ($(HAS_EMBEDDED_OPENSSL_ALPN),true)
167OPENSSL_DEP = third_party/openssl/libssl.a
nnoble20e2e3f2014-12-16 15:37:57 -0800168OPENSSL_MERGE_LIBS += third_party/openssl/libssl.a third_party/openssl/libcrypto.a
nnoble69ac39f2014-12-12 15:43:38 -0800169CPPFLAGS += -Ithird_party/openssl/include
170LDFLAGS += -Lthird_party/openssl
nnoble5b7f32a2014-12-22 08:12:44 -0800171LIBS_SECURE = dl
nnoble69ac39f2014-12-12 15:43:38 -0800172else
173NO_SECURE = true
174endif
nnoble5b7f32a2014-12-22 08:12:44 -0800175else
176LIBS_SECURE = ssl crypto dl
nnoble69ac39f2014-12-12 15:43:38 -0800177endif
178
nnoble5b7f32a2014-12-22 08:12:44 -0800179LDLIBS_SECURE += $(addprefix -l, $(LIBS_SECURE))
180
nnoble69ac39f2014-12-12 15:43:38 -0800181ifneq ($(DEP_MISSING),)
182NO_DEPS = true
183endif
184
185ifneq ($(MAKECMDGOALS),clean)
186NO_DEPS = true
187endif
188
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800189.SECONDARY = %.pb.h %.pb.cc
190
nnoble69ac39f2014-12-12 15:43:38 -0800191ifeq ($(DEP_MISSING),)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800192all: static shared\
193% for tgt in targets:
194% if tgt.build == 'all':
ctillercab52e72015-01-06 13:10:23 -0800195 bins/$(CONFIG)/${tgt.name}\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800196% endif
197% endfor
198
nnoble69ac39f2014-12-12 15:43:38 -0800199dep_error:
200 @echo "You shouldn't see this message - all of your dependencies are correct."
201else
202all: dep_error git_update stop
203
204dep_error:
205 @echo
206 @echo "DEPENDENCY ERROR"
207 @echo
208 @echo "You are missing system dependencies that are essential to build grpc,"
209 @echo "and the third_party directory doesn't have them:"
210 @echo
211 @echo " $(DEP_MISSING)"
212 @echo
213 @echo "Installing the development packages for your system will solve"
214 @echo "this issue. Please consult INSTALL to get more information."
215 @echo
216 @echo "If you need information about why these tests failed, run:"
217 @echo
218 @echo " make run_dep_checks"
219 @echo
220endif
221
222git_update:
223ifeq ($(IS_GIT_FOLDER),true)
224 @echo "Additionally, since you are in a git clone, you can download the"
225 @echo "missing dependencies in third_party by running the following command:"
226 @echo
ctiller64f29102014-12-15 10:40:59 -0800227 @echo " git submodule update --init"
nnoble69ac39f2014-12-12 15:43:38 -0800228 @echo
229endif
230
231openssl_dep_error: openssl_dep_message git_update stop
232
233openssl_dep_message:
234 @echo
235 @echo "DEPENDENCY ERROR"
236 @echo
237 @echo "The target you are trying to run requires OpenSSL with ALPN support."
238 @echo "Your system doesn't have it, and neither does the third_party directory."
239 @echo
240 @echo "Please consult INSTALL to get more information."
241 @echo
242 @echo "If you need information about why these tests failed, run:"
243 @echo
244 @echo " make run_dep_checks"
245 @echo
246
247stop:
248 @false
249
ctiller09cb6d52014-12-19 17:38:22 -0800250% for tgt in targets:
ctillercab52e72015-01-06 13:10:23 -0800251${tgt.name}: bins/$(CONFIG)/${tgt.name}
ctiller09cb6d52014-12-19 17:38:22 -0800252% endfor
253
nnoble69ac39f2014-12-12 15:43:38 -0800254run_dep_checks:
255 $(EVENT2_CHECK_CMD) || true
256 $(OPENSSL_ALPN_CHECK_CMD) || true
257 $(ZLIB_CHECK_CMD) || true
258
259third_party/zlib/libz.a:
260 (cd third_party/zlib ; CFLAGS="-fPIC -fvisibility=hidden" ./configure --static)
261 $(MAKE) -C third_party/zlib
262
263third_party/openssl/libssl.a:
264 (cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden" ./config)
265 $(MAKE) -C third_party/openssl build_crypto build_ssl
266
nnoble29e1d292014-12-01 10:27:40 -0800267static: static_c static_cxx
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800268
nnoble85a49262014-12-08 18:14:03 -0800269static_c: dep_c\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800270% for lib in libs:
nnoble29e1d292014-12-01 10:27:40 -0800271% if lib.build == 'all' and not lib.get('c++', False):
ctillercab52e72015-01-06 13:10:23 -0800272 libs/$(CONFIG)/lib${lib.name}.a\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800273% endif
274% endfor
275
276
nnoble85a49262014-12-08 18:14:03 -0800277static_cxx: dep_cxx\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800278% for lib in libs:
nnoble29e1d292014-12-01 10:27:40 -0800279% if lib.build == 'all' and lib.get('c++', False):
ctillercab52e72015-01-06 13:10:23 -0800280 libs/$(CONFIG)/lib${lib.name}.a\
nnoble29e1d292014-12-01 10:27:40 -0800281% endif
282% endfor
283
284
285shared: shared_c shared_cxx
286
nnoble85a49262014-12-08 18:14:03 -0800287shared_c: dep_c\
nnoble29e1d292014-12-01 10:27:40 -0800288% for lib in libs:
289% if lib.build == 'all' and not lib.get('c++', False):
ctillercab52e72015-01-06 13:10:23 -0800290 libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800291% endif
292% endfor
293
294
nnoble85a49262014-12-08 18:14:03 -0800295shared_cxx: dep_cxx\
nnoble29e1d292014-12-01 10:27:40 -0800296% for lib in libs:
297% if lib.build == 'all' and lib.get('c++', False):
ctillercab52e72015-01-06 13:10:23 -0800298 libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\
nnoble29e1d292014-12-01 10:27:40 -0800299% endif
300% endfor
301
302
303privatelibs: privatelibs_c privatelibs_cxx
304
nnoble85a49262014-12-08 18:14:03 -0800305privatelibs_c: dep_c\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800306% for lib in libs:
307% if lib.build == 'private':
ctillercab52e72015-01-06 13:10:23 -0800308 libs/$(CONFIG)/lib${lib.name}.a\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800309% endif
310% endfor
311
312
nnoble85a49262014-12-08 18:14:03 -0800313privatelibs_cxx: dep_cxx\
nnoble29e1d292014-12-01 10:27:40 -0800314% for lib in libs:
315% if lib.build == 'private':
ctillercab52e72015-01-06 13:10:23 -0800316 libs/$(CONFIG)/lib${lib.name}.a\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800317% endif
318% endfor
319
320
nnoble29e1d292014-12-01 10:27:40 -0800321buildtests: buildtests_c buildtests_cxx
322
nnoblebba76922014-12-15 13:27:38 -0800323buildtests_c: bins_dep_c privatelibs_c\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800324% for tgt in targets:
325% if tgt.build == 'test' and not tgt.get('c++', False):
ctillercab52e72015-01-06 13:10:23 -0800326 bins/$(CONFIG)/${tgt.name}\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800327% endif
328% endfor
329
330
nnoblebba76922014-12-15 13:27:38 -0800331buildtests_cxx: bins_dep_cxx privatelibs_cxx\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800332% for tgt in targets:
nnoble29e1d292014-12-01 10:27:40 -0800333% if tgt.build == 'test' and tgt.get('c++', False):
334 bins/${tgt.name}\
335% endif
336% endfor
337
338
nnoble85a49262014-12-08 18:14:03 -0800339test: test_c test_cxx
nnoble29e1d292014-12-01 10:27:40 -0800340
nnoble85a49262014-12-08 18:14:03 -0800341test_c: buildtests_c
nnoble29e1d292014-12-01 10:27:40 -0800342% for tgt in targets:
343% if tgt.build == 'test' and tgt.get('run', True) and not tgt.get('c++', False):
344 $(E) "[RUN] Testing ${tgt.name}"
ctillercab52e72015-01-06 13:10:23 -0800345 $(Q) ./bins/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 )
nnoble29e1d292014-12-01 10:27:40 -0800346% endif
347% endfor
348
349
nnoble85a49262014-12-08 18:14:03 -0800350test_cxx: buildtests_cxx
nnoble29e1d292014-12-01 10:27:40 -0800351% for tgt in targets:
352% if tgt.build == 'test' and tgt.get('run', True) and tgt.get('c++', False):
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800353 $(E) "[RUN] Testing ${tgt.name}"
ctillercab52e72015-01-06 13:10:23 -0800354 $(Q) ./bins/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 )
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800355% endif
356% endfor
357
358
359tools: privatelibs\
360% for tgt in targets:
361% if tgt.build == 'tool':
ctillercab52e72015-01-06 13:10:23 -0800362 bins/$(CONFIG)/${tgt.name}\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800363% endif
364% endfor
365
366
nnobleebebb7e2014-12-10 16:31:01 -0800367protoc_plugins:\
368% for tgt in targets:
369% if tgt.build == 'protoc':
ctillercab52e72015-01-06 13:10:23 -0800370 bins/$(CONFIG)/${tgt.name}\
nnobleebebb7e2014-12-10 16:31:01 -0800371% endif
372% endfor
373
374
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800375buildbenchmarks: privatelibs\
376% for tgt in targets:
377% if tgt.build == 'benchmark':
ctillercab52e72015-01-06 13:10:23 -0800378 bins/$(CONFIG)/${tgt.name}\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800379% endif
380% endfor
381
382
383benchmarks: buildbenchmarks
384
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800385strip: strip-static strip-shared
386
nnoble20e2e3f2014-12-16 15:37:57 -0800387strip-static: strip-static_c strip-static_cxx
388
389strip-shared: strip-shared_c strip-shared_cxx
390
nnoble85a49262014-12-08 18:14:03 -0800391strip-static_c: static_c
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800392% for lib in libs:
nnoble85a49262014-12-08 18:14:03 -0800393% if not lib.get("c++", False):
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800394% if lib.build == "all":
395 $(E) "[STRIP] Stripping lib${lib.name}.a"
ctillercab52e72015-01-06 13:10:23 -0800396 $(Q) $(STRIP) libs/$(CONFIG)/lib${lib.name}.a
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800397% endif
nnoble85a49262014-12-08 18:14:03 -0800398% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800399% endfor
400
nnoble85a49262014-12-08 18:14:03 -0800401strip-static_cxx: static_cxx
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800402% for lib in libs:
nnoble85a49262014-12-08 18:14:03 -0800403% if lib.get("c++", False):
404% if lib.build == "all":
405 $(E) "[STRIP] Stripping lib${lib.name}.a"
ctillercab52e72015-01-06 13:10:23 -0800406 $(Q) $(STRIP) libs/$(CONFIG)/lib${lib.name}.a
nnoble85a49262014-12-08 18:14:03 -0800407% endif
408% endif
409% endfor
410
411strip-shared_c: shared_c
412% for lib in libs:
413% if not lib.get("c++", False):
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800414% if lib.build == "all":
415 $(E) "[STRIP] Stripping lib${lib.name}.so"
ctillercab52e72015-01-06 13:10:23 -0800416 $(Q) $(STRIP) libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800417% endif
nnoble85a49262014-12-08 18:14:03 -0800418% endif
419% endfor
420
421strip-shared_cxx: shared_cxx
422% for lib in libs:
423% if lib.get("c++", False):
424% if lib.build == "all":
425 $(E) "[STRIP] Stripping lib${lib.name}.so"
ctillercab52e72015-01-06 13:10:23 -0800426 $(Q) $(STRIP) libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)
nnoble85a49262014-12-08 18:14:03 -0800427% endif
428% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800429% endfor
430
nnoble72309c62014-12-12 11:42:26 -0800431% for p in protos:
ctillercab52e72015-01-06 13:10:23 -0800432deps/$(CONFIG)/gens/${p}.pb.dep:
nnoble72309c62014-12-12 11:42:26 -0800433 $(Q) mkdir -p `dirname $@`
434 $(Q) touch $@
435
436gens/${p}.pb.cc: ${p}.proto protoc_plugins
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800437 $(E) "[PROTOC] Generating protobuf CC file from $<"
438 $(Q) mkdir -p `dirname $@`
ctillercab52e72015-01-06 13:10:23 -0800439 $(Q) $(PROTOC) --cpp_out=gens --grpc_out=gens --plugin=protoc-gen-grpc=bins/$(CONFIG)/cpp_plugin $<
nnoble72309c62014-12-12 11:42:26 -0800440
441% endfor
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800442
ctillercab52e72015-01-06 13:10:23 -0800443deps/$(CONFIG)/%.dep : %.c
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800444 $(E) "[DEP] Generating dependencies for $<"
445 $(Q) mkdir -p `dirname $@`
446 $(Q) $(CC) $(CFLAGS) $(CPPFLAGS_NO_ARCH) -MG -M $< > $@
447
ctillercab52e72015-01-06 13:10:23 -0800448deps/$(CONFIG)/%.dep : %.cc
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800449 $(E) "[DEP] Generating dependencies for $<"
450 $(Q) mkdir -p `dirname $@`
451 $(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS_NO_ARCH) -MG -M $< > $@
452
ctillercab52e72015-01-06 13:10:23 -0800453objs/$(CONFIG)/%.o : %.c
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800454 $(E) "[C] Compiling $<"
455 $(Q) mkdir -p `dirname $@`
456 $(Q) $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
457
ctillercab52e72015-01-06 13:10:23 -0800458objs/$(CONFIG)/%.o : gens/%.pb.cc
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800459 $(E) "[CXX] Compiling $<"
460 $(Q) mkdir -p `dirname $@`
461 $(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
462
ctillercab52e72015-01-06 13:10:23 -0800463objs/$(CONFIG)/src/compiler/%.o : src/compiler/%.cc
nnoble72309c62014-12-12 11:42:26 -0800464 $(E) "[HOSTCXX] Compiling $<"
465 $(Q) mkdir -p `dirname $@`
466 $(Q) $(HOST_CXX) $(HOST_CXXFLAGS) $(HOST_CPPFLAGS) -c -o $@ $<
467
ctillercab52e72015-01-06 13:10:23 -0800468objs/$(CONFIG)/%.o : %.cc
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800469 $(E) "[CXX] Compiling $<"
470 $(Q) mkdir -p `dirname $@`
471 $(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
472
nnoble0c475f02014-12-05 15:37:39 -0800473dep: dep_c dep_cxx
474
475dep_c:\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800476% for lib in libs:
nnoble0c475f02014-12-05 15:37:39 -0800477% if not lib.get('c++', False):
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800478 deps_lib${lib.name}\
nnoble0c475f02014-12-05 15:37:39 -0800479% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800480% endfor
nnoble69ac39f2014-12-12 15:43:38 -0800481
482
483bins_dep_c:\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800484% for tgt in targets:
nnoble0c475f02014-12-05 15:37:39 -0800485% if not tgt.get('c++', False):
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800486 deps_${tgt.name}\
nnoble0c475f02014-12-05 15:37:39 -0800487% endif
488% endfor
489
490
491dep_cxx:\
492% for lib in libs:
493% if lib.get('c++', False):
494 deps_lib${lib.name}\
495% endif
496% endfor
nnoble69ac39f2014-12-12 15:43:38 -0800497
498
499bins_dep_cxx:\
nnoble0c475f02014-12-05 15:37:39 -0800500% for tgt in targets:
501% if tgt.get('c++', False):
502 deps_${tgt.name}\
503% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800504% endfor
505
506
nnoble85a49262014-12-08 18:14:03 -0800507install: install_c install_cxx
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800508
nnoble85a49262014-12-08 18:14:03 -0800509install_c: install-headers_c install-static_c install-shared_c
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800510
nnoble85a49262014-12-08 18:14:03 -0800511install_cxx: install-headers_cxx install-static_cxx install-shared_cxx
512
513install-headers: install-headers_c install-headers_cxx
514
515install-headers_c:
516 $(E) "[INSTALL] Installing public C headers"
517 $(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
518
519install-headers_cxx:
520 $(E) "[INSTALL] Installing public C++ headers"
521 $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
522
523install-static: install-static_c install-static_cxx
524
525install-static_c: static_c strip-static_c
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800526% for lib in libs:
nnoble85a49262014-12-08 18:14:03 -0800527% if not lib.get("c++", False):
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800528% if lib.build == "all":
529 $(E) "[INSTALL] Installing lib${lib.name}.a"
ctillercab52e72015-01-06 13:10:23 -0800530 $(Q) $(INSTALL) libs/$(CONFIG)/lib${lib.name}.a $(prefix)/lib/lib${lib.name}.a
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800531% endif
nnoble85a49262014-12-08 18:14:03 -0800532% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800533% endfor
534
nnoble85a49262014-12-08 18:14:03 -0800535install-static_cxx: static_cxx strip-static_cxx
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800536% for lib in libs:
nnoble85a49262014-12-08 18:14:03 -0800537% if lib.get("c++", False):
538% if lib.build == "all":
539 $(E) "[INSTALL] Installing lib${lib.name}.a"
ctillercab52e72015-01-06 13:10:23 -0800540 $(Q) $(INSTALL) libs/$(CONFIG)/lib${lib.name}.a $(prefix)/lib/lib${lib.name}.a
nnoble85a49262014-12-08 18:14:03 -0800541% endif
542% endif
543% endfor
544
545install-shared_c: shared_c strip-shared_c
546% for lib in libs:
547% if not lib.get("c++", False):
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800548% if lib.build == "all":
nnoble5b7f32a2014-12-22 08:12:44 -0800549ifeq ($(SYSTEM),MINGW32)
550 $(E) "[INSTALL] Installing ${lib.name}.$(SHARED_EXT)"
ctillercab52e72015-01-06 13:10:23 -0800551 $(Q) $(INSTALL) libs/$(CONFIG)/${lib.name}.$(SHARED_EXT) $(prefix)/lib/${lib.name}.$(SHARED_EXT)
552 $(Q) $(INSTALL) libs/$(CONFIG)/lib${lib.name}-imp.a $(prefix)/lib/lib${lib.name}-imp.a
nnoble5b7f32a2014-12-22 08:12:44 -0800553else
554 $(E) "[INSTALL] Installing lib${lib.name}.$(SHARED_EXT)"
ctillercab52e72015-01-06 13:10:23 -0800555 $(Q) $(INSTALL) libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.$(SHARED_EXT)
nnoble5b7f32a2014-12-22 08:12:44 -0800556ifneq ($(SYSTEM),Darwin)
557 $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so
558endif
559endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800560% endif
nnoble85a49262014-12-08 18:14:03 -0800561% endif
562% endfor
nnoble5b7f32a2014-12-22 08:12:44 -0800563ifneq ($(SYSTEM),MINGW32)
564ifneq ($(SYSTEM),Darwin)
565 $(Q) ldconfig
566endif
567endif
nnoble85a49262014-12-08 18:14:03 -0800568
569install-shared_cxx: shared_cxx strip-shared_cxx
570% for lib in libs:
571% if lib.get("c++", False):
572% if lib.build == "all":
nnoble5b7f32a2014-12-22 08:12:44 -0800573ifeq ($(SYSTEM),MINGW32)
574 $(E) "[INSTALL] Installing ${lib.name}.$(SHARED_EXT)"
ctillercab52e72015-01-06 13:10:23 -0800575 $(Q) $(INSTALL) libs/$(CONFIG)/${lib.name}.$(SHARED_EXT) $(prefix)/lib/${lib.name}.$(SHARED_EXT)
576 $(Q) $(INSTALL) libs/$(CONFIG)/lib${lib.name}-imp.a $(prefix)/lib/lib${lib.name}-imp.a
nnoble5b7f32a2014-12-22 08:12:44 -0800577else
578 $(E) "[INSTALL] Installing lib${lib.name}.$(SHARED_EXT)"
ctillercab52e72015-01-06 13:10:23 -0800579 $(Q) $(INSTALL) libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.$(SHARED_EXT)
nnoble5b7f32a2014-12-22 08:12:44 -0800580ifneq ($(SYSTEM),Darwin)
581 $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so
582endif
583endif
nnoble85a49262014-12-08 18:14:03 -0800584% endif
585% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800586% endfor
nnoble5b7f32a2014-12-22 08:12:44 -0800587ifneq ($(SYSTEM),MINGW32)
588ifneq ($(SYSTEM),Darwin)
589 $(Q) ldconfig
590endif
591endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800592
593clean:\
594% for lib in libs:
595 clean_lib${lib.name}\
596% endfor
597% for tgt in targets:
598 clean_${tgt.name}\
599% endfor
600
601 $(Q) $(RM) -r deps objs libs bins gens
602
603
604# The various libraries
605
606% for lib in libs:
607${makelib(lib)}
608% endfor
609
610
nnoble69ac39f2014-12-12 15:43:38 -0800611# All of the test targets, and protoc plugins
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800612
613% for tgt in targets:
614${maketarget(tgt)}
615% endfor
616
617<%def name="makelib(lib)">
618LIB${lib.name.upper()}_SRC = \\
619
620% for src in lib.src:
nnoble72309c62014-12-12 11:42:26 -0800621 ${proto_to_cc(src)} \\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800622
623% endfor
624
625% if "public_headers" in lib:
nnoble85a49262014-12-08 18:14:03 -0800626% if lib.get("c++", False):
627PUBLIC_HEADERS_CXX += \\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800628
nnoble85a49262014-12-08 18:14:03 -0800629% else:
630PUBLIC_HEADERS_C += \\
631
632% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800633% for hdr in lib.public_headers:
634 ${hdr} \\
635
636% endfor
637% endif
638
ctillercab52e72015-01-06 13:10:23 -0800639LIB${lib.name.upper()}_OBJS = $(addprefix objs/$(CONFIG)/, $(addsuffix .o, $(basename $(LIB${lib.name.upper()}_SRC))))
640LIB${lib.name.upper()}_DEPS = $(addprefix deps/$(CONFIG)/, $(addsuffix .dep, $(basename $(LIB${lib.name.upper()}_SRC))))
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800641
nnoble69ac39f2014-12-12 15:43:38 -0800642% if lib.get('secure', True):
nnoble69ac39f2014-12-12 15:43:38 -0800643ifeq ($(NO_SECURE),true)
644
ctillercab52e72015-01-06 13:10:23 -0800645libs/$(CONFIG)/lib${lib.name}.a: openssl_dep_error
nnoble69ac39f2014-12-12 15:43:38 -0800646
nnoble5b7f32a2014-12-22 08:12:44 -0800647% if lib.build == "all":
648ifeq ($(SYSTEM),MINGW32)
ctillercab52e72015-01-06 13:10:23 -0800649libs/$(CONFIG)/${lib.name}.$(SHARED_EXT): openssl_dep_error
nnoble5b7f32a2014-12-22 08:12:44 -0800650else
ctillercab52e72015-01-06 13:10:23 -0800651libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT): openssl_dep_error
nnoble5b7f32a2014-12-22 08:12:44 -0800652endif
653% endif
654
nnoble69ac39f2014-12-12 15:43:38 -0800655else
656
ctillercab52e72015-01-06 13:10:23 -0800657libs/$(CONFIG)/lib${lib.name}.a: $(OPENSSL_DEP) $(LIB${lib.name.upper()}_OBJS)
nnoble20e2e3f2014-12-16 15:37:57 -0800658% else:
ctillercab52e72015-01-06 13:10:23 -0800659libs/$(CONFIG)/lib${lib.name}.a: $(LIB${lib.name.upper()}_OBJS)
nnoble20e2e3f2014-12-16 15:37:57 -0800660% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800661 $(E) "[AR] Creating $@"
nnoble85a49262014-12-08 18:14:03 -0800662 $(Q) mkdir -p `dirname $@`
ctillercab52e72015-01-06 13:10:23 -0800663 $(Q) $(AR) rcs libs/$(CONFIG)/lib${lib.name}.a $(LIB${lib.name.upper()}_OBJS)
nnoble20e2e3f2014-12-16 15:37:57 -0800664% if lib.get('baselib', False):
665% if lib.get('secure', True):
666 $(Q) mkdir tmp-merge
ctillercab52e72015-01-06 13:10:23 -0800667 $(Q) ( cd tmp-merge ; $(AR) x ../libs/$(CONFIG)/lib${lib.name}.a )
nnoble20e2e3f2014-12-16 15:37:57 -0800668 $(Q) for l in $(OPENSSL_MERGE_LIBS) ; do ( cd tmp-merge ; <%text>ar x ../$${l}</%text> ) ; done
ctillercab52e72015-01-06 13:10:23 -0800669 $(Q) rm -f libs/$(CONFIG)/lib${lib.name}.a tmp-merge/__.SYMDEF*
670 $(Q) ar rcs libs/$(CONFIG)/lib${lib.name}.a tmp-merge/*
nnoble20e2e3f2014-12-16 15:37:57 -0800671 $(Q) rm -rf tmp-merge
672% endif
673% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800674
nnoble5b7f32a2014-12-22 08:12:44 -0800675<%
676 if lib.get('c++', False):
677 ld = '$(LDXX)'
678 else:
679 ld = '$(LD)'
680
ctillercab52e72015-01-06 13:10:23 -0800681 out_base = 'libs/$(CONFIG)/' + lib.name
682 out_libbase = 'libs/$(CONFIG)/lib' + lib.name
nnoble5b7f32a2014-12-22 08:12:44 -0800683
684 common = '$(LIB' + lib.name.upper() + '_OBJS) $(LDLIBS)'
685
686 libs = ''
687 lib_deps = ''
688 mingw_libs = ''
689 mingw_lib_deps = ''
690 for dep in lib.get('deps', []):
691 libs = libs + ' -l' + dep
ctillercab52e72015-01-06 13:10:23 -0800692 lib_deps = lib_deps + 'libs/$(CONFIG)/lib' + dep + '.$(SHARED_EXT)'
nnoble5b7f32a2014-12-22 08:12:44 -0800693 mingw_libs = mingw_libs + ' -l' + dep + '-imp'
ctillercab52e72015-01-06 13:10:23 -0800694 mingw_lib_deps = mingw_lib_deps + 'libs/$(CONFIG)/' + dep + '.$(SHARED_EXT)'
nnoble5b7f32a2014-12-22 08:12:44 -0800695
696 if lib.get('secure', True):
697 common = common + ' $(LDLIBS_SECURE) $(OPENSSL_MERGE_LIBS)'
698 lib_deps = lib_deps + ' $(OPENSSL_DEP)'
699 mingw_lib_deps = mingw_lib_deps + ' $(OPENSSL_DEP)'
700
701%>
702
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800703% if lib.build == "all":
nnoble5b7f32a2014-12-22 08:12:44 -0800704ifeq ($(SYSTEM),MINGW32)
705${out_base}.$(SHARED_EXT): $(LIB${lib.name.upper()}_OBJS) ${mingw_lib_deps}
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800706 $(E) "[LD] Linking $@"
nnoble85a49262014-12-08 18:14:03 -0800707 $(Q) mkdir -p `dirname $@`
ctillercab52e72015-01-06 13:10:23 -0800708 $(Q) ${ld} $(LDFLAGS) -Llibs/$(CONFIG) -shared -Wl,--output-def=${out_base}.def -Wl,--out-implib=${out_libbase}-imp.a -o ${out_base}.$(SHARED_EXT) ${common}${mingw_libs}
nnoble5b7f32a2014-12-22 08:12:44 -0800709else
710${out_libbase}.$(SHARED_EXT): $(LIB${lib.name.upper()}_OBJS) ${lib_deps}
711 $(E) "[LD] Linking $@"
712 $(Q) mkdir -p `dirname $@`
713ifeq ($(SYSTEM),Darwin)
ctillercab52e72015-01-06 13:10:23 -0800714 $(Q) ${ld} $(LDFLAGS) -Llibs/$(CONFIG) -dynamiclib -o ${out_libbase}.$(SHARED_EXT) ${common}${libs}
nnoble5b7f32a2014-12-22 08:12:44 -0800715else
ctillercab52e72015-01-06 13:10:23 -0800716 $(Q) ${ld} $(LDFLAGS) -Llibs/$(CONFIG) -shared -Wl,-soname,lib${lib.name}.so.${settings.version.major} -o ${out_libbase}.$(SHARED_EXT) ${common}${libs}
nnoble5b7f32a2014-12-22 08:12:44 -0800717 $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) ${out_libbase}.so
718endif
719endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800720% endif
721
nnoble69ac39f2014-12-12 15:43:38 -0800722% if lib.get('secure', True):
723
724endif
725% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800726
727deps_lib${lib.name}: $(LIB${lib.name.upper()}_DEPS)
728
nnoble69ac39f2014-12-12 15:43:38 -0800729% if lib.get('secure', True):
730ifneq ($(NO_SECURE),true)
731% endif
732ifneq ($(NO_DEPS),true)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800733-include $(LIB${lib.name.upper()}_DEPS)
734endif
nnoble69ac39f2014-12-12 15:43:38 -0800735% if lib.get('secure', True):
736endif
737% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800738
739clean_lib${lib.name}:
740 $(E) "[CLEAN] Cleaning lib${lib.name} files"
741 $(Q) $(RM) $(LIB${lib.name.upper()}_OBJS)
742 $(Q) $(RM) $(LIB${lib.name.upper()}_DEPS)
ctillercab52e72015-01-06 13:10:23 -0800743 $(Q) $(RM) libs/$(CONFIG)/lib${lib.name}.a
744 $(Q) $(RM) libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800745</%def>
746
747<%def name="maketarget(tgt)">
748${tgt.name.upper()}_SRC = \\
749
750% for src in tgt.src:
nnoble72309c62014-12-12 11:42:26 -0800751 ${proto_to_cc(src)} \\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800752
753% endfor
754
ctillercab52e72015-01-06 13:10:23 -0800755${tgt.name.upper()}_OBJS = $(addprefix objs/$(CONFIG)/, $(addsuffix .o, $(basename $(${tgt.name.upper()}_SRC))))
756${tgt.name.upper()}_DEPS = $(addprefix deps/$(CONFIG)/, $(addsuffix .dep, $(basename $(${tgt.name.upper()}_SRC))))
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800757
nnoble69ac39f2014-12-12 15:43:38 -0800758% if tgt.get('secure', True):
759ifeq ($(NO_SECURE),true)
760
ctillercab52e72015-01-06 13:10:23 -0800761bins/$(CONFIG)/${tgt.name}: openssl_dep_error
nnoble69ac39f2014-12-12 15:43:38 -0800762
763else
764
765% endif
ctillercab52e72015-01-06 13:10:23 -0800766bins/$(CONFIG)/${tgt.name}: $(${tgt.name.upper()}_OBJS)\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800767% for dep in tgt.deps:
ctillercab52e72015-01-06 13:10:23 -0800768 libs/$(CONFIG)/lib${dep}.a\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800769% endfor
770
nnoble72309c62014-12-12 11:42:26 -0800771% if tgt.get("c++", False):
772% if tgt.build == 'protoc':
773 $(E) "[HOSTLD] Linking $@"
774 $(Q) mkdir -p `dirname $@`
775 $(Q) $(HOST_LDXX) $(HOST_LDFLAGS) $(${tgt.name.upper()}_OBJS)\
776% else:
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800777 $(E) "[LD] Linking $@"
nnoble85a49262014-12-08 18:14:03 -0800778 $(Q) mkdir -p `dirname $@`
nnoblec78b3402014-12-11 16:06:57 -0800779 $(Q) $(LDXX) $(LDFLAGS) $(${tgt.name.upper()}_OBJS)\
nnoble72309c62014-12-12 11:42:26 -0800780% endif
nnoblec78b3402014-12-11 16:06:57 -0800781% if tgt.build == 'test':
782 $(GTEST_LIB)\
783% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800784% else:
nnoble72309c62014-12-12 11:42:26 -0800785 $(E) "[LD] Linking $@"
786 $(Q) mkdir -p `dirname $@`
nnoble5b7f32a2014-12-22 08:12:44 -0800787 $(Q) $(LD) $(LDFLAGS) $(${tgt.name.upper()}_OBJS)\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800788% endif
789% for dep in tgt.deps:
ctillercab52e72015-01-06 13:10:23 -0800790 libs/$(CONFIG)/lib${dep}.a\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800791% endfor
792% if tgt.get("c++", False):
nnoble72309c62014-12-12 11:42:26 -0800793% if tgt.build == 'protoc':
794 $(HOST_LDLIBSXX)\
795% else:
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800796 $(LDLIBSXX)\
797% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800798% endif
nnoblec78b3402014-12-11 16:06:57 -0800799% if tgt.build == 'protoc':
nnoble72309c62014-12-12 11:42:26 -0800800 $(HOST_LDLIBS)\
801% else:
802 $(LDLIBS)\
803% endif
804% if tgt.build == 'protoc':
805 $(HOST_LDLIBS_PROTOC)\
806% elif tgt.get('secure', True):
807 $(LDLIBS_SECURE)\
nnoblec78b3402014-12-11 16:06:57 -0800808% endif
ctillercab52e72015-01-06 13:10:23 -0800809 -o bins/$(CONFIG)/${tgt.name}
nnoble69ac39f2014-12-12 15:43:38 -0800810% if tgt.get('secure', True):
811
812endif
813% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800814
815deps_${tgt.name}: $(${tgt.name.upper()}_DEPS)
816
nnoble69ac39f2014-12-12 15:43:38 -0800817% if tgt.get('secure', True):
818ifneq ($(NO_SECURE),true)
819% endif
820ifneq ($(NO_DEPS),true)
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800821-include $(${tgt.name.upper()}_DEPS)
822endif
nnoble69ac39f2014-12-12 15:43:38 -0800823% if tgt.get('secure', True):
824endif
825% endif
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800826
827clean_${tgt.name}:
828 $(E) "[CLEAN] Cleaning ${tgt.name} files"
829 $(Q) $(RM) $(${tgt.name.upper()}_OBJS)
830 $(Q) $(RM) $(${tgt.name.upper()}_DEPS)
ctillercab52e72015-01-06 13:10:23 -0800831 $(Q) $(RM) bins/$(CONFIG)/${tgt.name}
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800832</%def>
833
nnoble85a49262014-12-08 18:14:03 -0800834.PHONY: all strip tools \
nnoble69ac39f2014-12-12 15:43:38 -0800835dep_error openssl_dep_error openssl_dep_message git_update stop \
nnoble85a49262014-12-08 18:14:03 -0800836buildtests buildtests_c buildtests_cxx \
837test test_c test_cxx \
838install install_c install_cxx \
839install-headers install-headers_c install-headers_cxx \
840install-shared install-shared_c install-shared_cxx \
841install-static install-static_c install-static_cxx \
842strip strip-shared strip-static \
843strip_c strip-shared_c strip-static_c \
844strip_cxx strip-shared_cxx strip-static_cxx \
nnoblebba76922014-12-15 13:27:38 -0800845clean \
846dep_c dep_cxx bins_dep_c bins_dep_cxx\
Nicolas Nobleb7ebd3b2014-11-26 16:33:03 -0800847% for lib in libs:
848 deps_lib${lib.name} clean_lib${lib.name}\
849% endfor
850% for tgt in targets:
851 deps_${tgt.name} clean_${tgt.name}\
852% endfor
853