Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1 | # GRPC global makefile |
| 2 | # This currently builds C and C++ code. |
| 3 | <%! |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 4 | import re |
Craig Tiller | f5371ef | 2015-01-12 16:40:18 -0800 | [diff] [blame^] | 5 | import os |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 6 | |
nnoble | c87b1c5 | 2015-01-05 17:15:18 -0800 | [diff] [blame] | 7 | proto_re = re.compile('(.*)\\.proto') |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 8 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 9 | def excluded(filename, exclude_res): |
| 10 | for r in exclude_res: |
| 11 | if r.match(filename): |
| 12 | return True |
| 13 | return False |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 14 | |
| 15 | def proto_to_cc(filename): |
| 16 | m = proto_re.match(filename) |
| 17 | if not m: |
| 18 | return filename |
| 19 | return 'gens/' + m.group(1) + '.pb.cc' |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 20 | %> |
| 21 | |
ctiller | 8cfebb9 | 2015-01-06 15:02:12 -0800 | [diff] [blame] | 22 | # Configurations |
| 23 | |
| 24 | VALID_CONFIG_opt = 1 |
| 25 | CC_opt = gcc |
| 26 | CXX_opt = g++ |
| 27 | LD_opt = gcc |
| 28 | LDXX_opt = g++ |
| 29 | CPPFLAGS_opt = -O2 |
| 30 | LDFLAGS_opt = |
| 31 | DEFINES_opt = NDEBUG |
| 32 | |
| 33 | VALID_CONFIG_dbg = 1 |
| 34 | CC_dbg = gcc |
| 35 | CXX_dbg = g++ |
| 36 | LD_dbg = gcc |
| 37 | LDXX_dbg = g++ |
| 38 | CPPFLAGS_dbg = -O0 |
| 39 | LDFLAGS_dbg = |
| 40 | DEFINES_dbg = _DEBUG DEBUG |
| 41 | |
| 42 | VALID_CONFIG_tsan = 1 |
| 43 | CC_tsan = clang |
| 44 | CXX_tsan = clang++ |
| 45 | LD_tsan = clang |
| 46 | LDXX_tsan = clang++ |
| 47 | CPPFLAGS_tsan = -O1 -fsanitize=thread -fno-omit-frame-pointer |
| 48 | LDFLAGS_tsan = -fsanitize=thread |
| 49 | DEFINES_tsan = NDEBUG |
| 50 | |
| 51 | VALID_CONFIG_asan = 1 |
| 52 | CC_asan = clang |
| 53 | CXX_asan = clang++ |
| 54 | LD_asan = clang |
| 55 | LDXX_asan = clang++ |
| 56 | CPPFLAGS_asan = -O1 -fsanitize=address -fno-omit-frame-pointer |
| 57 | LDFLAGS_asan = -fsanitize=address |
| 58 | DEFINES_asan = NDEBUG |
| 59 | |
| 60 | VALID_CONFIG_msan = 1 |
| 61 | CC_msan = clang |
| 62 | CXX_msan = clang++ |
| 63 | LD_msan = clang |
| 64 | LDXX_msan = clang++ |
| 65 | CPPFLAGS_msan = -O1 -fsanitize=memory -fno-omit-frame-pointer |
| 66 | LDFLAGS_msan = -fsanitize=memory |
| 67 | DEFINES_msan = NDEBUG |
| 68 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 69 | # General settings. |
| 70 | # You may want to change these depending on your system. |
| 71 | |
| 72 | prefix ?= /usr/local |
| 73 | |
| 74 | PROTOC = protoc |
yangg | 102e4fe | 2015-01-06 16:02:50 -0800 | [diff] [blame] | 75 | CONFIG ?= opt |
ctiller | 8cfebb9 | 2015-01-06 15:02:12 -0800 | [diff] [blame] | 76 | CC = $(CC_$(CONFIG)) |
| 77 | CXX = $(CXX_$(CONFIG)) |
| 78 | LD = $(LD_$(CONFIG)) |
| 79 | LDXX = $(LDXX_$(CONFIG)) |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 80 | AR = ar |
| 81 | STRIP = strip --strip-unneeded |
| 82 | INSTALL = install -D |
| 83 | RM = rm -f |
| 84 | |
yangg | 102e4fe | 2015-01-06 16:02:50 -0800 | [diff] [blame] | 85 | ifndef VALID_CONFIG_$(CONFIG) |
| 86 | $(error Invalid CONFIG value '$(CONFIG)') |
| 87 | endif |
| 88 | |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 89 | HOST_CC = $(CC) |
| 90 | HOST_CXX = $(CXX) |
| 91 | HOST_LD = $(LD) |
| 92 | HOST_LDXX = $(LDXX) |
| 93 | |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 94 | CPPFLAGS += $(CPPFLAGS_$(CONFIG)) |
| 95 | DEFINES += $(DEFINES_$(CONFIG)) |
ctiller | 8cfebb9 | 2015-01-06 15:02:12 -0800 | [diff] [blame] | 96 | LDFLAGS += $(LDFLAGS_$(CONFIG)) |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 97 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 98 | CFLAGS += -std=c89 -pedantic |
| 99 | CXXFLAGS += -std=c++11 |
| 100 | CPPFLAGS += -g -fPIC -Wall -Werror -Wno-long-long |
| 101 | LDFLAGS += -g -pthread -fPIC |
| 102 | |
| 103 | INCLUDES = . include gens |
ctiller | c008ae5 | 2015-01-07 15:33:00 -0800 | [diff] [blame] | 104 | LIBS = rt m z pthread |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 105 | LIBSXX = protobuf |
nnoble | c78b340 | 2014-12-11 16:06:57 -0800 | [diff] [blame] | 106 | LIBS_PROTOC = protoc protobuf |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 107 | |
| 108 | ifneq ($(wildcard /usr/src/gtest/src/gtest-all.cc),) |
| 109 | GTEST_LIB = /usr/src/gtest/src/gtest-all.cc -I/usr/src/gtest |
| 110 | else |
| 111 | GTEST_LIB = -lgtest |
| 112 | endif |
chenw | a8fd44a | 2014-12-10 15:13:55 -0800 | [diff] [blame] | 113 | GTEST_LIB += -lgflags |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 114 | ifeq ($(V),1) |
| 115 | E = @: |
| 116 | Q = |
| 117 | else |
| 118 | E = @echo |
| 119 | Q = @ |
| 120 | endif |
| 121 | |
| 122 | VERSION = ${settings.version.major}.${settings.version.minor}.${settings.version.micro}.${settings.version.build} |
| 123 | |
| 124 | CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) |
| 125 | CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) |
| 126 | |
| 127 | LDFLAGS += $(ARCH_FLAGS) |
| 128 | LDLIBS += $(addprefix -l, $(LIBS)) |
| 129 | LDLIBSXX += $(addprefix -l, $(LIBSXX)) |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 130 | HOST_LDLIBS_PROTOC += $(addprefix -l, $(LIBS_PROTOC)) |
| 131 | |
| 132 | HOST_CPPFLAGS = $(CPPFLAGS) |
| 133 | HOST_CFLAGS = $(CFLAGS) |
| 134 | HOST_CXXFLAGS = $(CXXFLAGS) |
| 135 | HOST_LDFLAGS = $(LDFLAGS) |
| 136 | HOST_LDLIBS = $(LDLIBS) |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 137 | |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 138 | |
| 139 | # These are automatically computed variables. |
| 140 | # There shouldn't be any need to change anything from now on. |
| 141 | |
| 142 | HOST_SYSTEM = $(shell uname | cut -f 1 -d_) |
| 143 | ifeq ($(SYSTEM),) |
| 144 | SYSTEM = $(HOST_SYSTEM) |
| 145 | endif |
| 146 | |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 147 | ifeq ($(SYSTEM),MINGW32) |
| 148 | SHARED_EXT = dll |
| 149 | endif |
| 150 | ifeq ($(SYSTEM),Darwin) |
| 151 | SHARED_EXT = dylib |
| 152 | endif |
| 153 | ifeq ($(SHARED_EXT),) |
| 154 | SHARED_EXT = so.$(VERSION) |
| 155 | endif |
| 156 | |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 157 | ifeq ($(wildcard .git),) |
| 158 | IS_GIT_FOLDER = false |
| 159 | else |
| 160 | IS_GIT_FOLDER = true |
| 161 | endif |
| 162 | |
nnoble | 7e012cf | 2014-12-22 17:53:44 -0800 | [diff] [blame] | 163 | OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o /dev/null test/build/openssl-alpn.c -lssl -lcrypto -ldl $(LDFLAGS) |
| 164 | ZLIB_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o /dev/null test/build/zlib.c -lz $(LDFLAGS) |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 165 | |
nnoble | 6082540 | 2014-12-15 14:43:51 -0800 | [diff] [blame] | 166 | HAS_SYSTEM_OPENSSL_ALPN = $(shell $(OPENSSL_ALPN_CHECK_CMD) 2> /dev/null && echo true || echo false) |
| 167 | HAS_SYSTEM_ZLIB = $(shell $(ZLIB_CHECK_CMD) 2> /dev/null && echo true || echo false) |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 168 | |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 169 | ifeq ($(wildcard third_party/openssl/ssl/ssl.h),) |
| 170 | HAS_EMBEDDED_OPENSSL_ALPN = false |
| 171 | else |
| 172 | HAS_EMBEDDED_OPENSSL_ALPN = true |
| 173 | endif |
| 174 | |
| 175 | ifeq ($(wildcard third_party/zlib/zlib.h),) |
| 176 | HAS_EMBEDDED_ZLIB = false |
| 177 | else |
| 178 | HAS_EMBEDDED_ZLIB = true |
| 179 | endif |
| 180 | |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 181 | ifeq ($(HAS_SYSTEM_ZLIB),false) |
| 182 | ifeq ($(HAS_EMBEDDED_ZLIB),true) |
| 183 | ZLIB_DEP = third_party/zlib/libz.a |
| 184 | CPPFLAGS += -Ithird_party/zlib |
| 185 | LDFLAGS += -Lthird_party/zlib |
| 186 | else |
| 187 | DEP_MISSING += zlib |
| 188 | endif |
| 189 | endif |
| 190 | |
| 191 | ifeq ($(HAS_SYSTEM_OPENSSL_ALPN),false) |
| 192 | ifeq ($(HAS_EMBEDDED_OPENSSL_ALPN),true) |
| 193 | OPENSSL_DEP = third_party/openssl/libssl.a |
nnoble | 20e2e3f | 2014-12-16 15:37:57 -0800 | [diff] [blame] | 194 | OPENSSL_MERGE_LIBS += third_party/openssl/libssl.a third_party/openssl/libcrypto.a |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 195 | CPPFLAGS += -Ithird_party/openssl/include |
| 196 | LDFLAGS += -Lthird_party/openssl |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 197 | LIBS_SECURE = dl |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 198 | else |
| 199 | NO_SECURE = true |
| 200 | endif |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 201 | else |
| 202 | LIBS_SECURE = ssl crypto dl |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 203 | endif |
| 204 | |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 205 | LDLIBS_SECURE += $(addprefix -l, $(LIBS_SECURE)) |
| 206 | |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 207 | ifneq ($(DEP_MISSING),) |
| 208 | NO_DEPS = true |
| 209 | endif |
| 210 | |
| 211 | ifneq ($(MAKECMDGOALS),clean) |
| 212 | NO_DEPS = true |
| 213 | endif |
| 214 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 215 | .SECONDARY = %.pb.h %.pb.cc |
| 216 | |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 217 | ifeq ($(DEP_MISSING),) |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 218 | all: static shared\ |
| 219 | % for tgt in targets: |
| 220 | % if tgt.build == 'all': |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 221 | bins/$(CONFIG)/${tgt.name}\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 222 | % endif |
| 223 | % endfor |
| 224 | |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 225 | dep_error: |
| 226 | @echo "You shouldn't see this message - all of your dependencies are correct." |
| 227 | else |
| 228 | all: dep_error git_update stop |
| 229 | |
| 230 | dep_error: |
| 231 | @echo |
| 232 | @echo "DEPENDENCY ERROR" |
| 233 | @echo |
| 234 | @echo "You are missing system dependencies that are essential to build grpc," |
| 235 | @echo "and the third_party directory doesn't have them:" |
| 236 | @echo |
| 237 | @echo " $(DEP_MISSING)" |
| 238 | @echo |
| 239 | @echo "Installing the development packages for your system will solve" |
| 240 | @echo "this issue. 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 | endif |
| 247 | |
| 248 | git_update: |
| 249 | ifeq ($(IS_GIT_FOLDER),true) |
| 250 | @echo "Additionally, since you are in a git clone, you can download the" |
| 251 | @echo "missing dependencies in third_party by running the following command:" |
| 252 | @echo |
ctiller | 64f2910 | 2014-12-15 10:40:59 -0800 | [diff] [blame] | 253 | @echo " git submodule update --init" |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 254 | @echo |
| 255 | endif |
| 256 | |
| 257 | openssl_dep_error: openssl_dep_message git_update stop |
| 258 | |
| 259 | openssl_dep_message: |
| 260 | @echo |
| 261 | @echo "DEPENDENCY ERROR" |
| 262 | @echo |
| 263 | @echo "The target you are trying to run requires OpenSSL with ALPN support." |
| 264 | @echo "Your system doesn't have it, and neither does the third_party directory." |
| 265 | @echo |
| 266 | @echo "Please consult INSTALL to get more information." |
| 267 | @echo |
| 268 | @echo "If you need information about why these tests failed, run:" |
| 269 | @echo |
| 270 | @echo " make run_dep_checks" |
| 271 | @echo |
| 272 | |
| 273 | stop: |
| 274 | @false |
| 275 | |
ctiller | 09cb6d5 | 2014-12-19 17:38:22 -0800 | [diff] [blame] | 276 | % for tgt in targets: |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 277 | ${tgt.name}: bins/$(CONFIG)/${tgt.name} |
ctiller | 09cb6d5 | 2014-12-19 17:38:22 -0800 | [diff] [blame] | 278 | % endfor |
| 279 | |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 280 | run_dep_checks: |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 281 | $(OPENSSL_ALPN_CHECK_CMD) || true |
| 282 | $(ZLIB_CHECK_CMD) || true |
| 283 | |
| 284 | third_party/zlib/libz.a: |
| 285 | (cd third_party/zlib ; CFLAGS="-fPIC -fvisibility=hidden" ./configure --static) |
| 286 | $(MAKE) -C third_party/zlib |
| 287 | |
| 288 | third_party/openssl/libssl.a: |
| 289 | (cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden" ./config) |
| 290 | $(MAKE) -C third_party/openssl build_crypto build_ssl |
| 291 | |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 292 | static: static_c static_cxx |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 293 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 294 | static_c: dep_c\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 295 | % for lib in libs: |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 296 | % if lib.build == 'all' and not lib.get('c++', False): |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 297 | libs/$(CONFIG)/lib${lib.name}.a\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 298 | % endif |
| 299 | % endfor |
| 300 | |
| 301 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 302 | static_cxx: dep_cxx\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 303 | % for lib in libs: |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 304 | % if lib.build == 'all' and lib.get('c++', False): |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 305 | libs/$(CONFIG)/lib${lib.name}.a\ |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 306 | % endif |
| 307 | % endfor |
| 308 | |
| 309 | |
| 310 | shared: shared_c shared_cxx |
| 311 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 312 | shared_c: dep_c\ |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 313 | % for lib in libs: |
| 314 | % if lib.build == 'all' and not lib.get('c++', False): |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 315 | libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 316 | % endif |
| 317 | % endfor |
| 318 | |
| 319 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 320 | shared_cxx: dep_cxx\ |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 321 | % for lib in libs: |
| 322 | % if lib.build == 'all' and lib.get('c++', False): |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 323 | libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\ |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 324 | % endif |
| 325 | % endfor |
| 326 | |
| 327 | |
| 328 | privatelibs: privatelibs_c privatelibs_cxx |
| 329 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 330 | privatelibs_c: dep_c\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 331 | % for lib in libs: |
| 332 | % if lib.build == 'private': |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 333 | libs/$(CONFIG)/lib${lib.name}.a\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 334 | % endif |
| 335 | % endfor |
| 336 | |
| 337 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 338 | privatelibs_cxx: dep_cxx\ |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 339 | % for lib in libs: |
| 340 | % if lib.build == 'private': |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 341 | libs/$(CONFIG)/lib${lib.name}.a\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 342 | % endif |
| 343 | % endfor |
| 344 | |
| 345 | |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 346 | buildtests: buildtests_c buildtests_cxx |
| 347 | |
nnoble | bba7692 | 2014-12-15 13:27:38 -0800 | [diff] [blame] | 348 | buildtests_c: bins_dep_c privatelibs_c\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 349 | % for tgt in targets: |
| 350 | % if tgt.build == 'test' and not tgt.get('c++', False): |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 351 | bins/$(CONFIG)/${tgt.name}\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 352 | % endif |
| 353 | % endfor |
| 354 | |
| 355 | |
nnoble | bba7692 | 2014-12-15 13:27:38 -0800 | [diff] [blame] | 356 | buildtests_cxx: bins_dep_cxx privatelibs_cxx\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 357 | % for tgt in targets: |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 358 | % if tgt.build == 'test' and tgt.get('c++', False): |
Craig Tiller | f5371ef | 2015-01-12 16:40:18 -0800 | [diff] [blame^] | 359 | bins/$(CONFIG)/${tgt.name}\ |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 360 | % endif |
| 361 | % endfor |
| 362 | |
| 363 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 364 | test: test_c test_cxx |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 365 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 366 | test_c: buildtests_c |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 367 | % for tgt in targets: |
| 368 | % if tgt.build == 'test' and tgt.get('run', True) and not tgt.get('c++', False): |
| 369 | $(E) "[RUN] Testing ${tgt.name}" |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 370 | $(Q) ./bins/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 371 | % endif |
| 372 | % endfor |
| 373 | |
| 374 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 375 | test_cxx: buildtests_cxx |
nnoble | 29e1d29 | 2014-12-01 10:27:40 -0800 | [diff] [blame] | 376 | % for tgt in targets: |
| 377 | % if tgt.build == 'test' and tgt.get('run', True) and tgt.get('c++', False): |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 378 | $(E) "[RUN] Testing ${tgt.name}" |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 379 | $(Q) ./bins/$(CONFIG)/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 ) |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 380 | % endif |
| 381 | % endfor |
| 382 | |
| 383 | |
| 384 | tools: privatelibs\ |
| 385 | % for tgt in targets: |
| 386 | % if tgt.build == 'tool': |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 387 | bins/$(CONFIG)/${tgt.name}\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 388 | % endif |
| 389 | % endfor |
| 390 | |
| 391 | |
nnoble | ebebb7e | 2014-12-10 16:31:01 -0800 | [diff] [blame] | 392 | protoc_plugins:\ |
| 393 | % for tgt in targets: |
| 394 | % if tgt.build == 'protoc': |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 395 | bins/$(CONFIG)/${tgt.name}\ |
nnoble | ebebb7e | 2014-12-10 16:31:01 -0800 | [diff] [blame] | 396 | % endif |
| 397 | % endfor |
| 398 | |
| 399 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 400 | buildbenchmarks: privatelibs\ |
| 401 | % for tgt in targets: |
| 402 | % if tgt.build == 'benchmark': |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 403 | bins/$(CONFIG)/${tgt.name}\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 404 | % endif |
| 405 | % endfor |
| 406 | |
| 407 | |
| 408 | benchmarks: buildbenchmarks |
| 409 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 410 | strip: strip-static strip-shared |
| 411 | |
nnoble | 20e2e3f | 2014-12-16 15:37:57 -0800 | [diff] [blame] | 412 | strip-static: strip-static_c strip-static_cxx |
| 413 | |
| 414 | strip-shared: strip-shared_c strip-shared_cxx |
| 415 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 416 | strip-static_c: static_c |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 417 | % for lib in libs: |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 418 | % if not lib.get("c++", False): |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 419 | % if lib.build == "all": |
| 420 | $(E) "[STRIP] Stripping lib${lib.name}.a" |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 421 | $(Q) $(STRIP) libs/$(CONFIG)/lib${lib.name}.a |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 422 | % endif |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 423 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 424 | % endfor |
| 425 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 426 | strip-static_cxx: static_cxx |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 427 | % for lib in libs: |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 428 | % if lib.get("c++", False): |
| 429 | % if lib.build == "all": |
| 430 | $(E) "[STRIP] Stripping lib${lib.name}.a" |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 431 | $(Q) $(STRIP) libs/$(CONFIG)/lib${lib.name}.a |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 432 | % endif |
| 433 | % endif |
| 434 | % endfor |
| 435 | |
| 436 | strip-shared_c: shared_c |
| 437 | % for lib in libs: |
| 438 | % if not lib.get("c++", False): |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 439 | % if lib.build == "all": |
| 440 | $(E) "[STRIP] Stripping lib${lib.name}.so" |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 441 | $(Q) $(STRIP) libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT) |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 442 | % endif |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 443 | % endif |
| 444 | % endfor |
| 445 | |
| 446 | strip-shared_cxx: shared_cxx |
| 447 | % for lib in libs: |
| 448 | % if lib.get("c++", False): |
| 449 | % if lib.build == "all": |
| 450 | $(E) "[STRIP] Stripping lib${lib.name}.so" |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 451 | $(Q) $(STRIP) libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT) |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 452 | % endif |
| 453 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 454 | % endfor |
| 455 | |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 456 | % for p in protos: |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 457 | deps/$(CONFIG)/gens/${p}.pb.dep: |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 458 | $(Q) mkdir -p `dirname $@` |
| 459 | $(Q) touch $@ |
| 460 | |
| 461 | gens/${p}.pb.cc: ${p}.proto protoc_plugins |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 462 | $(E) "[PROTOC] Generating protobuf CC file from $<" |
| 463 | $(Q) mkdir -p `dirname $@` |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 464 | $(Q) $(PROTOC) --cpp_out=gens --grpc_out=gens --plugin=protoc-gen-grpc=bins/$(CONFIG)/cpp_plugin $< |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 465 | |
| 466 | % endfor |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 467 | |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 468 | deps/$(CONFIG)/%.dep : %.c |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 469 | $(E) "[DEP] Generating dependencies for $<" |
| 470 | $(Q) mkdir -p `dirname $@` |
| 471 | $(Q) $(CC) $(CFLAGS) $(CPPFLAGS_NO_ARCH) -MG -M $< > $@ |
| 472 | |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 473 | deps/$(CONFIG)/%.dep : %.cc |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 474 | $(E) "[DEP] Generating dependencies for $<" |
| 475 | $(Q) mkdir -p `dirname $@` |
| 476 | $(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS_NO_ARCH) -MG -M $< > $@ |
| 477 | |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 478 | objs/$(CONFIG)/%.o : %.c |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 479 | $(E) "[C] Compiling $<" |
| 480 | $(Q) mkdir -p `dirname $@` |
| 481 | $(Q) $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< |
| 482 | |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 483 | objs/$(CONFIG)/%.o : gens/%.pb.cc |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 484 | $(E) "[CXX] Compiling $<" |
| 485 | $(Q) mkdir -p `dirname $@` |
| 486 | $(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< |
| 487 | |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 488 | objs/$(CONFIG)/src/compiler/%.o : src/compiler/%.cc |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 489 | $(E) "[HOSTCXX] Compiling $<" |
| 490 | $(Q) mkdir -p `dirname $@` |
| 491 | $(Q) $(HOST_CXX) $(HOST_CXXFLAGS) $(HOST_CPPFLAGS) -c -o $@ $< |
| 492 | |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 493 | objs/$(CONFIG)/%.o : %.cc |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 494 | $(E) "[CXX] Compiling $<" |
| 495 | $(Q) mkdir -p `dirname $@` |
| 496 | $(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< |
| 497 | |
nnoble | 0c475f0 | 2014-12-05 15:37:39 -0800 | [diff] [blame] | 498 | dep: dep_c dep_cxx |
| 499 | |
| 500 | dep_c:\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 501 | % for lib in libs: |
nnoble | 0c475f0 | 2014-12-05 15:37:39 -0800 | [diff] [blame] | 502 | % if not lib.get('c++', False): |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 503 | deps_lib${lib.name}\ |
nnoble | 0c475f0 | 2014-12-05 15:37:39 -0800 | [diff] [blame] | 504 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 505 | % endfor |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 506 | |
| 507 | |
| 508 | bins_dep_c:\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 509 | % for tgt in targets: |
nnoble | 0c475f0 | 2014-12-05 15:37:39 -0800 | [diff] [blame] | 510 | % if not tgt.get('c++', False): |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 511 | deps_${tgt.name}\ |
nnoble | 0c475f0 | 2014-12-05 15:37:39 -0800 | [diff] [blame] | 512 | % endif |
| 513 | % endfor |
| 514 | |
| 515 | |
| 516 | dep_cxx:\ |
| 517 | % for lib in libs: |
| 518 | % if lib.get('c++', False): |
| 519 | deps_lib${lib.name}\ |
| 520 | % endif |
| 521 | % endfor |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 522 | |
| 523 | |
| 524 | bins_dep_cxx:\ |
nnoble | 0c475f0 | 2014-12-05 15:37:39 -0800 | [diff] [blame] | 525 | % for tgt in targets: |
| 526 | % if tgt.get('c++', False): |
| 527 | deps_${tgt.name}\ |
| 528 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 529 | % endfor |
| 530 | |
| 531 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 532 | install: install_c install_cxx |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 533 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 534 | install_c: install-headers_c install-static_c install-shared_c |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 535 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 536 | install_cxx: install-headers_cxx install-static_cxx install-shared_cxx |
| 537 | |
| 538 | install-headers: install-headers_c install-headers_cxx |
| 539 | |
| 540 | install-headers_c: |
| 541 | $(E) "[INSTALL] Installing public C headers" |
| 542 | $(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1 |
| 543 | |
| 544 | install-headers_cxx: |
| 545 | $(E) "[INSTALL] Installing public C++ headers" |
| 546 | $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1 |
| 547 | |
| 548 | install-static: install-static_c install-static_cxx |
| 549 | |
| 550 | install-static_c: static_c strip-static_c |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 551 | % for lib in libs: |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 552 | % if not lib.get("c++", False): |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 553 | % if lib.build == "all": |
| 554 | $(E) "[INSTALL] Installing lib${lib.name}.a" |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 555 | $(Q) $(INSTALL) libs/$(CONFIG)/lib${lib.name}.a $(prefix)/lib/lib${lib.name}.a |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 556 | % endif |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 557 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 558 | % endfor |
| 559 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 560 | install-static_cxx: static_cxx strip-static_cxx |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 561 | % for lib in libs: |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 562 | % if lib.get("c++", False): |
| 563 | % if lib.build == "all": |
| 564 | $(E) "[INSTALL] Installing lib${lib.name}.a" |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 565 | $(Q) $(INSTALL) libs/$(CONFIG)/lib${lib.name}.a $(prefix)/lib/lib${lib.name}.a |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 566 | % endif |
| 567 | % endif |
| 568 | % endfor |
| 569 | |
| 570 | install-shared_c: shared_c strip-shared_c |
| 571 | % for lib in libs: |
| 572 | % if not lib.get("c++", False): |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 573 | % if lib.build == "all": |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 574 | ifeq ($(SYSTEM),MINGW32) |
| 575 | $(E) "[INSTALL] Installing ${lib.name}.$(SHARED_EXT)" |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 576 | $(Q) $(INSTALL) libs/$(CONFIG)/${lib.name}.$(SHARED_EXT) $(prefix)/lib/${lib.name}.$(SHARED_EXT) |
| 577 | $(Q) $(INSTALL) libs/$(CONFIG)/lib${lib.name}-imp.a $(prefix)/lib/lib${lib.name}-imp.a |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 578 | else |
| 579 | $(E) "[INSTALL] Installing lib${lib.name}.$(SHARED_EXT)" |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 580 | $(Q) $(INSTALL) libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.$(SHARED_EXT) |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 581 | ifneq ($(SYSTEM),Darwin) |
| 582 | $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so |
| 583 | endif |
| 584 | endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 585 | % endif |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 586 | % endif |
| 587 | % endfor |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 588 | ifneq ($(SYSTEM),MINGW32) |
| 589 | ifneq ($(SYSTEM),Darwin) |
| 590 | $(Q) ldconfig |
| 591 | endif |
| 592 | endif |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 593 | |
| 594 | install-shared_cxx: shared_cxx strip-shared_cxx |
| 595 | % for lib in libs: |
| 596 | % if lib.get("c++", False): |
| 597 | % if lib.build == "all": |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 598 | ifeq ($(SYSTEM),MINGW32) |
| 599 | $(E) "[INSTALL] Installing ${lib.name}.$(SHARED_EXT)" |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 600 | $(Q) $(INSTALL) libs/$(CONFIG)/${lib.name}.$(SHARED_EXT) $(prefix)/lib/${lib.name}.$(SHARED_EXT) |
| 601 | $(Q) $(INSTALL) libs/$(CONFIG)/lib${lib.name}-imp.a $(prefix)/lib/lib${lib.name}-imp.a |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 602 | else |
| 603 | $(E) "[INSTALL] Installing lib${lib.name}.$(SHARED_EXT)" |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 604 | $(Q) $(INSTALL) libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.$(SHARED_EXT) |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 605 | ifneq ($(SYSTEM),Darwin) |
| 606 | $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so |
| 607 | endif |
| 608 | endif |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 609 | % endif |
| 610 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 611 | % endfor |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 612 | ifneq ($(SYSTEM),MINGW32) |
| 613 | ifneq ($(SYSTEM),Darwin) |
| 614 | $(Q) ldconfig |
| 615 | endif |
| 616 | endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 617 | |
| 618 | clean:\ |
| 619 | % for lib in libs: |
| 620 | clean_lib${lib.name}\ |
| 621 | % endfor |
| 622 | % for tgt in targets: |
| 623 | clean_${tgt.name}\ |
| 624 | % endfor |
| 625 | |
| 626 | $(Q) $(RM) -r deps objs libs bins gens |
| 627 | |
| 628 | |
| 629 | # The various libraries |
| 630 | |
| 631 | % for lib in libs: |
| 632 | ${makelib(lib)} |
| 633 | % endfor |
| 634 | |
| 635 | |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 636 | # All of the test targets, and protoc plugins |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 637 | |
| 638 | % for tgt in targets: |
| 639 | ${maketarget(tgt)} |
| 640 | % endfor |
| 641 | |
| 642 | <%def name="makelib(lib)"> |
| 643 | LIB${lib.name.upper()}_SRC = \\ |
| 644 | |
| 645 | % for src in lib.src: |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 646 | ${proto_to_cc(src)} \\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 647 | |
| 648 | % endfor |
| 649 | |
| 650 | % if "public_headers" in lib: |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 651 | % if lib.get("c++", False): |
| 652 | PUBLIC_HEADERS_CXX += \\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 653 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 654 | % else: |
| 655 | PUBLIC_HEADERS_C += \\ |
| 656 | |
| 657 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 658 | % for hdr in lib.public_headers: |
| 659 | ${hdr} \\ |
| 660 | |
| 661 | % endfor |
| 662 | % endif |
| 663 | |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 664 | LIB${lib.name.upper()}_OBJS = $(addprefix objs/$(CONFIG)/, $(addsuffix .o, $(basename $(LIB${lib.name.upper()}_SRC)))) |
| 665 | LIB${lib.name.upper()}_DEPS = $(addprefix deps/$(CONFIG)/, $(addsuffix .dep, $(basename $(LIB${lib.name.upper()}_SRC)))) |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 666 | |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 667 | % if lib.get('secure', True): |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 668 | ifeq ($(NO_SECURE),true) |
| 669 | |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 670 | libs/$(CONFIG)/lib${lib.name}.a: openssl_dep_error |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 671 | |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 672 | % if lib.build == "all": |
| 673 | ifeq ($(SYSTEM),MINGW32) |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 674 | libs/$(CONFIG)/${lib.name}.$(SHARED_EXT): openssl_dep_error |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 675 | else |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 676 | libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT): openssl_dep_error |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 677 | endif |
| 678 | % endif |
| 679 | |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 680 | else |
| 681 | |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 682 | libs/$(CONFIG)/lib${lib.name}.a: $(OPENSSL_DEP) $(LIB${lib.name.upper()}_OBJS) |
nnoble | 20e2e3f | 2014-12-16 15:37:57 -0800 | [diff] [blame] | 683 | % else: |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 684 | libs/$(CONFIG)/lib${lib.name}.a: $(LIB${lib.name.upper()}_OBJS) |
nnoble | 20e2e3f | 2014-12-16 15:37:57 -0800 | [diff] [blame] | 685 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 686 | $(E) "[AR] Creating $@" |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 687 | $(Q) mkdir -p `dirname $@` |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 688 | $(Q) $(AR) rcs libs/$(CONFIG)/lib${lib.name}.a $(LIB${lib.name.upper()}_OBJS) |
nnoble | 20e2e3f | 2014-12-16 15:37:57 -0800 | [diff] [blame] | 689 | % if lib.get('baselib', False): |
| 690 | % if lib.get('secure', True): |
Craig Tiller | f5371ef | 2015-01-12 16:40:18 -0800 | [diff] [blame^] | 691 | $(Q) rm -rf tmp-merge |
nnoble | 20e2e3f | 2014-12-16 15:37:57 -0800 | [diff] [blame] | 692 | $(Q) mkdir tmp-merge |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 693 | $(Q) ( cd tmp-merge ; $(AR) x ../libs/$(CONFIG)/lib${lib.name}.a ) |
nnoble | 20e2e3f | 2014-12-16 15:37:57 -0800 | [diff] [blame] | 694 | $(Q) for l in $(OPENSSL_MERGE_LIBS) ; do ( cd tmp-merge ; <%text>ar x ../$${l}</%text> ) ; done |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 695 | $(Q) rm -f libs/$(CONFIG)/lib${lib.name}.a tmp-merge/__.SYMDEF* |
| 696 | $(Q) ar rcs libs/$(CONFIG)/lib${lib.name}.a tmp-merge/* |
nnoble | 20e2e3f | 2014-12-16 15:37:57 -0800 | [diff] [blame] | 697 | $(Q) rm -rf tmp-merge |
| 698 | % endif |
| 699 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 700 | |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 701 | <% |
| 702 | if lib.get('c++', False): |
| 703 | ld = '$(LDXX)' |
| 704 | else: |
| 705 | ld = '$(LD)' |
| 706 | |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 707 | out_base = 'libs/$(CONFIG)/' + lib.name |
| 708 | out_libbase = 'libs/$(CONFIG)/lib' + lib.name |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 709 | |
| 710 | common = '$(LIB' + lib.name.upper() + '_OBJS) $(LDLIBS)' |
| 711 | |
| 712 | libs = '' |
| 713 | lib_deps = '' |
| 714 | mingw_libs = '' |
| 715 | mingw_lib_deps = '' |
| 716 | for dep in lib.get('deps', []): |
| 717 | libs = libs + ' -l' + dep |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 718 | lib_deps = lib_deps + 'libs/$(CONFIG)/lib' + dep + '.$(SHARED_EXT)' |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 719 | mingw_libs = mingw_libs + ' -l' + dep + '-imp' |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 720 | mingw_lib_deps = mingw_lib_deps + 'libs/$(CONFIG)/' + dep + '.$(SHARED_EXT)' |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 721 | |
| 722 | if lib.get('secure', True): |
| 723 | common = common + ' $(LDLIBS_SECURE) $(OPENSSL_MERGE_LIBS)' |
| 724 | lib_deps = lib_deps + ' $(OPENSSL_DEP)' |
| 725 | mingw_lib_deps = mingw_lib_deps + ' $(OPENSSL_DEP)' |
| 726 | |
| 727 | %> |
| 728 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 729 | % if lib.build == "all": |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 730 | ifeq ($(SYSTEM),MINGW32) |
| 731 | ${out_base}.$(SHARED_EXT): $(LIB${lib.name.upper()}_OBJS) ${mingw_lib_deps} |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 732 | $(E) "[LD] Linking $@" |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 733 | $(Q) mkdir -p `dirname $@` |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 734 | $(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} |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 735 | else |
| 736 | ${out_libbase}.$(SHARED_EXT): $(LIB${lib.name.upper()}_OBJS) ${lib_deps} |
| 737 | $(E) "[LD] Linking $@" |
| 738 | $(Q) mkdir -p `dirname $@` |
| 739 | ifeq ($(SYSTEM),Darwin) |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 740 | $(Q) ${ld} $(LDFLAGS) -Llibs/$(CONFIG) -dynamiclib -o ${out_libbase}.$(SHARED_EXT) ${common}${libs} |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 741 | else |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 742 | $(Q) ${ld} $(LDFLAGS) -Llibs/$(CONFIG) -shared -Wl,-soname,lib${lib.name}.so.${settings.version.major} -o ${out_libbase}.$(SHARED_EXT) ${common}${libs} |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 743 | $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) ${out_libbase}.so |
| 744 | endif |
| 745 | endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 746 | % endif |
| 747 | |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 748 | % if lib.get('secure', True): |
| 749 | |
| 750 | endif |
| 751 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 752 | |
| 753 | deps_lib${lib.name}: $(LIB${lib.name.upper()}_DEPS) |
| 754 | |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 755 | % if lib.get('secure', True): |
| 756 | ifneq ($(NO_SECURE),true) |
| 757 | % endif |
| 758 | ifneq ($(NO_DEPS),true) |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 759 | -include $(LIB${lib.name.upper()}_DEPS) |
| 760 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 761 | % if lib.get('secure', True): |
| 762 | endif |
| 763 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 764 | |
| 765 | clean_lib${lib.name}: |
| 766 | $(E) "[CLEAN] Cleaning lib${lib.name} files" |
| 767 | $(Q) $(RM) $(LIB${lib.name.upper()}_OBJS) |
| 768 | $(Q) $(RM) $(LIB${lib.name.upper()}_DEPS) |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 769 | $(Q) $(RM) libs/$(CONFIG)/lib${lib.name}.a |
| 770 | $(Q) $(RM) libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT) |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 771 | </%def> |
| 772 | |
| 773 | <%def name="maketarget(tgt)"> |
| 774 | ${tgt.name.upper()}_SRC = \\ |
| 775 | |
| 776 | % for src in tgt.src: |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 777 | ${proto_to_cc(src)} \\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 778 | |
| 779 | % endfor |
| 780 | |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 781 | ${tgt.name.upper()}_OBJS = $(addprefix objs/$(CONFIG)/, $(addsuffix .o, $(basename $(${tgt.name.upper()}_SRC)))) |
| 782 | ${tgt.name.upper()}_DEPS = $(addprefix deps/$(CONFIG)/, $(addsuffix .dep, $(basename $(${tgt.name.upper()}_SRC)))) |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 783 | |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 784 | % if tgt.get('secure', True): |
| 785 | ifeq ($(NO_SECURE),true) |
| 786 | |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 787 | bins/$(CONFIG)/${tgt.name}: openssl_dep_error |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 788 | |
| 789 | else |
| 790 | |
| 791 | % endif |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 792 | bins/$(CONFIG)/${tgt.name}: $(${tgt.name.upper()}_OBJS)\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 793 | % for dep in tgt.deps: |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 794 | libs/$(CONFIG)/lib${dep}.a\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 795 | % endfor |
| 796 | |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 797 | % if tgt.get("c++", False): |
| 798 | % if tgt.build == 'protoc': |
| 799 | $(E) "[HOSTLD] Linking $@" |
| 800 | $(Q) mkdir -p `dirname $@` |
| 801 | $(Q) $(HOST_LDXX) $(HOST_LDFLAGS) $(${tgt.name.upper()}_OBJS)\ |
| 802 | % else: |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 803 | $(E) "[LD] Linking $@" |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 804 | $(Q) mkdir -p `dirname $@` |
nnoble | c78b340 | 2014-12-11 16:06:57 -0800 | [diff] [blame] | 805 | $(Q) $(LDXX) $(LDFLAGS) $(${tgt.name.upper()}_OBJS)\ |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 806 | % endif |
nnoble | c78b340 | 2014-12-11 16:06:57 -0800 | [diff] [blame] | 807 | % if tgt.build == 'test': |
| 808 | $(GTEST_LIB)\ |
| 809 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 810 | % else: |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 811 | $(E) "[LD] Linking $@" |
| 812 | $(Q) mkdir -p `dirname $@` |
nnoble | 5b7f32a | 2014-12-22 08:12:44 -0800 | [diff] [blame] | 813 | $(Q) $(LD) $(LDFLAGS) $(${tgt.name.upper()}_OBJS)\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 814 | % endif |
| 815 | % for dep in tgt.deps: |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 816 | libs/$(CONFIG)/lib${dep}.a\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 817 | % endfor |
| 818 | % if tgt.get("c++", False): |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 819 | % if tgt.build == 'protoc': |
| 820 | $(HOST_LDLIBSXX)\ |
| 821 | % else: |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 822 | $(LDLIBSXX)\ |
| 823 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 824 | % endif |
nnoble | c78b340 | 2014-12-11 16:06:57 -0800 | [diff] [blame] | 825 | % if tgt.build == 'protoc': |
nnoble | 72309c6 | 2014-12-12 11:42:26 -0800 | [diff] [blame] | 826 | $(HOST_LDLIBS)\ |
| 827 | % else: |
| 828 | $(LDLIBS)\ |
| 829 | % endif |
| 830 | % if tgt.build == 'protoc': |
| 831 | $(HOST_LDLIBS_PROTOC)\ |
| 832 | % elif tgt.get('secure', True): |
| 833 | $(LDLIBS_SECURE)\ |
nnoble | c78b340 | 2014-12-11 16:06:57 -0800 | [diff] [blame] | 834 | % endif |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 835 | -o bins/$(CONFIG)/${tgt.name} |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 836 | % if tgt.get('secure', True): |
| 837 | |
| 838 | endif |
| 839 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 840 | |
Craig Tiller | f5371ef | 2015-01-12 16:40:18 -0800 | [diff] [blame^] | 841 | % for src in tgt.src: |
| 842 | objs/$(CONFIG)/${os.path.splitext(src)[0]}.o: \ |
| 843 | % for dep in tgt.deps: |
| 844 | libs/$(CONFIG)/lib${dep}.a\ |
| 845 | % endfor |
| 846 | |
| 847 | % endfor |
| 848 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 849 | deps_${tgt.name}: $(${tgt.name.upper()}_DEPS) |
| 850 | |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 851 | % if tgt.get('secure', True): |
| 852 | ifneq ($(NO_SECURE),true) |
| 853 | % endif |
| 854 | ifneq ($(NO_DEPS),true) |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 855 | -include $(${tgt.name.upper()}_DEPS) |
| 856 | endif |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 857 | % if tgt.get('secure', True): |
| 858 | endif |
| 859 | % endif |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 860 | |
| 861 | clean_${tgt.name}: |
| 862 | $(E) "[CLEAN] Cleaning ${tgt.name} files" |
| 863 | $(Q) $(RM) $(${tgt.name.upper()}_OBJS) |
| 864 | $(Q) $(RM) $(${tgt.name.upper()}_DEPS) |
ctiller | cab52e7 | 2015-01-06 13:10:23 -0800 | [diff] [blame] | 865 | $(Q) $(RM) bins/$(CONFIG)/${tgt.name} |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 866 | </%def> |
| 867 | |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 868 | .PHONY: all strip tools \ |
nnoble | 69ac39f | 2014-12-12 15:43:38 -0800 | [diff] [blame] | 869 | dep_error openssl_dep_error openssl_dep_message git_update stop \ |
nnoble | 85a4926 | 2014-12-08 18:14:03 -0800 | [diff] [blame] | 870 | buildtests buildtests_c buildtests_cxx \ |
| 871 | test test_c test_cxx \ |
| 872 | install install_c install_cxx \ |
| 873 | install-headers install-headers_c install-headers_cxx \ |
| 874 | install-shared install-shared_c install-shared_cxx \ |
| 875 | install-static install-static_c install-static_cxx \ |
| 876 | strip strip-shared strip-static \ |
| 877 | strip_c strip-shared_c strip-static_c \ |
| 878 | strip_cxx strip-shared_cxx strip-static_cxx \ |
nnoble | bba7692 | 2014-12-15 13:27:38 -0800 | [diff] [blame] | 879 | clean \ |
| 880 | dep_c dep_cxx bins_dep_c bins_dep_cxx\ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 881 | % for lib in libs: |
| 882 | deps_lib${lib.name} clean_lib${lib.name}\ |
| 883 | % endfor |
| 884 | % for tgt in targets: |
| 885 | deps_${tgt.name} clean_${tgt.name}\ |
| 886 | % endfor |
| 887 | |