-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile.arch.targ
44 lines (37 loc) · 1.59 KB
/
Makefile.arch.targ
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
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
#
# Copyright (c) 2015, Joyent, Inc.
#
#
# Makefile.arch.targ: this Makefile contains targets that will be sourced twice:
# once for each architecture (ia32 and amd64). This avoids duplicating a bunch
# of recipes that are otherwise identical.
#
# We're able to use the exact same recipe for both 32-bit and 64-bit targets
# because the recipe makes use of target-specific variables that will change the
# command-line as needed. Specifically, CFLAGS and SOFLAGS will change based on
# the architecture, so as long as we use those variables (or other variables
# that use them), we don't need to do anything differently for the two
# architectures.
#
$(MDBV8_BUILD_$(MDBV8_ARCH))/%.o: src/%.c | $(MDBV8_BUILD_$(MDBV8_ARCH))
$(COMPILE.c)
$(MDBV8_BUILD_$(MDBV8_ARCH))/%.o: $(MDBV8_BUILD)/%.c | $(MDBV8_BUILD_$(MDBV8_ARCH))
$(COMPILE.c)
$(MDBV8_DYLIB_$(MDBV8_ARCH)): $(MDBV8_OBJECTS_$(MDBV8_ARCH)) $(EXTRA_STATIC_LIBS_$(MDBV8_ARCH)) | $(LIBAVL_$(MDBV8_ARCH))
$(MAKESO_$(MDBV8_ARCH))
$(MDBV8_BUILD_$(MDBV8_ARCH)):
$(MKDIRP)
#
# Build our private, static libavl by descending into the submodule and running
# its build system. This target depends on the ".git" directory in the
# submodule to trigger another recipe to checkout the submodule as needed.
#
$(LIBAVL_$(MDBV8_ARCH)): $(LIBAVL_SUBMODULE)/.git
BUILD_DIR=$$(pwd)/$(shell dirname $@) \
CFLAGS="-fPIC $(CFLAGS_ARCH)" \
$(MAKE) -C $(LIBAVL_SUBMODULE)