forked from servo/servo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
455 lines (346 loc) · 17.7 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# Recursive wildcard function
# http://blog.jgc.org/2011/07/gnu-make-recursive-wildcard-function.html
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) \
$(filter $(subst *,%,$2),$d))
include config.mk
# Target-and-rule "utility variables"
ifdef VERBOSE
Q :=
E =
else
Q := @
E = echo $(1)
endif
S := $(CFG_SRC_DIR)
B := $(CFG_BUILD_DIR)
#VPATH := $(S)src
# Delete the built-in rules.
.SUFFIXES:
%:: %,v
%:: RCS/%,v
%:: RCS/%
%:: s.%
%:: SCCS/s.%
MKFILE_DEPS := $(CFG_BUILD_HOME)config.stamp $(call rwildcard,$(S)mk/,*)
CFG_GCCISH_CFLAGS += -DRUST_DEBUG
CFG_RUSTC_FLAGS += -D unused-imports -D unused-variable
ifdef CFG_DISABLE_OPTIMIZE
$(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
CFG_RUSTC_FLAGS +=
else
CFG_RUSTC_FLAGS += -O
endif
CFG_RUSTC_FLAGS += -g
ifdef CFG_ENABLE_DEBUG
$(info cfg: enabling more debugging in RUSTC (CFG_ENABLE_DEBUG))
CFG_RUSTC_SELF_FLAGS += -g
endif
# FIXME: Remove once we’re on a Rust version without the old url crate
# https://github.com/rust-lang/rust/issues/16140
CFG_RUSTC_FLAGS += --extern url=$(B)/src/support/url/rust-url/liburl.rlib
export CFG_RUSTC
export CFG_RUSTC_FLAGS
export CFG_LOCAL_RUSTC
export CFG_ENABLE_DEBUG
export CFG_ENABLE_DEBUG_SKIA
export RUSTC=$(CFG_RUSTC)
export RUSTDOC=$(CFG_RUST_HOME)/bin/rustdoc
export RUSTFLAGS=$(CFG_RUSTC_FLAGS)
export RANLIB=$(CFG_RANLIB)
export PYTHON=$(CFG_PYTHON2)
export PATH=$(CFG_PATH)
export CFG_ANDROID_SDK_PATH
export CFG_ANDROID_NDK_PATH
export CFG_OSTYPE
export CFG_CPUTYPE
export CFG_BUILD_HOME
######################################################################
# Re-configuration
######################################################################
ifndef CFG_DISABLE_MANAGE_SUBMODULES
# This is a pretty expensive operation but I don't see any way to avoid it
NEED_GIT_RECONFIG=$(shell cd "$(S)" && "$(CFG_GIT)" submodule status | grep -c '^\(+\|-\)')
else
NEED_GIT_RECONFIG=0
endif
ifeq ($(NEED_GIT_RECONFIG),0)
else
# If the submodules have changed then always execute config.mk
.PHONY: $(CFG_BUILD_HOME)config.stamp
endif
$(CFG_BUILD_HOME)Makefile $(CFG_BUILD_HOME)config.mk: $(CFG_BUILD_HOME)config.stamp
$(CFG_BUILD_HOME)config.stamp : $(S)configure $(S)Makefile.in
@$(call E, cfg: reconfiguring)
$(Q)$(S)configure $(CFG_CONFIGURE_ARGS)
# Build the compiler
ifneq ($(CFG_LOCAL_RUSTC),1)
$(CFG_RUSTC): $(B)src/compiler/rust/rust-auto-clean-stamp
@$(call E, building rustc)
$(Q)CFG_RUSTC_FLAGS= CFG_ENABLE_DEBUG= RUSTFLAGS="$(CFG_RUSTC_SELF_FLAGS)" $(MAKE) -C "$(CFG_BUILD_DIR)src/compiler/rust"
clean-rust:
@$(call E, cleaning rustc)
$(Q)CFG_RUSTC_FLAGS= CFG_ENABLE_DEBUG= RUSTFLAGS="$(CFG_RUSTC_SELF_FLAGS)" $(MAKE) -C "$(CFG_BUILD_DIR)src/compiler/rust" clean
else
$(CFG_RUSTC):
clean-rust:
endif
$(B)src/compiler/rust/rust-auto-clean-stamp: $(S)src/compiler/rust-auto-clean-trigger
$(Q)$(MAKE) clean-rust
touch $@
rust: $(CFG_RUSTC)
# These arguments are automatically provided by the Rust compiler's build process to
# itself, so they must be specified later for our Rust modules.
ifeq ($(CFG_OSTYPE),linux-androideabi)
CFG_RUSTC_FLAGS += --target arm-linux-androideabi -C linker=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-g++ -C ar=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-ar
endif
# Set up LD_LIBRARY_PATH os the compiler can find libraries
ifeq ($(CFG_OSTYPE),apple-darwin)
export DYLD_LIBRARY_PATH=$(CFG_RUST_HOME)/lib
else
export LD_LIBRARY_PATH=$(CFG_RUST_HOME)/lib
endif
# Strip off submodule paths to determine "raw" submodule names.
SUBMODULES=$(shell echo $(CFG_SUBMODULES) | perl -p -e 's![A-Za-z0-9_-]+/!!g')
# Define e.g. PATH_skia = support/skia/skia
$(foreach submodule,$(CFG_SUBMODULES),\
$(eval PATH_$(shell echo $(submodule) | perl -p -e 's![A-Za-z0-9_-]+/!!g') = $(submodule)))
define DEF_SUBMODULE_VARS
#defaults
DEPS_$(1) =
CFLAGS_$(1) = -O2
#if global cflags set, inherit that
ifdef CFLAGS
CFLAGS_$(1) = $$(CFLAGS)
endif
# any "done" dummy files must be named libSOMETHING.dummy.
#
# We can't auto-compute this, because some modules have lib* prefix in
# their name already, while others don't.
DONE_$(1) = $$(B)src/$$(PATH_$(1))/lib*.dummy
DEPS_SUBMODULES += $$(PATH_$(1))
DEPS_SUBMODULES += $$(PATH_$(1))/.libs
DEPS_SUBMODULES += $$(PATH_$(1))/src/.libs
endef
# these will get populated.
DEPS_SUBMODULES =
$(foreach submodule,$(SUBMODULES),\
$(eval $(call DEF_SUBMODULE_VARS,$(submodule))))
# Handle rust submodule vars specially
DONE_rust = $(CFG_RUSTC)
# include submodule dependencies configuration
include $(S)mk/sub.mk
# Define how to compute approximate submodule dependencies.
# TODO: this may be a bit brutish, but is there a better way?
define DEF_SUBMODULE_DEPS
ROUGH_DEPS_$(1)=$$(call rwildcard,$$(S)src/$$(PATH_$(1)),*h *c *cpp *rs *rc)
DONE_DEPS_$(1)=$$(foreach dep,$$(DEPS_$(1)),$$(DONE_$$(dep)))
# the main target for a submodule
endef
# Define how to make submodule targets
define DEF_SUBMODULE_RULES
ENV_RLDFLAGS_$(1) = -L $$(CFG_BUILD_HOME)workspace/lib/$$(CFG_TARGET)
ENV_RLDFLAGS_$(1) += $$(foreach dep,$$(DEPS_$(1)),-L $$(B)src/$$(PATH_$$(dep)) -L $$(B)src/$$(PATH_$$(dep))/.libs -L $$(B)src/$$(PATH_$$(dep))/src/.libs)
# variables that depend on dependency definitions from sub.mk!
ENV_CFLAGS_$(1) = CFLAGS="$$(CFLAGS_$(1))"
ENV_RFLAGS_$(1) = RUSTFLAGS="$$(strip $$(CFG_RUSTC_FLAGS)) $$(ENV_RLDFLAGS_$(1))"
ENV_EXT_DEPS_$(1) = EXT_DEPS="$$(DONE_DEPS_$(1))"
# Native builds do not depend on the rust compiler, so we can build them in parallel with rustc
RUSTC_DEP_$(1)=
ifneq "$$(filter $(1),$$(NATIVE_BUILDS))" "$(1)"
RUSTC_DEP_$(1)=$$(CFG_RUSTC)
endif
$(eval $(call DEF_SUBMODULE_DEPS,$(1)))
CROSS_COMPILER_CC = CC=$(CFG_CC)
CROSS_COMPILER_CXX = CXX=$(CFG_CXX)
CROSS_COMPILER_LD = LD=$(CFG_LD)
CROSS_COMPILER_AR = AR=$(CFG_AR)
$$(DONE_$(1)) : $$(DONE_DEPS_$(1)) $$(ROUGH_DEPS_$(1)) $$(RUSTC_DEP_$(1))
# @$$(call E, make: $(1))
# @$$(call E, $(1) deps= $$(DEPS_$(1)))
# @$$(call E, $(1) done_deps= $$(DONE_DEPS_$(1)))
# @$$(call E, $(1) cflags= $$(ENV_CFLAGS_$(1)))
# @$$(call E, $(1) cxxflags= $$(ENV_CXXFLAGS_$(1)))
# @$$(call E, $(1) rflags= $$(ENV_RFLAGS_$(1)))
$$(Q) \
$$(ENV_CFLAGS_$(1)) \
$$(ENV_CXXFLAGS_$(1)) \
$$(ENV_RFLAGS_$(1)) \
$$(ENV_EXT_DEPS_$(1)) \
$$(CROSS_COMPILER_CC) \
$$(CROSS_COMPILER_CXX) \
$$(CROSS_COMPILER_LD) \
$$(CROSS_COMPILER_AR) \
$$(MAKE) -C $$(B)src/$$(PATH_$(1)) && touch $$(DONE_$(1))
# main submodule target
$(1) : $$(DONE_$(1))
.PHONY : $(1)
endef
$(foreach submodule,$(SUBMODULES),\
$(eval $(call DEF_SUBMODULE_RULES,$(submodule))))
DONE_SUBMODULES = $(foreach submodule,$(SUBMODULES),$(DONE_$(submodule)))
RFLAGS_macros = $(addprefix -L $(B)src/,$(DEPS_SUBMODULES))
SRC_macros = $(call rwildcard,$(S)src/components/macros/,*.rs)
CRATE_macros = $(S)src/components/macros/macros.rs
DONE_macros = $(B)src/components/macros/libmacros.dummy
DEPS_macros = $(CRATE_macros) $(SRC_macros) $(DONE_SUBMODULES)
RFLAGS_util = $(addprefix -L $(B)src/,$(DEPS_SUBMODULES))
SRC_util = $(call rwildcard,$(S)src/components/util/,*.rs)
CRATE_util = $(S)src/components/util/util.rs
DONE_util = $(B)src/components/util/libutil.dummy
DEPS_util = $(CRATE_util) $(SRC_util) $(DONE_SUBMODULES)
RFLAGS_net = $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util
SRC_net = $(call rwildcard,$(S)src/components/net/,*.rs)
CRATE_net = $(S)src/components/net/net.rs
DONE_net = $(B)src/components/net/libnet.dummy
DEPS_net = $(CRATE_net) $(SRC_net) $(DONE_SUBMODULES) $(DONE_util)
RFLAGS_msg = $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util
SRC_msg = $(call rwildcard,$(S)src/components/msg/,*.rs)
CRATE_msg = $(S)src/components/msg/msg.rs
DONE_msg = $(B)src/components/msg/libmsg.dummy
DEPS_msg = $(CRATE_msg) $(SRC_msg) $(DONE_SUBMODULES) $(DONE_util)
RFLAGS_gfx = $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util -L $(B)src/components/style -L $(B)src/components/net -L $(B)src/components/msg -L$(B)src/components/macros
SRC_gfx = $(call rwildcard,$(S)src/components/gfx/,*.rs)
CRATE_gfx = $(S)src/components/gfx/gfx.rs
DONE_gfx = $(B)src/components/gfx/libgfx.dummy
DEPS_gfx = $(CRATE_gfx) $(SRC_gfx) $(DONE_SUBMODULES) $(DONE_util) $(DONE_style) $(DONE_net) $(DONE_msg) $(DONE_macros)
RFLAGS_script_traits = $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/msg -L $(B)src/components/net -L $(B)src/components/util
SRC_script_traits = $(call rwildcard,$(S)src/components/script_traits/,*.rs)
CRATE_script_traits = $(S)src/components/script_traits/script_traits.rs
DONE_script_traits = $(B)src/components/script_traits/libscript_traits.dummy
DEPS_script_traits = $(CRATE_script_traits) $(SRC_script_traits) $(DONE_msg) $(DONE_net)
RFLAGS_script = $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util -L $(B)src/components/style -L $(B)src/components/net -L $(B)src/components/msg -L$(B)src/components/macros -L$(B)src/components/gfx -L$(B)src/components/script_traits
BINDINGS_SRC = $(S)src/components/script/dom/bindings/codegen
WEBIDLS_SRC = $(S)src/components/script/dom/webidls
WEBIDLS_script = $(call rwildcard, $(WEBIDLS_SRC), *.webidl)
BINDINGS_script = $(patsubst %.webidl, %Binding.rs, $(WEBIDLS_script))
AUTOGEN_SRC_script = $(foreach var, $(BINDINGS_script), $(subst $(WEBIDLS_SRC), $(BINDINGS_SRC)/Bindings, $(var)))
SRC_script = $(call rwildcard,$(S)src/components/script/,*.rs) $(AUTOGEN_SRC_script)
CRATE_script = $(S)src/components/script/script.rs
DONE_script = $(B)src/components/script/libscript.dummy
DEPS_script = $(CRATE_script) $(SRC_script) $(DONE_SUBMODULES) $(DONE_util) $(DONE_style) $(DONE_net) $(DONE_msg) $(DONE_macros) $(DONE_gfx) $(DONE_script_traits)
RFLAGS_style = $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/util -L$(B)src/components/macros
MAKO_ZIP = $(S)src/components/style/Mako-0.9.1.zip
MAKO_style = $(S)src/components/style/properties/mod.rs
MAKO_SRC_style = $(MAKO_style).mako
SRC_style = $(call rwildcard,$(S)src/components/style/,*.rs) $(call rwildcard,$(S)src/compontents/style/properties/*.rs) $(MAKO_style)
CRATE_style = $(S)src/components/style/style.rs
DONE_style = $(B)src/components/style/libstyle.dummy
DEPS_style = $(CRATE_style) $(SRC_style) $(DONE_SUBMODULES) $(DONE_util) $(DONE_macros)
RFLAGS_layout_traits = $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/script_traits -L $(B)src/components/style -L $(B)src/components/msg
SRC_layout_traits = $(call rwildcard,$(S)src/components/layout_traits/,*.rs)
CRATE_layout_traits = $(S)src/components/layout_traits/layout_traits.rs
DONE_layout_traits = $(B)src/components/layout_traits/liblayout_traits.dummy
DEPS_layout_traits = $(CRATE_layout_traits) $(SRC_layout_traits) $(DONE_script_traits) $(DONE_msg) $(DONE_net) $(DONE_gfx) $(DONE_util)
RFLAGS_layout = $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/script -L $(B)src/components/style -L $(B)src/components/msg -L$(B)src/components/macros -L$(B)src/components/layout_traits -L $(B)src/components/script_traits
SRC_layout = $(call rwildcard,$(S)src/components/layout/,*.rs) $(S)src/components/layout/css/user-agent.css
CRATE_layout = $(S)src/components/layout/layout.rs
DONE_layout = $(B)src/components/layout/liblayout.dummy
DEPS_layout = $(CRATE_layout) $(SRC_layout) $(DONE_script) $(DONE_style) $(DONE_msg) $(DONE_macros) $(DONE_gfx) $(DONE_util) $(DONE_layout_traits)
RFLAGS_compositing = $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/layout_traits -L $(B)src/components/script_traits -L $(B)src/components/style -L $(B)src/components/msg
SRC_compositing = $(call rwildcard,$(S)src/components/compositing/,*.rs)
CRATE_compositing = $(S)src/components/compositing/compositing.rs
DONE_compositing = $(B)src/components/compositing/libcompositing.dummy
DEPS_compositing = $(CRATE_compositing) $(SRC_compositing) $(DONE_util) $(DONE_msg) $(DONE_gfx) $(DONE_layout_traits) $(DONE_script_traits) $(DONE_style)
RFLAGS_servo = $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/script -L $(B)src/components/layout_traits -L $(B)src/components/script_traits -L $(B)src/components/layout -L $(B)src/components/compositing -L $(B)src/components/style -L $(B)src/components/msg -L$(B)src/components/macros
SRC_servo = $(call rwildcard,$(S)src/components/main/,*.rs)
CRATE_servo = $(S)src/components/main/servo.rs
DEPS_servo = $(CRATE_servo) $(SRC_servo) $(DONE_SUBMODULES) $(DONE_util) $(DONE_gfx) $(DONE_script) $(DONE_net) $(DONE_msg) $(DONE_style) $(DONE_macros) $(DONE_layout) $(DONE_layout_traits) $(DONE_script_traits) $(DONE_compositing)
SERVO_LIB_CRATES = macros util net msg gfx script script_traits style layout layout_traits compositing
# rules that depend on having correct meta-target vars (DEPS_CLEAN, DEPS_servo, etc)
# and SERVO_LIB_CRATES
include $(S)mk/check.mk
include $(S)mk/clean.mk
.DEFAULT_GOAL := all
.PHONY: all
# Servo helper libraries
define DEF_LIB_CRATE_RULES
$$(DONE_$(1)): $$(DEPS_$(1))
@$$(call E, compile: $$@)
$$(Q)$$(RUSTC) $(strip $(CFG_RUSTC_FLAGS)) $$(RFLAGS_$(1)) --out-dir $$(B)src/components/$(1) $$< && touch $$@
endef
$(foreach lib_crate,$(SERVO_LIB_CRATES),\
$(eval $(call DEF_LIB_CRATE_RULES,$(lib_crate))))
CACHE_DIR = $(BINDINGS_SRC)/_cache
bindinggen_dependencies := $(addprefix $(BINDINGS_SRC)/, BindingGen.py Bindings.conf Configuration.py CodegenRust.py parser/WebIDL.py ParserResults.pkl Bindings/.done)
$(AUTOGEN_SRC_script): $(BINDINGS_SRC)/Bindings/%Binding.rs: $(bindinggen_dependencies) \
$(addprefix $(WEBIDLS_SRC)/, %.webidl)
@$(call E, "Maybe generating $(shell basename $@)...")
$(Q) $(CFG_PYTHON2) $(BINDINGS_SRC)/pythonpath.py \
-I$(BINDINGS_SRC)/parser -I$(BINDINGS_SRC)/ply \
-D$(BINDINGS_SRC) \
$(BINDINGS_SRC)/BindingGen.py \
$(BINDINGS_SRC)/Bindings.conf Bindings/$*Binding $(addprefix $(WEBIDLS_SRC)/, $*.webidl)
$(Q)touch $@
globalgen_dependencies := $(addprefix $(BINDINGS_SRC)/, GlobalGen.py Bindings.conf Configuration.py CodegenRust.py parser/WebIDL.py) $(CACHE_DIR)/.done $(BINDINGS_SRC)/Bindings/.done
$(MAKO_style): $(MAKO_SRC_style)
# Use a temporary file to avoid writing an empty (but more recent) file on failure.
PYTHONPATH=$(MAKO_ZIP) $(CFG_PYTHON2) -c "from mako.template import Template; print(Template(filename='$<').render())" > $@.tmp
mv $@.tmp $@
$(BINDINGS_SRC)/Bindings/.done:
mkdir -p $(BINDINGS_SRC)/Bindings
@touch $@
$(CACHE_DIR)/.done:
mkdir -p $(CACHE_DIR)
@touch $@
$(BINDINGS_SRC)/ParserResults.pkl: $(globalgen_dependencies) \
$(WEBIDLS_script)
$(Q) $(CFG_PYTHON2) $(BINDINGS_SRC)/pythonpath.py \
-I$(BINDINGS_SRC)/parser -I$(BINDINGS_SRC)/ply \
-D$(BINDINGS_SRC) \
$(BINDINGS_SRC)/GlobalGen.py $(BINDINGS_SRC)/Bindings.conf . \
--cachedir=$(CACHE_DIR) \
$(WEBIDLS_script)
# Servo binaries
ifneq ($(CFG_OSTYPE),linux-androideabi)
all: servo servo-embedding
servo: $(DEPS_servo)
@$(call E, compile: $@)
$(Q)$(RUSTC) $(strip $(CFG_RUSTC_FLAGS)) $(RFLAGS_servo) $< --crate-type bin,dylib,rlib
RFLAGS_embedding = $(addprefix -L $(B)src/,$(DEPS_SUBMODULES)) -L $(B)src/components/gfx -L $(B)src/components/util -L $(B)src/components/net -L $(B)src/components/script -L $(B)src/components/layout -L $(B)src/components/layout_traits -L $(B)src/components/script_traits -L $(B)src/components/compositing -L $(B)src/components/style -L $(B)src/components/msg -L $(B).. -L $(B)src/components/main -L $(B)src/components/macros -A non_camel_case_types -A unused_variable
ifeq ($(CFG_OSTYPE),apple-darwin)
RFLAGS_embedding += -C link-args="-Wl,-U,_tc_new -Wl,-U,_tc_newarray -Wl,-U,_tc_delete -Wl,-U,_tc_deletearray"
endif
SRC_embedding = $(call rwildcard,$(S)src/components/embedding/,*.rs)
CRATE_embedding = $(S)src/components/embedding/embedding.rs
servo-embedding: servo $(SRC_embedding) $(CRATE_embedding)
@$(call E, compile: $@)
$(Q)$(RUSTC) $(strip $(CFG_RUSTC_FLAGS)) $(RFLAGS_embedding) $(CRATE_embedding) --crate-type dylib,rlib
touch servo-embedding
else
all: servo
servo: $(DEPS_servo)
@$(call E, compile: $@)
$(Q)$(RUSTC) $(strip $(CFG_RUSTC_FLAGS)) $(RFLAGS_servo) $< -o libservo.so --crate-type dylib
touch servo
endif
# Darwin app packaging
ifeq ($(CFG_OSTYPE),apple-darwin)
package: servo
mkdir -p Servo.app/Contents/MacOS/src/platform/macos/rust-cocoa
mkdir -p Servo.app/Contents/MacOS/src/platform/macos/rust-task_info
mkdir -p Servo.app/Contents/MacOS/src/support/azure/rust-azure
cp $(S)Info.plist Servo.app/Contents/
cp servo Servo.app/Contents/MacOS/
cp $(B)src/platform/macos/rust-cocoa/lib*.dylib Servo.app/Contents/MacOS/src/platform/macos/rust-cocoa/
cp $(B)src/platform/macos/rust-task_info/lib*.dylib Servo.app/Contents/MacOS/src/platform/macos/rust-task_info/
cp $(B)src/support/azure/rust-azure/lib*.dylib Servo.app/Contents/MacOS/src/support/azure/rust-azure/
else ifeq ($(CFG_OSTYPE),linux-androideabi)
package: servo
mkdir -p sofile
find . ! \( \( -type d -path './sofile' -o -path './$(CFG_TARGET)/src/compiler/rust' -o -path '*/host' \) -prune \) -name '*.so' -type f | xargs -I {} cp -f {} $(CFG_BUILD_HOME)sofile/
find $(CFG_RUST_HOME)/lib/rustlib/$(CFG_TARGET)/lib/ -name '*.so' -type f -size +1c | xargs -I {} cp -f {} $(CFG_BUILD_HOME)sofile/
cd $(S)src/platform/android/servo-android-glue && make with-libs
cd $(CFG_BUILD_HOME)
cp $(S)src/platform/android/servo-android-glue/bin/ServoAndroid-debug.apk $(CFG_BUILD_HOME)
else
.PHONY: package
package:
endif
bindings: $(AUTOGEN_SRC_script)
include $(S)mk/doc.mk
# Backup targets. These axist until build slaves are using Makefile.backup directly.
.PHONY: backup-rust restore-rust
backup-rust:
$(MAKE) -f $(S)Makefile.backup $@
restore-rust:
$(MAKE) -f $(S)Makefile.backup $@