OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2009 Google Inc. All rights reserved. | 3 # Copyright (c) 2009 Google Inc. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Notes: | 7 # Notes: |
8 # | 8 # |
9 # This is all roughly based on the Makefile system used by the Linux | 9 # This is all roughly based on the Makefile system used by the Linux |
10 # kernel, but is a non-recursive make -- we put the entire dependency | 10 # kernel, but is a non-recursive make -- we put the entire dependency |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 ) | 118 ) |
119 endef | 119 endef |
120 | 120 |
121 CC.target ?= $(CC) | 121 CC.target ?= $(CC) |
122 CFLAGS.target ?= $(CFLAGS) | 122 CFLAGS.target ?= $(CFLAGS) |
123 CXX.target ?= $(CXX) | 123 CXX.target ?= $(CXX) |
124 CXXFLAGS.target ?= $(CXXFLAGS) | 124 CXXFLAGS.target ?= $(CXXFLAGS) |
125 LINK.target ?= $(LINK) | 125 LINK.target ?= $(LINK) |
126 LDFLAGS.target ?= $(LDFLAGS) | 126 LDFLAGS.target ?= $(LDFLAGS) |
127 AR.target ?= $(AR) | 127 AR.target ?= $(AR) |
128 # We don't want to run the detection multiple times. So, we | 128 # We detect arflags at compile-time (see detect_arflags above), but we |
| 129 # don't want to run the detection multiple times. So, we |
129 # - use $(obj).target/arflags/arflags.target.mk as the cache of the detection, | 130 # - use $(obj).target/arflags/arflags.target.mk as the cache of the detection, |
130 # - use := to avoid the right hand side multiple times, and | 131 # - use := to avoid the right hand side multiple times, and |
131 # - use ifeq instead of ?= because ?= is like ifeq and =, not ifeq and := . | 132 # - use ifeq instead of ?= because ?= is like ifeq and =, not ifeq and := . |
132 -include $(obj).target/arflags/arflags.mk | 133 -include $(obj).target/arflags/arflags.mk |
133 ifeq ($(ARFLAGS.target),) | 134 ifeq ($(ARFLAGS.target),) |
134 ARFLAGS.target := $(call detect_arflags,target) | 135 # Temporarily disabling detect_arflags call due to a bug in gold with the |
| 136 # detected flag. |
| 137 # TODO(evan): reenable this once there is a release of gold > 2.20.1. |
| 138 # ARFLAGS.target := $(call detect_arflags,target) |
| 139 ARFLAGS.target := crs |
135 endif | 140 endif |
136 | 141 |
137 CC.host ?= gcc | 142 CC.host ?= gcc |
138 CFLAGS.host ?= | 143 CFLAGS.host ?= |
139 CXX.host ?= g++ | 144 CXX.host ?= g++ |
140 CXXFLAGS.host ?= | 145 CXXFLAGS.host ?= |
141 LINK.host ?= g++ | 146 LINK.host ?= g++ |
142 LDFLAGS.host ?= | 147 LDFLAGS.host ?= |
143 AR.host ?= ar | 148 AR.host ?= ar |
144 # See the description for ARFLAGS.target. | 149 # See the description for ARFLAGS.target. |
145 -include $(obj).host/arflags/arflags.mk | 150 -include $(obj).host/arflags/arflags.mk |
146 ifeq ($(ARFLAGS.host),) | 151 ifeq ($(ARFLAGS.host),) |
147 ARFLAGS.host := $(call detect_arflags,host) | 152 # Temporarily disabled -- see ARFLAGS.target. |
| 153 # ARFLAGS.host := $(call detect_arflags,host) |
| 154 ARFLAGS.host := crs |
148 endif | 155 endif |
149 | 156 |
150 # Flags to make gcc output dependency info. Note that you need to be | 157 # Flags to make gcc output dependency info. Note that you need to be |
151 # careful here to use the flags that ccache and distcc can understand. | 158 # careful here to use the flags that ccache and distcc can understand. |
152 # We write to a dep file on the side first and then rename at the end | 159 # We write to a dep file on the side first and then rename at the end |
153 # so we can't end up with a broken dep file. | 160 # so we can't end up with a broken dep file. |
154 depfile = $(depsdir)/$@.d | 161 depfile = $(depsdir)/$@.d |
155 DEPFLAGS = -MMD -MF $(depfile).raw | 162 DEPFLAGS = -MMD -MF $(depfile).raw |
156 | 163 |
157 # We have to fixup the deps output in a few ways. | 164 # We have to fixup the deps output in a few ways. |
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 makefile_name, | 1313 makefile_name, |
1307 ' '.join(map(Sourceify, build_files)), | 1314 ' '.join(map(Sourceify, build_files)), |
1308 gyp.common.EncodePOSIXShellList( | 1315 gyp.common.EncodePOSIXShellList( |
1309 [gyp_binary, '-fmake'] + | 1316 [gyp_binary, '-fmake'] + |
1310 gyp.RegenerateFlags(options) + | 1317 gyp.RegenerateFlags(options) + |
1311 build_files_args))) | 1318 build_files_args))) |
1312 | 1319 |
1313 root_makefile.write(SHARED_FOOTER) | 1320 root_makefile.write(SHARED_FOOTER) |
1314 | 1321 |
1315 root_makefile.close() | 1322 root_makefile.close() |
OLD | NEW |