| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 >> $(depfile) | 203 >> $(depfile) |
| 204 rm $(depfile).raw | 204 rm $(depfile).raw |
| 205 endef | 205 endef |
| 206 """ | 206 """ |
| 207 """ | 207 """ |
| 208 # Command definitions: | 208 # Command definitions: |
| 209 # - cmd_foo is the actual command to run; | 209 # - cmd_foo is the actual command to run; |
| 210 # - quiet_cmd_foo is the brief-output summary of the command. | 210 # - quiet_cmd_foo is the brief-output summary of the command. |
| 211 | 211 |
| 212 quiet_cmd_cc = CC($(TOOLSET)) $@ | 212 quiet_cmd_cc = CC($(TOOLSET)) $@ |
| 213 cmd_cc = $(CC.$(TOOLSET)) $(CFLAGS.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) -c -o $
@ $< | 213 cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $
@ $< |
| 214 | 214 |
| 215 quiet_cmd_cxx = CXX($(TOOLSET)) $@ | 215 quiet_cmd_cxx = CXX($(TOOLSET)) $@ |
| 216 cmd_cxx = $(CXX.$(TOOLSET)) $(CXXFLAGS.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) -
c -o $@ $< | 216 cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -
c -o $@ $< |
| 217 | 217 |
| 218 quiet_cmd_alink = AR($(TOOLSET)) $@ | 218 quiet_cmd_alink = AR($(TOOLSET)) $@ |
| 219 cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) $(ARFLAGS.$(TOOLSET)) $@ $(filter %.o,$
^) | 219 cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) $(ARFLAGS.$(TOOLSET)) $@ $(filter %.o,$
^) |
| 220 | 220 |
| 221 quiet_cmd_touch = TOUCH $@ | 221 quiet_cmd_touch = TOUCH $@ |
| 222 cmd_touch = touch $@ | 222 cmd_touch = touch $@ |
| 223 | 223 |
| 224 quiet_cmd_copy = COPY $@ | 224 quiet_cmd_copy = COPY $@ |
| 225 # send stderr to /dev/null to ignore messages when linking directories. | 225 # send stderr to /dev/null to ignore messages when linking directories. |
| 226 cmd_copy = ln -f $< $@ 2>/dev/null || cp -af $< $@ | 226 cmd_copy = ln -f $< $@ 2>/dev/null || cp -af $< $@ |
| 227 | 227 |
| 228 # Due to circular dependencies between libraries :(, we wrap the | 228 # Due to circular dependencies between libraries :(, we wrap the |
| 229 # special "figure out circular dependencies" flags around the entire | 229 # special "figure out circular dependencies" flags around the entire |
| 230 # input list during linking. | 230 # input list during linking. |
| 231 quiet_cmd_link = LINK($(TOOLSET)) $@ | 231 quiet_cmd_link = LINK($(TOOLSET)) $@ |
| 232 cmd_link = $(LINK.$(TOOLSET)) $(LDFLAGS.$(TOOLSET)) $(GYP_LDFLAGS) -o $@ -Wl,--s
tart-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) | 232 cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--s
tart-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) |
| 233 | 233 |
| 234 # Shared-object link (for generating .so). | 234 # Shared-object link (for generating .so). |
| 235 # Set SONAME to the library filename so our binaries don't reference the local, | 235 # Set SONAME to the library filename so our binaries don't reference the local, |
| 236 # absolute paths used on the link command-line. | 236 # absolute paths used on the link command-line. |
| 237 # TODO: perhaps this can share with the LINK command above? | 237 # TODO: perhaps this can share with the LINK command above? |
| 238 quiet_cmd_solink = SOLINK($(TOOLSET)) $@ | 238 quiet_cmd_solink = SOLINK($(TOOLSET)) $@ |
| 239 cmd_solink = $(LINK.$(TOOLSET)) -shared $(LDFLAGS.$(TOOLSET)) $(GYP_LDFLAGS) -Wl
,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-
group $(LIBS) | 239 cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl
,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-
group $(LIBS) |
| 240 """ | 240 """ |
| 241 r""" | 241 r""" |
| 242 # Define an escape_quotes function to escape single quotes. | 242 # Define an escape_quotes function to escape single quotes. |
| 243 # This allows us to handle quotes properly as long as we always use | 243 # This allows us to handle quotes properly as long as we always use |
| 244 # use single quotes and escape_quotes. | 244 # use single quotes and escape_quotes. |
| 245 escape_quotes = $(subst ','\'',$(1)) | 245 escape_quotes = $(subst ','\'',$(1)) |
| 246 # This comment is here just to include a ' to unconfuse syntax highlighting. | 246 # This comment is here just to include a ' to unconfuse syntax highlighting. |
| 247 # Define an escape_vars function to escape '$' variable syntax. | 247 # Define an escape_vars function to escape '$' variable syntax. |
| 248 # This allows us to read/write command lines with shell variables (e.g. | 248 # This allows us to read/write command lines with shell variables (e.g. |
| 249 # $LD_LIBRARY_PATH), without triggering make substitution. | 249 # $LD_LIBRARY_PATH), without triggering make substitution. |
| (...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1392 # Add a check to make sure we tried to process all the .d files. | 1392 # Add a check to make sure we tried to process all the .d files. |
| 1393 all_deps += """ | 1393 all_deps += """ |
| 1394 ifneq ($(word %(last)d,$(d_files)),) | 1394 ifneq ($(word %(last)d,$(d_files)),) |
| 1395 $(error Found unprocessed dependency files (gyp didn't generate enough rules
!)) | 1395 $(error Found unprocessed dependency files (gyp didn't generate enough rules
!)) |
| 1396 endif | 1396 endif |
| 1397 """ % { 'last': ((num_outputs / 1000) + 1) * 1000 + 1 } | 1397 """ % { 'last': ((num_outputs / 1000) + 1) * 1000 + 1 } |
| 1398 | 1398 |
| 1399 root_makefile.write(SHARED_FOOTER % { 'generate_all_deps': all_deps }) | 1399 root_makefile.write(SHARED_FOOTER % { 'generate_all_deps': all_deps }) |
| 1400 | 1400 |
| 1401 root_makefile.close() | 1401 root_makefile.close() |
| OLD | NEW |