HOST_darwin-x86.mk revision 9b4a81237be29b0aae50d1e370b63a07ea2b88b9
1#
2# Copyright (C) 2006 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17# Configuration for Darwin (Mac OS X) on x86.
18# Included by combo/select.mk
19
20HOST_GLOBAL_CFLAGS += -fPIC
21HOST_NO_UNDEFINED_LDFLAGS := -Wl,-undefined,error
22
23HOST_CC := $(CC)
24HOST_CXX := $(CXX)
25HOST_AR := $(AR)
26
27HOST_SHLIB_SUFFIX := .dylib
28HOST_JNILIB_SUFFIX := .jnilib
29
30HOST_GLOBAL_CFLAGS += \
31	-include $(call select-android-config-h,darwin-x86)
32HOST_RUN_RANLIB_AFTER_COPYING := true
33HOST_GLOBAL_ARFLAGS := cqs
34
35HOST_CUSTOM_LD_COMMAND := true
36
37define transform-host-o-to-shared-lib-inner
38    $(HOST_CXX) \
39        -dynamiclib -single_module -read_only_relocs suppress \
40        $(HOST_GLOBAL_LD_DIRS) \
41        $(PRIVATE_ALL_OBJECTS) \
42        $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
43        $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
44        $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
45        $(PRIVATE_LDLIBS) \
46        -o $@ \
47        $(PRIVATE_LDFLAGS) \
48        $(HOST_LIBGCC)
49endef
50
51define transform-host-o-to-executable-inner
52$(HOST_CXX) \
53        -o $@ \
54        -Wl,-dynamic -headerpad_max_install_names \
55        $(HOST_GLOBAL_LD_DIRS) \
56        $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
57        $(PRIVATE_ALL_OBJECTS) \
58        $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
59        $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
60        $(PRIVATE_LDFLAGS) \
61        $(PRIVATE_LDLIBS) \
62        $(HOST_LIBGCC)
63endef
64
65# $(1): The file to check
66define get-file-size
67stat -f "%z" $(1)
68endef
69