403Webshell
Server IP : 46.62.235.243  /  Your IP : 216.73.216.163
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux Linkabili3Dicembre 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.1.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/gyp/generator/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/gyp/generator/__pycache__/make.cpython-312.pyc
�

K��b�i���ddlmZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddlm
Z
ddlZddddddd	d
ddd
dddd�ZdZ
dagagagadad�Zd�ZdZdZdZdZdZdZdezdzezdzezdzezd zezd!zZd"Zd#�Zd$Zd%Zd&Z d'Z!d(d)d)d)d(d(d*�Z"d+�Z#d,�Z$d-�Z%d.�Z&d/�Z'd0�Z(d1�Z)d2�Z*da+d3�Z,d;d4�Z-d5�Z.iZ/iZ0Gd6�d7e1�Z2d8�Z3d9�Z4d:�Z5y)<�)�print_functionN)�GetEnvironFallback)�GypError��lib�.az $(obj).$(TOOLSET)/$(TARGET)/geniz
$(obj)/gen�$(builddir)�%(INPUT_ROOT)s�%(INPUT_DIRNAME)sz
$(abspath $<)z$(suffix $<)z$(notdir $<)�$(BUILDTYPE))�EXECUTABLE_PREFIX�EXECUTABLE_SUFFIX�STATIC_LIB_PREFIX�SHARED_LIB_PREFIX�STATIC_LIB_SUFFIX�INTERMEDIATE_DIR�SHARED_INTERMEDIATE_DIR�PRODUCT_DIR�RULE_INPUT_ROOT�RULE_INPUT_DIRNAME�RULE_INPUT_PATH�RULE_INPUT_EXT�RULE_INPUT_NAME�CONFIGURATION_NAMETFc�\�tjj|�}|dk(r�|jdd�|jdd�|jdtd�|jdtd�dd	lmcm}t|d
g�a	t|dg�a
t|dg�atjd
dd��y	|}|dk(rd}|jd|�|dk(r|jdd�n|jdd�|jdd�|jdd�y	)zDCalculate additional variables for use in the build (called by gyp).�mac�OS�SHARED_LIB_SUFFIXz.dylib�SHARED_LIB_DIRr�LIB_DIRrN�+generator_additional_non_configuration_keys�"generator_additional_path_sections�!generator_extra_sources_for_rules�objc�objcxx)�.m�.mm�android�linux�aixr�.soz$(builddir)/lib.$(TOOLSET)z$(obj).$(TOOLSET))�gyp�common�	GetFlavor�
setdefault�generator_default_variables�gyp.generator.xcode�	generator�xcode�getattrr!r"r#�COMPILABLE_EXTENSIONS�update)�default_variables�params�flavor�xcode_generator�operating_systems     �4/usr/lib/python3/dist-packages/gyp/generator/make.py�CalculateVariablesr=Ds7���:�:����'�&��u�_�� � ��u�-�� � �!4�h�?�� � �!1�!<�]�!K�M�� � ��!<�]�!K�M�
2�1�29�/�5�r�3;�/�*1��,�b�*2�&�)0��+�R�)1�%�� � ���!A�B���
��� ��� � ��'7�8�
����"�"�#6��=��"�"�#6��>�� � �!1�2N�O�� � ��,?�@�c�X�|jdi�}|jdd�}|rda|djxs|dj}|jdd�}tj
j
tj
j||d��}|dj|d	�ay)
zOCalculate the generator specific info that gets fed to input (called by
  gyp).�generator_flags�android_ndk_versionNT�options�
output_dir�out�gypfiles)�toplevel�qualified_out_dir)	�get�#generator_wants_sorted_dependencies�generator_output�toplevel_dir�os�path�normpath�join�generator_filelist_paths)r8r@rArC�
builddir_namerGs      r<�CalculateGeneratorInputInforRis����J�J�0�"�5�/�'�+�+�,A�4�H���*.�'��i� �1�1�.��i� �-�-�
�!�%�%�l�E�:�-��g�g�&�&�r�w�w�|�|��
�z�(+�,��
�y�!�.�.�*��r>�?a�quiet_cmd_alink = AR($(TOOLSET)) $@
cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)

quiet_cmd_alink_thin = AR($(TOOLSET)) $@
cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)

# Due to circular dependencies between libraries :(, we wrap the
# special "figure out circular dependencies" flags around the entire
# input list during linking.
quiet_cmd_link = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group

# We support two kinds of shared objects (.so):
# 1) shared_library, which is just bundling together many dependent libraries
# into a link line.
# 2) loadable_module, which is generating a module intended for dlopen().
#
# They differ only slightly:
# In the former case, we want to package all dependent code into the .so.
# In the latter case, we want to package just the API exposed by the
# outermost module.
# This means shared_library uses --whole-archive, while loadable_module doesn't.
# (Note that --whole-archive is incompatible with the --start-group used in
# normal linking.)

# Other shared-object link notes:
# - Set SONAME to the library filename so our binaries don't reference
# the local, absolute paths used on the link command-line.
quiet_cmd_solink = SOLINK($(TOOLSET)) $@
cmd_solink = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)

quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
cmd_solink_module = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)
ahquiet_cmd_alink = LIBTOOL-STATIC $@
cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)

quiet_cmd_link = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)

quiet_cmd_solink = SOLINK($(TOOLSET)) $@
cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)

quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
a�quiet_cmd_alink = AR($(TOOLSET)) $@
cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)

quiet_cmd_alink_thin = AR($(TOOLSET)) $@
cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)

# Due to circular dependencies between libraries :(, we wrap the
# special "figure out circular dependencies" flags around the entire
# input list during linking.
quiet_cmd_link = LINK($(TOOLSET)) $@
quiet_cmd_link_host = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)
cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)

# Other shared-object link notes:
# - Set SONAME to the library filename so our binaries don't reference
# the local, absolute paths used on the link command-line.
quiet_cmd_solink = SOLINK($(TOOLSET)) $@
cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)

quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)
quiet_cmd_solink_module_host = SOLINK_MODULE($(TOOLSET)) $@
cmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
a�quiet_cmd_alink = AR($(TOOLSET)) $@
cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)

quiet_cmd_alink_thin = AR($(TOOLSET)) $@
cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^)

quiet_cmd_link = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)

quiet_cmd_solink = SOLINK($(TOOLSET)) $@
cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)

quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
a�quiet_cmd_alink = AR($(TOOLSET)) $@
cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)

quiet_cmd_alink_thin = AR($(TOOLSET)) $@
cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)

quiet_cmd_link = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)

quiet_cmd_solink = SOLINK($(TOOLSET)) $@
cmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) -Wl,DLL

quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
cmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL
a.	# We borrow heavily from the kernel build setup, though we are simpler since
# we don't have Kconfig tweaking settings on us.

# The implicit make rules have it looking for RCS files, among other things.
# We instead explicitly write all the rules we care about.
# It's even quicker (saves ~200ms) to pass -r on the command line.
MAKEFLAGS=-r

# The source directory tree.
srcdir := %(srcdir)s
abs_srcdir := $(abspath $(srcdir))

# The name of the builddir.
builddir_name ?= %(builddir)s

# The V=1 flag on command line makes us verbosely print command lines.
ifdef V
  quiet=
else
  quiet=quiet_
endif

# Specify BUILDTYPE=Release on the command line for a release build.
BUILDTYPE ?= %(default_configuration)s

# Directory all our build output goes into.
# Note that this must be two directories beneath src/ for unit tests to pass,
# as they reach into the src/ directory for data with relative paths.
builddir ?= $(builddir_name)/$(BUILDTYPE)
abs_builddir := $(abspath $(builddir))
depsdir := $(builddir)/.deps

# Object output directory.
obj := $(builddir)/obj
abs_obj := $(abspath $(obj))

# We build up a list of every single one of the targets so we can slurp in the
# generated dependency rule Makefiles in one pass.
all_deps :=

%(make_global_settings)s

CC.target ?= %(CC.target)s
CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS)
CXX.target ?= %(CXX.target)s
CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS)
LINK.target ?= %(LINK.target)s
LDFLAGS.target ?= $(LDFLAGS)
AR.target ?= $(AR)

# C++ apps need to be linked with g++.
LINK ?= $(CXX.target)

# TODO(evan): move all cross-compilation logic to gyp-time so we don't need
# to replicate this environment fallback in make as well.
CC.host ?= %(CC.host)s
CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host)
CXX.host ?= %(CXX.host)s
CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host)
LINK.host ?= %(LINK.host)s
LDFLAGS.host ?= $(LDFLAGS_host)
AR.host ?= %(AR.host)s

# Define a dir function that can handle spaces.
# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions
# "leading spaces cannot appear in the text of the first argument as written.
# These characters can be put into the argument value by variable substitution."
empty :=
space := $(empty) $(empty)

# http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces
replace_spaces = $(subst $(space),z ,$1)
unreplace_spaces = $(subst a,$(space),$1)
dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1)))

# Flags to make gcc output dependency info.  Note that you need to be
# careful here to use the flags that ccache and distcc can understand.
# We write to a dep file on the side first and then rename at the end
# so we can't end up with a broken dep file.
depfile = $(depsdir)/$(call replace_spaces,$@).d
DEPFLAGS = %(makedep_args)s -MF $(depfile).raw

# We have to fixup the deps output in a few ways.
# (1) the file output should mention the proper .o file.
# ccache or distcc lose the path to the target, so we convert a rule of
# the form:
#   foobar.o: DEP1 DEP2
# into
#   path/to/foobar.o: DEP1 DEP2
# (2) we want missing files not to cause us to fail to build.
# We want to rewrite
#   foobar.o: DEP1 DEP2 \
#               DEP3
# to
#   DEP1:
#   DEP2:
#   DEP3:
# so if the files are missing, they're just considered phony rules.
# We have to do some pretty insane escaping to get those backslashes
# and dollar signs past make, the shell, and sed at the same time.
# Doesn't work with spaces, but that's fine: .d files have spaces in
# their names replaced with other characters.
define fixup_dep
# The depfile may not exist if the input file didn't have any #includes.
touch $(depfile).raw
# Fixup path as in (1).
sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile)
# Add extra rules as in (2).
# We remove slashes and replace spaces with new lines;
# remove blank lines;
# delete the first line and append a colon to the remaining lines.
sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\
  grep -v '^$$'                             |\
  sed -e 1d -e 's|$$|:|'                     \
    >> $(depfile)
rm $(depfile).raw
endef

# Command definitions:
# - cmd_foo is the actual command to run;
# - quiet_cmd_foo is the brief-output summary of the command.

quiet_cmd_cc = CC($(TOOLSET)) $@
cmd_cc = $(CC.$(TOOLSET)) -o $@ $< $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c

quiet_cmd_cxx = CXX($(TOOLSET)) $@
cmd_cxx = $(CXX.$(TOOLSET)) -o $@ $< $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c
%(extra_commands)s
quiet_cmd_touch = TOUCH $@
cmd_touch = touch $@

quiet_cmd_copy = COPY $@
# send stderr to /dev/null to ignore messages when linking directories.
cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp %(copy_archive_args)s "$<" "$@")

%(link_commands)s

# Define an escape_quotes function to escape single quotes.
# This allows us to handle quotes properly as long as we always use
# use single quotes and escape_quotes.
escape_quotes = $(subst ','\'',$(1))
# This comment is here just to include a ' to unconfuse syntax highlighting.
# Define an escape_vars function to escape '$' variable syntax.
# This allows us to read/write command lines with shell variables (e.g.
# $LD_LIBRARY_PATH), without triggering make substitution.
escape_vars = $(subst $$,$$$$,$(1))
# Helper that expands to a shell command to echo a string exactly as it is in
# make. This uses printf instead of echo because printf's behaviour with respect
# to escape sequences is more portable than echo's across different shells
# (e.g., dash, bash).
exact_echo = printf '%%s\n' '$(call escape_quotes,$(1))'

# Helper to compare the command we're about to run against the command
# we logged the last time we ran the command.  Produces an empty
# string (false) when the commands match.
# Tricky point: Make has no string-equality test function.
# The kernel uses the following, but it seems like it would have false
# positives, where one string reordered its arguments.
#   arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
#                       $(filter-out $(cmd_$@), $(cmd_$(1))))
# We instead substitute each for the empty string into the other, and
# say they're equal if both substitutions produce the empty string.
# .d files contain aa instead of spaces, take that into account.
command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\
                       $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1))))

# Helper that is non-empty when a prerequisite changes.
# Normally make does this implicitly, but we force rules to always run
# so we can check their command lines.
#   $? -- new prerequisites
#   $| -- order-only dependencies
prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?))

# Helper that executes all postbuilds until one fails.
define do_postbuilds
  @E=0;\
  for p in $(POSTBUILDS); do\
    eval $$p;\
    E=$$?;\
    if [ $$E -ne 0 ]; then\
      break;\
    fi;\
  done;\
  if [ $$E -ne 0 ]; then\
    rm -rf "$@";\
    exit $$E;\
  fi
endef

# do_cmd: run a command via the above cmd_foo names, if necessary.
# Should always run for a given target to handle command-line changes.
# Second argument, if non-zero, makes it do asm/C/C++ dependency munging.
# Third argument, if non-zero, makes it do POSTBUILDS processing.
# Note: We intentionally do NOT call dirx for depfile, since it contains z* for
# spaces already and dirx strips the a� characters.
define do_cmd
$(if $(or $(command_changed),$(prereq_changed)),
  @$(call exact_echo,  $($(quiet)cmd_$(1)))
  @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))"
  $(if $(findstring flock,$(word %(flock_index)d,$(cmd_$1))),
    @$(cmd_$(1))
    @echo "  $(quiet_cmd_$(1)): Finished",
    @$(cmd_$(1))
  )
  @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile)
  @$(if $(2),$(fixup_dep))
  $(if $(and $(3), $(POSTBUILDS)),
    $(call do_postbuilds)
  )
)
endef

# Declare the "%(default_target)s" target first so it is the default,
# even though we don't have the deps yet.
.PHONY: %(default_target)s
%(default_target)s:

# make looks for ways to re-generate included makefiles, but in our case, we
# don't have a direct way. Explicitly telling make that it has nothing to do
# for them makes it go faster.
%%.d: ;

# Use FORCE_DO_CMD to force a target to run.  Should be coupled with
# do_cmd.
.PHONY: FORCE_DO_CMD
FORCE_DO_CMD:

a�
quiet_cmd_objc = CXX($(TOOLSET)) $@
cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<

quiet_cmd_objcxx = CXX($(TOOLSET)) $@
cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<

# Commands for precompiled header files.
quiet_cmd_pch_c = CXX($(TOOLSET)) $@
cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<
quiet_cmd_pch_cc = CXX($(TOOLSET)) $@
cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<
quiet_cmd_pch_m = CXX($(TOOLSET)) $@
cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<
quiet_cmd_pch_mm = CXX($(TOOLSET)) $@
cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<

# gyp-mac-tool is written next to the root Makefile by gyp.
# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd
# already.
quiet_cmd_mac_tool = MACTOOL $(4) $<
cmd_mac_tool = ./gyp-mac-tool $(4) $< "$@"

quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@
cmd_mac_package_framework = ./gyp-mac-tool package-framework "$@" $(4)

quiet_cmd_infoplist = INFOPLIST $@
cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@"
c�*�ttj�tj��}|jd�|D]1}|jd|z�|jdt|z��3|jd�|D]1}|jd|z�|jdt|z��3|jd�|D]1}|jd|z�|jdt|z��3|jd�y)	N)�key�1# Suffix rules, putting all outputs into $(obj).
z4$(obj).$(TOOLSET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD
z	@$(call do_cmd,%s,1)
z,
# Try building from generated source, too.
z<$(obj).$(TOOLSET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD
�
z1$(obj).$(TOOLSET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
)�sortedr5�keys�str�lower�write)�writer�
extensions�exts   r<�WriteRootHeaderSuffixRulesr`s���+�0�0�2��	�	�B�*��,�,�C�D�
�J�c�
�L�L�H�3�N�O�
�L�L�+�.C�C�.H�H�I�J�	�,�,�?�@�
�J�c�
�L�L�G�#�M�O�
�L�L�+�.C�C�.H�H�I�J�	�,�,�t��
�J�c�
�L�L�E��K�L�
�L�L�+�.C�C�.H�H�I�J�	�,�,�t�r>rVz+# Try building from generated source, too.
a�# "all" is a concatenation of the "all" targets from all the included
# sub-makefiles. This is just here to clarify.
all:

# Add in dependency-tracking rules.  $(all_deps) is the list of every single
# target in our tree. Only consider the ones with .d (dependency) info:
d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d))
ifneq ($(d_files),)
  include $(d_files)
endif
z/# This file is generated by gyp; do not edit.

�cc�cxx)�.c�.cc�.cpp�.cxx�.s�.Sc�6���fd�tD�D]}|s�yy)z:Return true if the file is compilable (should be in OBJS).c3�@�K�|]}�j|����y�w�N��endswith)�.0�e�filenames  �r<�	<genexpr>zCompilable.<locals>.<genexpr>Js�����
B�q�h����"�
B�s�TF)r5)rp�ress` r<�
CompilablersHs#���
B�,A�
B��c�
�
��
r>c�$�|jd�S)zAReturn true if the file is linkable (should be on the link line).�.orl�rps r<�LinkablerwPs��	�	�	�4�	 � r>c�L�tjj|�ddzS)z1Translate a compilable filename to its .o target.rru)rLrM�splitextrvs r<�TargetrzUs!��	���	�	�(�	#�A�	&��	-�-r>c�2�d|jdd�zdzS)z�Quotes an argument so that it will be interpreted literally by a POSIX
     shell. Taken from
     http://stackoverflow.com/questions/35817/whats-the-best-way-to-escape-ossystem-calls-in-python
     �'z'\''��replace��ss r<�EscapeShellArgumentr�Zs��


�q�y�y��g�&�	&��	,�,r>c�&�|jdd�S)zrMake has its own variable expansion syntax using $. We must escape it for
     string to be interpreted literally.�$z$$r}rs r<�EscapeMakeVariableExpansionr�bs��
���3��	�r>c�R�t|�}t|�}|jdd�S)zBEscapes a CPP define so that it will reach the compiler unaltered.�#z\#)r�r�r~rs r<�EscapeCppDefiner�hs)���!��!�!�!�$�!�
���3��	�r>c�>�d|vrd|jdd�zdz}|S)zSTODO: Should this ideally be replaced with one or more of the above
     functions?�"z\"r}��strings r<�QuoteIfNecessaryr�qs*��	�F�]�
�6�>�>�#�u�-�
-��
3�F�	�-r>c�0�tjdd|�S)zGConvert a string to a value that is acceptable as a make variable name.z
[^a-zA-Z0-9_]�_)�re�subr�s r<�StringToMakefileVariabler�ys��	�����f�	-�-r>c�b�d|vr|Stjj|�r|St|zS)z,Convert a path to its source directory form.�$()rLrM�isabs�
srcdir_prefix)rMs r<�	Sourceifyr�s.��	�T�\��K��W�W�]�]�4���K�	��	�r>c�&�|jd|�S)N� r})r��quotes  r<�QuoteSpacesr��s��	
���3��	�r>c���|jdd�dk7ryi}|D]k}tjj|�\}}|dv}|s�,tjj	|�}|j|g�j
|��md}|j�D]/\}}	t|	�dkDs�|d|�dd	j|	��d
�z
}�1|r%td|dz|zd
zdz�td��y)z�Makes sure if duplicate basenames are not specified in the source list.

  Arguments:
    spec: The target dictionary containing the properties of the target.
  �typeN�static_library)rcrdrerfr&r'rgrhr��  �: r�rWz<static library %s has several files with the same basename:
�target_namezlibtool on OS X will generatez warnings for them.z6Duplicate basenames in sources section, see list above)rHrLrMry�basenamer/�append�items�lenrO�printr)
�spec�all_sources�	basenames�source�namer_�is_compiled_filer��error�filess
          r<�_ValidateSourcesForOSXr��s��
�X�X�f�d��/�/�
��)��6�f���� � ��(�I�D�#��>�>�����w�w����%�H�
����2�&�-�-�f�5�6�
�%�"���*�:�o�h��
�5�z�A�~��x����%��9�9�e�:��	�
I�
�}�
�� %�&�(G�H�
� �!��K�
L�L�	r>c���eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zddefd�Z		d#d�Z		d$d�Zd�Zd%d�Zd&d�Zd�Zd�Zd�Zd�Z d �Z!d!�Z"d"�Z#y)'�MakefileWriterz�MakefileWriter packages up the writing of one target-specific foobar.mk.

  Its only real entry point is Write(), and is mostly used for namespacing.
  c	�~�||_||_i|_i|_i|_t
j
�D]�}|jj|d|�dt
|�d�i�|jj|d|�dt
|�d�i�|jj|d|�dt
|�d�i���y)Nz,$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%z FORCE_DO_CMD
	@$(call do_cmd,z,1)
z4$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%z)$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%)r@r9�suffix_rules_srcdir�suffix_rules_objdir1�suffix_rules_objdir2r5rYr6)�selfr@r9r_s    r<�__init__zMakefileWriter.__init__�s���*�D���D�K�!�D�� "�D�� "�D��%�)�)�+�+��
���%�%�s��!�#�&�.(�'*�+����&�&���!�#�&�/(�(*�+����&�&���!�#�&�/(�(*�+�+r>c
�
��tjj|�t|d��_�jjt�|�_|�_|d�_	|d�_
|d�_tjj�j|��_�jdk(r%tjj!|��_nd�_�j%|�\}}g}	g}
g}g}g}
�jr-�j'|��_�j+|��_n�j/|�x�_�_t1|j3dd���_d	�_�j4s�j�j6vr?t8jj;�j(��_�j?�}n�j(�_�j(}�jAd
�jz��jAd�jz�d|vr�jC|d|
|	||�d
|vr�jE|d
|
|	||�d|vr�jG|d|	|��jr8|j3dg�|z}�jI||
��jK|
�|j3dg�|
z}|�r��jdk(rtM||��jO||||	||tjjQ�j"�fd��jR��|D�cgc]}tU|�s�|��}}|�r7�jAtV�tY|D�cgc]$}t8jj[|�d��&c}�}|D]/}|�j\vs��jA�j\|��1�jAt^�|D]/}|�j`vs��jA�j`|��1|D]/}|�jbvs��jA�jb|��1�jAd��jr|
je�j,��jg|||||z|
|	|�|th|<�jdvr�j,tj|<�jlj3dd�r�jo�j||��jjq�ycc}wcc}w)a�The main entry point: writes a .mk file for a single target.

    Arguments:
      qualified_target: target we're generating
      base_path: path relative to source root we're building in, used to resolve
                 target-relative paths
      output_filename: output .mk file name to write
      spec, configs: gyp info
      part_of_all: flag indicating this target is part of 'all'
    �wr�r��toolsetrN�standalone_static_libraryr)�
executable�loadable_module�shared_libraryzTOOLSET := z
TARGET := �actions�rules�copies�mac_bundle_resources�sourcesc�8��t�j|��Srk�r��
Absolutify��pr�s �r<�<lambda>z&MakefileWriter.Write.<locals>.<lambda>3s���Y�t���q�7I�-J�r>r�z!# End of this set of suffix rules)r�r�rA)9r,r-�EnsureDirExists�open�fpr\�header�qualified_targetrM�targetr�r��xcode_emulation�IsMacBundler9�
is_mac_bundle�
XcodeSettings�xcode_settings�ComputeDeps�ComputeMacBundleOutput�output�ComputeMacBundleBinaryOutput�
output_binary�
ComputeOutput�boolrH�is_standalone_static_library�_INSTALLABLE_TARGETSrLr��alias�_InstallableTargetInstallPath�WriteLn�WriteActions�
WriteRules�WriteCopies�WriteMacBundleResources�WriteMacInfoPlistr��WriteSources�MacPrefixHeader�Pchifyrs�#SHARED_HEADER_SUFFIX_RULES_COMMENT1�setryr��#SHARED_HEADER_SUFFIX_RULES_COMMENT2r�r�r��WriteTarget�target_outputs�target_link_depsr@�WriteAndroidNdkModuleRule�close)r�r��	base_path�output_filenamer��configs�part_of_all�deps�	link_deps�
extra_outputs�
extra_sources�extra_link_deps�extra_mac_bundle_resources�mac_bundle_deps�install_path�all_mac_bundle_resourcesr��xr�r�r^r_s`                     r<�WritezMakefileWriter.Write�s�����J�J����/��?�C�(�D�G��G�G�M�M�&��,�D���D�I��}�%�D�K��V��D�I��	�?�D�L��,�,�8�8����d�K�D���{�{�e���/�/�=�=�d�C�d�� �d���&�&�t�,�O�D�)�
�M��M��O�!#���O�����/�/��5�d�k��<�<�T�B�d��)-�);�);�D�)A�A�d�k�D�&�(,����,�a�0�)2�D�%�!3�D���)�)��	�	�T�.�.�.��7�7�#�#�D�K�K�0�d�j��7�7�9�l��;�;�d�j��[�[�l��L�L�����-�.��L�L�����+�,��D��
����Y���
�2�K�A��$��
�o�o�d�7�m�]�M�0�+�?��4��
���t�H�~�}�k�B����
�(�(�)�2�
.�1K�
K��
�"�"�#;�_�M�
���_�-��(�(�9�b�)�M�9�K��	
����	�	�t�[�1�
���
�4��m�
�;�

�
�
�
-�
-��!�!�#J��k�k���(�9�q�:�a�=��9�g�9�	����8�9��'�B�Q�"�'�'�*�*�1�-�a�0�B�C�
��	8�C�
�D�,�,�
,��L�L��1�1�#�6�7�	8�	
���8�9��	9�C�
�D�-�-�
-��L�L��2�2�3�7�8�	9��	9�C�
�D�-�-�
-��L�L��2�2�3�7�8�	9�	
���8�9����
�
 �
 ��!3�!3�
4����T�7�D�/�I�*E�$�m�[�B�(4�N�#�$��y�y�8�8�+/�+=�+=��'�(������ 5�t�<�
�$�$�T�[�[�+�y�I��G�G�M�M�O��G:��Cs�U�)U�)Uc��tjj|�t|d�|_|jjt�|jdtjjtjj|�|�z�|jd�|jd�|rd|z}|jd|�ddj|����|jj�y)	a�Write a "sub-project" Makefile.

    This is a small, wrapper Makefile that calls the top-level Makefile to build
    the targets from a single gyp file (i.e. a sub-project).

    Arguments:
      output_filename: sub-project Makefile name to write
      makefile_path: path to the top-level Makefile
      targets: list of "all" targets for this sub-project
      build_dir: build output directory, relative to the sub-project
    r�zexport builddir_name ?= %sz.PHONY: allzall:z -C z	$(MAKE)r�N)
r,r-r�r�r�r\r�r�rLrMrO�dirnamer�)r�r��
makefile_path�targets�	build_dirs     r<�WriteSubMakezMakefileWriter.WriteSubMake[s����J�J����/��?�C�(�D�G��G�G�M�M�&��	�L�L�-������b�g�g�o�o�o�>�	�J�K�L��L�L����L�L�����}�,�m��L�L�]�C�H�H�W�4E�F�G��G�G�M�M�Or>c��|j�}|D�]�}t|j�d|d���}|jd|dz�|d}	|d}
t	�}|
D]8}t
jj|�d}
|
s�(|j|
��:t|jdd��r||
z
}t|jd	d��r||
z
}|d
}|jdk(r-|D�cgc]"}tjj||���$}}tjj!|�}d|vr|jd
|�d|d�d��n|jd
|�d|�d��t#|�dkDrddj%|�zdz|z}dt'|jxsd�z}|j)d|j*�}|j)d|j*�}|jd|�d|�|���|j�|
D�cgc]}|j-|���}
}|jdt/|
d�z�|jdt/|
d�z�|j1|
d|j��|	D]}d|vr�Jd|z��|
D]}d|vr�Jd|z��|
D�cgc]"}tjj||���$}
}|	D�cgc]"}tjj||���$}	}|j3|
t5t&t5|j,|	��||��d|z}|j|�ddj%|
����|j7d|z�|j����|j�y cc}wcc}wcc}wcc}w)!a�Write Makefile code for any 'actions' from the gyp input.

    extra_sources: a list that will be filled in with newly generated source
                   files, if any
    extra_outputs: a list that will be filled in with any outputs of these
                   actions (used to make other pieces dependent on these
                   actions)
    part_of_all: flag indicating this target is part of 'all'
    r��action_namez### Rules for action "%s":�inputs�outputsr�process_outputs_as_sourcesF�'process_outputs_as_mac_bundle_resources�actionr�message�
quiet_cmd_z
 = ACTION z $@zmkdir -p %sr�z; �cd %s; �.�	$(TARGET)�cmd_zj = LD_LIBRARY_PATH=$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; �%s: obj := $(abs_obj)�%s: builddir := $(abs_builddir)z3Spaces in action input filenames not supported (%s)z4Spaces in action output filenames not supported (%s))r��commandzaction_%s_outputs� := �$(%s)N)�GetSortedXcodeEnvr�r�r�r�rLrM�split�add�intrHr9r,r��
ExpandEnvVarsr-�EncodePOSIXShellListr�rOr�r~r�r�r��WriteSortedXcodeEnv�
WriteDoCmd�mapr�)r�r�r�r�r�r��envrr�rr	�dirsrD�dir�action_commandsr�	cd_action�o�inputr��i�outputs_variables                      r<r�zMakefileWriter.WriteActionsvs����
 �
 �
"�C��S��
%��1F�1F�17�
�1F�'H�I�d�
�l�l�/�&��2G�G�H��h��f��y�!�g��U�d���#��g�g�m�m�C� ��#���
�(�(�3�-��

�V�Z�Z�4�e�
<�	=��� �
�	�V�Z�Z�A�5�
I�	J�"�g�-�"��x�(�o�	
����	�)8�:�%��.�.�<�<�W�c�J�:��:��
�
�/�/��@�g�	�f�	����d�F�9�<M�N�O����d�D�A�B�	�T��Q���#�(�(�4�.�0�4�7�'�A���i��	�	�(8�S�9�9�i�
����T�[�[�9�g��#�#�K����=�i��l�l��I�w�	0�1�
�l�l�n�-4�5������#�5�g�5��l�l�*�[����-D�D�E�
�l�l�4�{�7�1�:�7N�N�O�
���w�q�z�4�+A�+A�+C�D��L�%��%��	L�A�U�J�	L��L��N�&��&� �	N�B�f�L�	N� �N�
EL�L�q��$�$�2�2�1�c�:�L�g�L�CI�J�a��#�#�1�1�!�S�9�J�f�J�
�o�o�g�s�9�c�$�/�/�6�.J�K�"-�t��=�-�t�3��
�l�l�!1�3�8�8�G�3D�E�F����7�%5�5�6�
�l�l�n�gS�j	�L�L�N��:��<6��*M��Js�4'N7�N<�'O�5'Oc
�^	�|j�}|D�]W}t|j�d|d���}d}	|jd|z�g}
|j	dg�D�]�}t�}tjj|�\}
}tjj|�\}}|dD�cgc]}|j|||
���}}|D]5}tjj|�}|s�%|j|��7t|j	dd��r||z
}t|j	d	d��r||z
}ttt|j |g|j	d
g�z��}d||	fzg}|dk(r|d
gz
}|D�cgc]"}t"j$j'||���$}}|D�cgc]"}t"j$j'||���$}}|D�cgc]}|j!|���}}|
|z
}
|jd|dz�|jd|dz�|j)|||d||	fz��t+j,d�}|D]'}t+j.|d|�}d|vr�Jd|z��|jddj1|�z�|dD�cgc]}|j|||
���}}d}t3|�dkDrddj1|�z}dt|jxsd�z}|j4dk(r-|D�cgc]"}t"j$j'||���$}}t"j6j9|�}|j;d|j<�}|j;d|j<�}|j;d|j<�}|jd|||	||d�z�|jd|	|d �z�|j�|	d!z
}	���d"|z}|j?|
|�|jAd#|z�|jd$|z�|j���Z|jd%�|jd�y&cc}wcc}wcc}wcc}wcc}wcc}w)'a�Write Makefile code for any 'rules' from the gyp input.

    extra_sources: a list that will be filled in with newly generated source
                   files, if any
    extra_outputs: a list that will be filled in with any outputs of these
                   rules (used to make other pieces dependent on these rules)
    part_of_all: flag indicating this target is part of 'all'
    r��	rule_namerz### Generated for rule %s:�rule_sourcesr	r
Frrz$(call do_cmd,%s_%d)�resources_gritz@touch --no-create $@rrz%s_%d)rz\$\([^ ]* \$<\)rr�z/Spaces in rule filenames not yet supported (%s)�all_deps += %srz
mkdir -p %s; rrrrz�cmd_%(name)s_%(count)d = LD_LIBRARY_PATH=$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; %(cd_action)s%(mkdirs)s%(action)s)rr%�count�mkdirsr�z9quiet_cmd_%(name)s_%(count)d = RULE %(name)s_%(count)d $@)r/r�r�zrule_%s_outputsrz$### Finished generating for rule: %sz%### Finished generating for all rulesN)!rr�r�r�rHr�rLrMrry�ExpandInputRootrrrr r�r�r,r�r�
WriteMakeRuler��compiler�rOr�r9r-rr~r��	WriteListr�) r�r�r�r�r�r�r!�ruler�r/�all_outputs�rule_sourcer"�rule_source_dirname�rule_source_basename�rule_source_root�rule_source_extrDr	r#rr�r&r(�variables_with_spacesr��acrr0r%rr)s                                 r<r�zMakefileWriter.WriteRules�s����
 �
 �
"�C��p��
%��1F�1F�15�k�1B�'D�E�d��e�
�l�l�/�$�6�7��k����.�"�5�a�+��u��68�g�g�m�m�K�6P�3�	�2��G�G���1�2�	,�	�?�
#�9�o�/���'�'��-=�(;�=�/��/��	�C�������$�#�
��H�H�S�M�	��t�x�x�4�e�<�=�
�7�
"�-��t�x�x�A�5�I�J�
$��
/�
$��Y��D�O�O�k�]�$(�H�H�X�r�$:�6;�!<�=��)�T�5�M�9�:���#�#��-�.�
.�'�GN�N��3�&�&�4�4�Q��<�N��N�EK�L��#�%�%�3�3�A�s�;�L��L�/6�7�!�4�?�?�1�%�7��7��w���	
���,�w�q�z�9�:����6����C�D����7�F�G�#*�d�E�]�#:�	�	<�!#�
�
�+=� >���	K�F��6�6�/��V�<�&��F�"�K�?�6�I�K�"�	K�	
���%�����(9�9�:�!��N�,���&�&�r�+;�':�<�,��,����t�9�q�=�"�S�X�X�d�^�3�&��	�$�)�)�*:�s� ;�;�	�
�;�;�%��#)�+���'�'�5�5�g�s�C�+�&�+����0�0��8������T�[�[�9���%�%�k�4�;�;�?�	�����T�[�[�9��	
���
2�� ����5
�	
�
	�	
���G���K
�
�	�
	
����
��
��Ca�F+�T�1��
�n�n�[�"2�3����7�%5�5�6�
�l�l�9�D�@�A�
�l�l�n�ap�b	�L�L�8�9��L�L����I/��4O��L��7��(,��+s$�7R�'R�	'R�6R �R%�7'R*c
��|jd�t|jdz�}g}|D]�}|dD]�}t|j	|��}t
jj|�d}t|j	t
jj|d|���}	|j�}
tjj|	|
�}	tjj||
�}|j|	g|gd|�|j|	�����|j|�ddjtt |�����|jd	|z�|j�y
)aWrite Makefile code for any 'copies' from the gyp input.

    extra_outputs: a list that will be filled in with any outputs of this action
                   (used to make other pieces dependent on this action)
    part_of_all: flag indicating this target is part of 'all'
    z### Generated for copy rule.�_copiesr�r��destination�copy� = r�rN)r�r�r�r�r�rLrMrrOrr,r�rrr�r r�)r�r�r�r��variabler	rArMrpr�r!s           r<r�zMakefileWriter.WriteCopiesZsI��	�L�L�/�0�'��(=�(=�	�(I�J�H��G�����w�-��$������.�/���7�7�=�=��&�q�)���4�?�?�2�7�7�<�<��]�8K�8@�,B�C�D���$�$�&���$�$�2�2�6�3�?���"�"�0�0��s�;�������4�&�&�+�>����v��)��,	�L�L�h�����[�'�1J�(K�L�M�����8�+�,��L�L�Nr>c�~�|jd�tjjtd|j
t
tt
|j|���D]U\}}tjj|�\}}|dk7s�.|j|g|gdd��|j|��Wy)z0Writes Makefile code for 'mac_bundle_resources'.z&### Generated for mac_bundle_resourcesrz	.xcassetszmac_tool,,,copy-bundle-resourceT�r�N)r�r,r��GetMacBundleResourcesr0r�r r�r�rLrMryrr�)r��	resources�bundle_depsr�rrr�r_s       r<r�z&MakefileWriter.WriteMacBundleResources�s����L�L�9�:��*�*�@�@�#�M�2�D�4G�4G��I�s�4�?�?�I�6�7�9�#�����w�w����'�f�a��	��	������3�%�)J�$(�	�	*����6�"�#r>c����tjjtd�j�fd��\}}}}|sy|rWdt
jj|�z}�j||dzdt���j|g|gdd	g�|}�j|�j|�
���j|g|gdd�
�|j|�y)z0Write Makefile code for bundle Info.plist files.rc�8��t�j|��Srkr�r�s �r<r�z2MakefileWriter.WriteMacInfoPlist.<locals>.<lambda>�s���)�D�O�O�A�.�/�r>Nz$(obj).$(TOOLSET)/$(TARGET)/z: INFOPLIST_DEFINES�-D)�quoterz$(call do_cmd,infoplist)z@plutil -convert xml1 $@ $@��additional_settingszmac_tool,,,copy-info-plistTrE)r,r��GetMacInfoPlistr0r�rLrMr�r4r�r2rrrr�)r�rH�
info_plistrD�defines�	extra_env�intermediate_plists`      r<r�z MakefileWriter.WriteMacInfoPlist�s����*-�*=�*=�*M�*M�#�M�2�D�4G�4G�/�+1�'�J��W�i����:�
�'�'�
�
�:�
&�'��
�n�n�W�0�3H�H�$� ��"�
���,�-�
�|�%�)�*�+�
&�j�����T�
#�
#�	�
#�
B�D��O�O�S�E�J�<�)E� $��&����s�r>c
�2	�t|j��D�]}||}	|j|	jd�d|zdt��|j
dk(r�|jj|�}
|jj|�}|jj|�}|jj|�}
|jj|�}n3|	jd�}
|	jd�}|	jd�}|jd	�|j|
d
|z�|jd�|j|d|z�|jd
�|j|d|z�|j
dk(rL|jd�|j
d|z�|jd�|jd|z�|	jd�}|r'|D�cgc]}t|j|����}}|j|d|zd����tt |�}|D�cgc]+}|j#|jt%|�����-}}|j|d�|D]}d|vr�Jd|z��|jd�|jd�|j�|r|j'dg|dd��|r|j'dg|d d��|j)||�}|rC|jd!�|D]\}}}|j|�d"|����|jd#�|r�|j+d�|jd$�|jd%�|jd&|j-d'�zd(z�|jd)|j-d*�zd+z�|j
dk(rL|jd,|j-d-�zd.z�|jd/|j-d0�zd1z�|j/|j1��||D�cgc]}t3|�s�|��c}z
}|j�y2cc}wcc}wcc}w)3aWrite Makefile code for any 'sources' from the gyp input.
    These are source files necessary to build the current target.

    configs, deps, sources: input from gyp.
    extra_outputs: a list of extra outputs this action should be dependent on;
                   used to serialize action/rules before compilation
    extra_link_deps: a list that will be filled in with any outputs of
                     compilation (to be used in link lines)
    part_of_all: flag indicating this target is part of 'all'
    rQzDEFS_%srK)�prefixrLr�cflags�cflags_c�	cflags_ccz## Flags passed to all source files.z	CFLAGS_%sz# Flags passed to only C files.zCFLAGS_C_%sz!# Flags passed to only C++ files.zCFLAGS_CC_%sz"# Flags passed to only ObjC files.zCFLAGS_OBJC_%sz$# Flags passed to only ObjC++ files.zCFLAGS_OBJCC_%s�include_dirszINCS_%sz-I)rU�OBJSr�z-Spaces in object filenames not supported (%s)z?# Add to the list of files we specially track dependencies for.zall_deps += $(OBJS)z$(OBJS)z6Make sure our dependencies are built before any of us.T��comment�
order_onlyz1Make sure our actions/rules run before any of us.z:# Dependencies from obj files to their precompiled headersr�z%# End precompiled header dependencieszn# CFLAGS et al overrides must be target-local.
# See "Target-specific Variable Values" in the GNU Make manual.z$(OBJS): TOOLSET := $(TOOLSET)zD$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) %s �cz/$(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))zF$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) %s raz0$(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))zG$(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) %s �mzK$(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))zI$(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) %s �mmzM$(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))N)rXrYr4rHr�r9r��	GetCflags�
GetCflagsC�GetCflagsCC�
GetCflagsObjC�GetCflagsObjCCr�r�r��filterrs�	Objectifyrzr2�GetObjDependenciesr��
GetInclude�WritePchTargets�GetPchBuildCommandsrw)r�r�r�r�r�r�r��precompiled_header�
configname�configrVrWrX�cflags_objc�cflags_objcc�includes�include�
compilabler��objs�obj�pchdepsr��gchs                        r<r�zMakefileWriter.WriteSources�s����W�\�\�^�,�D�
��z�"�f�
�n�n�V�Z�Z�	�*�I�
�,B�4� ��"�
����	��$�$�.�.�z�:���&�&�1�1�*�=���'�'�3�3�J�?�	��)�)�7�7�
�C���*�*�9�9�*�E�����H�%���:�:�j�)���J�J�{�+�	�
�l�l�8�9�
�n�n�V�[�:�5�6�
�l�l�4�5�
�n�n�X�}�z�9�:�
�l�l�6�7�
�n�n�Y��� ;�<�	
����	����9�:����{�$4�z�$A�B����;�<����|�%6��%C�D����N�+�h�	�GO�P�G�I�d�o�o�g�6�7�P��P�
�n�n�X�y�:�5�d�n�C�=D�@�
�G�,�J�@J�K�1�D�N�N�4�?�?�6�!�9�5�6�K�D�K��N�N�4�� ��B��
��^�B�
9�S�
@�B�^�B�	�L�L�%�&��L�L�&�'��L�L�N��
���)��d�$7�&*��,��
���)��m�$7�&*��,�
!�3�3�J��F�G��
�l�l�O�P�%�,�
�&�#�s�����c�*�+�,�
�l�l�:�;�����Y�'�
�l�l�C�D��l�l�3�4�
�l�l��.�8�8��=�>�.�	.�/��l�l��.�8�8��>�?�/�	/�0�
����	�����0�:�:�3�?�@�3�	3�	4�	
����0�:�:�4�@�A�4�	4�	5�	���+�?�?�A�B��W�I�6���8H��I�I�O��L�L�N��]Q��L��PJs�<!R
�
0R�R�0Rc	�h�|sy|D]�\}}}}ddddd�|}ddd	d
d�|}|j|�d|�d|�d
�dz|z�|j|�d|�d��|jd|z�|jd�d
|vs
Jd|z��|jd|z�|jd���y)z,Writes make rules to compile prefix headers.Nz$(CFLAGS_C_$(BUILDTYPE))z$(CFLAGS_CC_$(BUILDTYPE))z4$(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))z6$(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE)))r^rar_r`�GYP_PCH_CFLAGS�GYP_PCH_CXXFLAGS�GYP_PCH_OBJCFLAGS�GYP_PCH_OBJCXXFLAGSr�rr�zA$(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) �
 FORCE_DO_CMDz	@$(call do_cmd,pch_%s,1)rz*Spaces in gch filenames not supported (%s)r.)r�)r��pch_commandsrw�	lang_flag�langr'�extra_flags�var_names        r<rjzMakefileWriter.WritePchTargets&s�����'3��#��Y��e�
'�)�
C�F�	�
	
��k�� �
 �#�	�
	
��h��l�l�c�8�Y�?�-�-��	� ��l�l�C��7�8�
�l�l�/�$�6�7�
�l�l�2��
��^�?�
6�#�
=�?�^�
�l�l�#�c�)�*�
�l�l�2��3r>c�H�|jrJ�|jdk(r(|jdvr|jj	�S|d}d}d}|jdk(r|dddk(r|dd}d}d	}np|jd
vr$|dddk(r|dd}d}|jdk(rd	}nAd}n>|jd
k(rd|z}n)|jdk7rtdd|jd|f�|j
d|�}|j
d|�}|j
d�}|rd|z}||z|zS)z�Return the 'output basename' of a gyp spec.

    E.g., the loadable module 'foobar' in directory 'baz' will produce
      'libfoobar.so'
    r�r�r�r�r�r�rr�N�rr)r�r�r*r+�nonez%s.stampr�z,ERROR: What output file should be generated?r�r��product_prefix�product_name�product_extensionr)r�r9r�r��GetExecutablePathr�rH)r�r�r��
target_prefix�
target_ext�product_exts      r<�ComputeOutputBasenamez$MakefileWriter.ComputeOutputBasenameGsY���!�!�!�!��{�{�e���	�	�.M�!M�
�
 �
 �
2�
2�
4�4�
�-�
 �F��M��J��y�y�$�$�	����u�	�������m��j�	
���;�	;�	����u�	�������m�	
����	��
��
�	
���f�	��F�"�f�	
���l�	"��
;�
�T�Y�Y��&�
2�3��H�H�-�}�=�M�
�X�X�n�f�
-�F��(�(�.�/�K����$�j��6�!�J�.�.r>c�b�|jdk(xr|jdk(xr|jdvS)Nr�rr�)r�r9r��r�s r<�_InstallImmediatelyz"MakefileWriter._InstallImmediatelyrs?���<�<�8�#�O����u�(<�O����OO�BO�Or>c�P�|jrJ�tjjd|jz|j�}|j
dk(s|j
�rd}|jd|�}tjj||j|��S)z�Return the 'output' (full output path) of a gyp spec.

    E.g., the loadable module 'foobar' in directory 'baz' will produce
      '$(obj)/baz/libfoobar.so'
    �$(obj).r�r	�product_dir)	r�rLrMrOr�r�r�rHr��r�r�rMs   r<r�zMakefileWriter.ComputeOutputws����!�!�!�!�
�7�7�<�<�	�D�L�L�0�$�)�)�<�D��y�y�L� �D�$<�$<�$>�
�d��8�8�M�4�(�D�
�7�7�<�<��d�8�8��>�?�?r>c��|jsJ�td}tjj	||j
j
��S)zDReturn the 'output' (full output path) to a bundle output directory.r)r�r0rLrMrOr��GetWrapperNamer�s   r<r�z%MakefileWriter.ComputeMacBundleOutput�s?�������&�}�5�D�
�7�7�<�<��d�1�1�@�@�B�C�Cr>c��td}tjj||jj��S)zAReturn the 'output' (full output path) to the binary in a bundle.r)r0rLrMrOr�r�r�s   r<r�z+MakefileWriter.ComputeMacBundleBinaryOutput�s0��&�}�5�D�
�7�7�<�<��d�1�1�C�C�E�F�Fr>c�t�g}g}d|vrn|j|dD�cgc]}t|r	t|��c}�|dD]#}|tvs�|jt|��%|j|�tj
j
|�tj
j
|�fScc}w)z�Compute the dependencies of a gyp spec.

    Returns a tuple (deps, link_deps), where each is a list of
    filenames that will need to be put in front of make for either
    building (deps) or linking (link_deps).
    �dependencies)�extendr�r�r�r,r-�uniquer)r�r�r�r��deps     r<r�zMakefileWriter.ComputeDeps�s����D��I����
�k�k�$�~�2F�+�3�$�S�)�"�#�&�+�,��n�%�2�#��"�"�
�
�
�+�C�0�
1�2��k�k�)��
�J�J���t�$�c�j�j�&8�&8��&C�D�D��+s�B5c�D�|j|jg|dd��y)Nz Build our special outputs first.Tr[)r2r�)r�r�r�s   r<�WriteDependencyOnExtraOutputsz,MakefileWriter.WriteDependencyOnExtraOutputs�s(������*�*�+�]�!C�$(��*r>c
�����jd�|r1�j�j|��j||dd��i}�jdk7�rt|j
��D�]}	||	}
�jdk(�r�jj|	td�fd��}tjj�j�}�jj|	t!t"jj%t"jj'|�j(���t!t"jj%t"jj'|�j����}
|
rf|
||	<n`|
j+d	g�}t-d
�|D��r<|j/d�j0z�|j/d�j0z�|
j+d
g�}||D�cgc]}d|z��	c}z
}�j3|d|	z��jdk(s��؉j3�jj5|	�d|	z���|j+d�}|rItjj7|�}�jdk(r�jj9|�}�j3|d��jdt!�j�z��jdt!�j�z��jdk(r'�jdt!�j�z�g}�jdk(rA|r|j/d�|j;tj<j?|��|�rJ�jA�j(�jC��|D]N}	�jt!�j(��d|	�dtjjE||	�����P|jGdtjjEd�jg��tI|�D]%\}}|jKd�r�tM|�||<�'�jdt!�j(�z��jt!�j(��ddj'|�����jNr�j�j(|��j3tQt |�d��jd t!�j(�z��jd!vr,�jd"�jjS�z�|r�jd#�g}�jd$��jd%t!�j(�z�|r+�jNrJd&�jTz��d'|vsJd(���jd)k(r��jt!�j��d*dj'tQt |������j0d+k(r2�jd,k(r#�jW�jg|d-||�.��n��jW�jg|d/||�.��nӉjd0k(ru|D]}d|vr�Jd1|z���jd2vr/�jXs#�jW�jg|d3||�.��nr�jW�jg|d4||�.��nO�jd5k(rh�jt!�j��d*dj'tQt |������jW�jg|d6||�.�n؉jd7k(rw|D]}d|vr�Jd8|z���j0d+k(r1�jd,k(r"�jW�jg|d9||�.�nt�jW�jg|d:||�.�nR�jdk(r"�jW�jg|d;||�.�n!t[d<�j�jT��j(r�j(�jTk7rf�j�j\vrN�j�jTg�j(gd=d�>�|r!�jd?g�jTgd@d�>��j�j\vs
�jX�rq�jd5k(rdA}n�jd0k(rdB}nd)}�j_�}�j(g}�jdk(r8d'|vr4�j0dCk(r%|�j(k(sJ|�dD�j(�����j�jTg|gd=d�>�|�j(k7rD�jNrJ��jW|g�j(gdEdF|z|�G�|j/|��j(�j`k7r<�j`�jTk7r#�j�j`g|dH|zd�>�|r�jd?g|gdI|zd�>�yJyJyJcc}w)Ka&Write Makefile code to produce the final target of the gyp spec.

    spec, configs: input from gyp.
    deps, link_deps: dependency lists; see ComputeDeps()
    extra_outputs: any extra outputs that our target should depend on
    part_of_all: flag indicating this target is part of 'all'
    z### Rules for final target.z4Preserve order dependency of special output on deps.Tr[r�rrc�8��t�j|��Srkr�r�s �r<r�z,MakefileWriter.WriteTarget.<locals>.<lambda>�s���	�$�/�/�!�"4�5�r>�ldflagsc3�JK�|]}|jd�xsd|v���y�w)r+z.so.Nrl)rnr�s  r<rqz-MakefileWriter.WriteTarget.<locals>.<genexpr>�s%����F�#����e�$�5��#�
�5�F�s�!#z-Wl,-rpath=\$$ORIGIN/lib.%s/z$-Wl,-rpath-link=\$(builddir)/lib.%s/�library_dirsz-L%sz
LDFLAGS_%szLIBTOOLFLAGS_%s�	libraries�LIBSz*%s: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))z%s: LIBS := $(LIBS)z4%s: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))z!$(TARGET_POSTBUILDS_$(BUILDTYPE))z: TARGET_POSTBUILDS_rr�cdr�rz: POSTBUILDS := r��BUNDLE_DEPSz%s: $(BUNDLE_DEPS))r�r�z+	@$(call do_cmd,mac_package_framework,,,%s)z	@$(call do_postbuilds)z	@true  # No-op, used by testsz
	@touch -c %szQPostbuilds for bundles should be done on the bundle, not the binary (target '%s')r�z.Postbuilds do not work with custom product_dirr�z: LD_INPUTS := �hostr(�	link_host)�
postbuilds�linkr�z2Spaces in alink input filenames not supported (%s))r�openbsd�netbsd�win�
alink_thin�alinkr��solinkr�z3Spaces in module input filenames not supported (%s)�solink_module_host�
solink_module�touchzWARNING: no output forzAdd target alias)r\�phony�allz!Add target alias to "all" target.zshared libraryzstatic libraryr�z != rAz Copy this to the %s output path.)r\r�z!Short alias for building this %s.zAdd %s to "all" target.N)1r�r�r�r2r�rXrYr9r��
GetLdflagsr0r,r-�InvertRelativePathrM�AddImplicitPostbuildsr�rLrNrOr�rH�anyr�r�r4�GetLibtoolflagsr��AdjustLibrariesr�r��GetSpecPostbuildCommandsr�GetSortedXcodePostbuildEnvr�insert�	enumerate�
startswithr�r�r �GetFrameworkVersionr�rr�r�r�r�r�)r�r�r�r�r�rHr�r��target_postbuildsrmrnr��gyp_to_build�target_postbuildr��library_dirr�r�r(�	postbuild�link_dep�	file_descr��installable_depss`                       r<r�zMakefileWriter.WriteTarget�s
���	�L�L�.�/��
�(�(��);�);�]�K�
�����#<�&*��,�
���y�y�F���w�|�|�~�.�9�*���$���;�;�%���'�'�2�2�:�)�-�8�5�7�'�
���6�6�t�y�y�A�,�!�0�0�F�F���"�'�'�*�*�2�7�7�<�<��8<���,E�F�G��"�'�'�*�*�2�7�7�<�<��8<�8J�8J�,L�M�N�	O�
��,<��j�)��J�J�y�"�-�'�
�F��F�
F�
�N�N�:�T�\�\�I�J��N�N�B��<�<�(�
)��z�z�.�"�5���l�K�{�V�k�)�K�K�����w��z� 9�:��;�;�%��
�.�.��,�,�<�<�Z�H�*�Z�7�9�=9�@�(�(�;�'�i�	��J�J�&�&�y�1�	��;�;�%���)�)�9�9�)�D�)�
�n�n�Y��'�
�l�l�?�
�d�(�(�
)�*�+�
�l�l�(�;�t�7I�7I�+J�J�K�	
����	����K���*�*�+�,�	-�
�J��{�{�e��	����=�>����

�
�
�
6�
6�t�
<�>�����t�{�{�D�,K�,K�,M�N�)�N�*����
����
%�
�
�Z�Z�
,�
,�->�z�-J�
K�M�	N�N�����3�:�:�:�:�D�$�)�)�;L�M�N�#�J�/�9�,�!�Y��#�#�C�(�-�i�8�*�Q�-�9��l�l�4�{�4�;�;�7O�O�P�
�l�l�
�d�k�k�
"�C�H�H�Z�$8�:�;�����(�(����m�D��n�n�S��k�2�M�B�
�l�l�'�+�d�k�k�*B�B�C�
���;�	;����C����3�3�5�6�	7�

����/�0��j��l�l�4�5��l�l�#�k�$�+�+�&>�>�?���#�#�I�':�<@�K�K�'H�I�
#�
�$�
&� �*� �
&��y�y�L� �
�l�l�
�d�(�(�
)�

�(�(�3�{�I�.�
/�1�2�
����	�D�K�K�9�$<�����+�+�,�i��#�
�	�	<�	
����+�+�,�i���#-�	�	/�
���&�	&��N�(��(�"�	N�@�H�L�	N�"�N��+�+�@�
@�
�
+�
+�����+�+�,�i��#�
�	�	<�	
����+�+�,�i��+�#-�	�	/�	
���&�	&�
�l�l���*�*�+��H�H�S��i�0�1�3�4��o�o�t�)�)�*�I�x��!+��-�	
���'�	'��O�(��(�"�	O�A�X�M�	O�"�O�
����	�D�K�K�9�$<�����+�+�,�i�9M�#�
�	�	<�	
���
�
�
� �)�_�k�!�	�	#�
���f�	�
�o�o�t�)�)�*�D�'�;�!+��-��$�d�i�i����=�
���������3�	
���$�3�3�	3�
���$�+�+�����
�!3�T��C�	����E�7�T�[�[�M�%H�#'�	�	)�	
�	�	�T�.�.�.��)�)�	
���&�	&�$�	��9�9�(�(�$�	� �	��7�7�9�l��+�+���
�+�+��
�}��'<�
�,�,�(�
"��t�{�{�*�	'��$�+�+�-'�	'�*����$�+�+����!3�T��C�	����	$��%�%�%�%���������
�v�"D�!�#"�/:�	�	<�	����-�	
����
�
�	"�t�z�z�T�[�[�'@����D�J�J�<�)9�%H�$�&%�.2�	�	4�
����E�7�\�N�%>��%J�#'�	�	)�
�9	*��uLs�kNrc��d}|r,|D�cgc]
}|||z���}}ddj|�z}|jj|�d|�d��ycc}w)z�Write a variable definition that is a list of values.

    E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out
         foo = blaha blahb
    but in a pretty-printed style.
    rz \
	z :=z

N)rOr�r\)r��
value_listrCrUrL�values�ls       r<r4zMakefileWriter.WriteList�sU���F��0:�;�1�F�6�A�:�&�;�j�;��9�>�>�*�5�5�f��G�G�M�M�8�V�4�5��<s�Ac���d}|rd|vsJ�d}|j||d|�|�d�g||d��|D�cgc]}t|t���}}|jdd	j	|�z�y
cc}w)z�Write a Makefile rule that uses do_cmd.

    This makes the outputs dependent on the command line that was run,
    as well as support the V= make command line flag.
    r�,z,,1z$(call do_cmd,�)T)r�r\r�forcer.r�N)r2r��SPACE_REPLACEMENTr�rO)	r�r	rrr�r\r��suffixr&s	         r<rzMakefileWriter.WriteDoCmd�s����F��
��
��
��f����w��;B�F�"K�!L�!(�!(�#�	�%�;B�B�Q�{�1�/�0�B�G�B��L�L�!�C�H�H�W�$5�5�6��Cs�A,c	���|D�	cgc]
}	t|	���}}	tt|�}|r|jd|z�|r#|jddj|�z�|r|jd|dz�|rdnd}
|r8|jdj|��ddj|��|
����nt	|�d	k(r+|j|d�d
dj|��|
���n�|r|n|j
j
d�}tj|�j�}d|z}
|jdj|��d
|
���|jd
dz�|jd�d
|
���|j|
�d
dj|��|
���|jdd�|r|D]}|jd
|z��|j�ycc}	w)a�Write a Makefile rule, with some extra tricks.

    outputs: a list of outputs for the rule (note: this is not directly
             supported by make; see comments below)
    inputs: a list of inputs for the rule
    actions: a list of shell commands to run for the rule
    comment: a comment to put in the Makefile above the rule (also useful
             for making this Python script's code self-documenting)
    order_only: if true, makes the dependency order-only
    force: if true, include FORCE_DO_CMD as an order-only dep
    phony: if true, the rule does not actually generate the named output, the
           output is just a name to run the rule
    command: (optional) command name to generate unambiguous labels
    z# z.PHONY: r�z%s: TOOLSET := $(TOOLSET)rr}rz: | r�r�zutf-8z%s.intermediatez	%sz@:z
.INTERMEDIATEz$(call do_cmd,touch)N)r�r r�rOr�r��encode�hashlib�sha1�	hexdigestr�)r�r	rr�r\r]r�r�rr&�force_append�	cmdstring�	cmddigest�intermediaters               r<r2zMakefileWriter.WriteMakeRule�s��� (/�/�!�{�1�~�/�G�/�
��f�
%�F��
�l�l�4�'�>�"��
�l�l�:����� 1�1�2��
�l�l�.����;�<�&+�?��L���l�l��H�H�W�%�s�x�x��'7��G�H�	�W���	�
�l�l����S�X�X�f�-=�|�L�M�&�7�4�;�;�>�>�w�G�i��,�,�y�)�3�3�5�i�&�)�4�l�
�l�l�s�x�x��0�,�?�@�
�l�l�6�D�=�!�
�l�l���=�>�
�l�l� �#�(�(�6�"2�L�B�C�
�n�n�Q�.�/���&�&����V�f�_�%�&��L�L�N��W0s�G3c	���|jdvry|jd�|jd�|jd|z�|jd�|jd�|jd�|jd	�d
d
d
d�}d}|D]D}tjj	|�d
}||vs�*||xxd
z
cc<||||kDs�C|}�F|jd|z�|jt
|jtt|��d�d�}ddi}	i}
t|
|	�|j||td|
d�d�|j||tdtd�d�|jdk(r|jd�nA|jdk(r|jd�n |jdk(r|jd�|j�y)a�Write a set of LOCAL_XXX definitions for Android NDK.

    These variable definitions will be used by Android NDK but do nothing for
    non-Android applications.

    Arguments:
      module_name: Android NDK module name, which must be unique among all
          module names.
      all_sources: A list of source files (will be filtered by Compilable).
      link_deps: A list of link dependencies, which must be sorted in
          the order from dependencies to dependents.
    )r�r�r�Nz/# Variable definitions for Android applicationszinclude $(CLEAR_VARS)zLOCAL_MODULE := ziLOCAL_CFLAGS := $(CFLAGS_$(BUILDTYPE)) $(DEFS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(INCS_$(BUILDTYPE))z+LOCAL_CPPFLAGS := $(CFLAGS_CC_$(BUILDTYPE))zLOCAL_C_INCLUDES :=z/LOCAL_LDLIBS := $(LDFLAGS_$(BUILDTYPE)) $(LIBS)r)rdrerfrer�zLOCAL_CPP_EXTENSION := �LOCAL_SRC_FILESc���g}|D]l}tjj|�}|j|�s�4|j	|�s�F|j|t
|�t
|���n|Srk)rLrMr�r�rmr�r�)r�rUr��modules�filepathrps      r<�
DepsToModulesz?MakefileWriter.WriteAndroidNdkModuleRule.<locals>.DepsToModules2si���g��=�(��7�7�#�#�H�-�����v�&�8�+<�+<�V�+D�
�.�.��#�f�+�s�6�{�l�;�
<�=��nr>r9r)rr�LOCAL_SHARED_LIBRARIESrr�LOCAL_STATIC_LIBRARIESr�zinclude $(BUILD_EXECUTABLE)r�zinclude $(BUILD_SHARED_LIBRARY)r�zinclude $(BUILD_STATIC_LIBRARY))r�r�rLrMryr4r r�rfrsr=r0)r��module_namer�r��cpp_ext�default_cpp_extrpr_r�r8r7s           r<r�z(MakefileWriter.WriteAndroidNdkModuleRules����y�y�J�J���L�L�B�C��L�L�(�)��L�L�#�k�1�2��L�L�	(�	)�	�L�L�>�?��L�L�&�'��L�L�B�C���A�.�G��O�� ���G�G���X�&�q�)�c�	����������3�<�'�/�2�2��/� �	�L�L�*�_�<�=��N�N�3�t����z�;�(G�H�$�&�
���
 �F����(�&�1��N�N��i�1�2E�F�'�(;�<�	>�	!�	"�
	�N�N��i�1�2E�F�1�2E�F�	H�	!�	"��y�y�L� �
�l�l�0�1�	
���&�	&�
�l�l�4�5�	
���&�	&�
�l�l�4�5��L�L�Nr>c�@�|jj|dz�y)NrW)r�r\)r��texts  r<r�zMakefileWriter.WriteLnSs���G�G�M�M�$��+�r>c��tjj|jdtj
j
d|j
�d|�S)Nz$(abs_builddir)z
$(abs_srcdir)r)r,r�rr�rLrMrO)r�rNs  r<rz MakefileWriter.GetSortedXcodeEnvWsB�����0�0����.�
�����_�d�i�i�0�.���r>c�b�|jjdd�}|jd|i��S)N�CHROMIUM_STRIP_SAVE_FILErrM)r��GetPerTargetSettingr)r��strip_save_files  r<r�z)MakefileWriter.GetSortedXcodePostbuildEnv^sC���)�)�=�=�"�B�(�O��!�!�7��I�"�K�Kr>c�\�|D]'\}}|jt|��d|�d|����)y)Nz	: export r)r�r�)r�r�r!�k�vs     r<rz"MakefileWriter.WriteSortedXcodeEnvis1���H���1��l�l�K��,?��A�F�G�Hr>c�x�d|vr|jdd|jz�}d|vrd|j�d|��}|S)z,Convert a path to its output directory form.r��$(obj)/z$(obj).%s/$(TARGET)/z$(obj)r�z/$(TARGET)/)r~r��r�rMs  r<rgzMakefileWriter.Objectifyts>���t�|�
�\�\�)�%;�d�l�l�%J�
K�d��t��)-���t�
<�d��Kr>c��|j|�}d|vr$|jdd|j�d|���}|Sd|j�d|�d|��S)z:Convert a prefix header path to its output directory form.r�r�r�z/$(TARGET)/pch-�/)r�r~r�)r�rMr�s   r<r�zMakefileWriter.Pchify}sR���?�?�4� �D��t�|�
�\�\�)��<�<��&/�0�d�
�k��/3�l�l�D�$�G�Gr>c��d|vr|jd�Stjjtjj	|j|��S)zlConvert a subdirectory-relative path into a base-relative path.
    Skips over paths that contain variables.r�r�)�rstriprLrMrNrOr�s  r<r�zMakefileWriter.Absolutify�sD���t�|��[�[��
��
�7�7���B�G�G�L�L����D�9�:�:r>c�*�d|vrd|vr|S|||d�z}|S)Nr
r)�
INPUT_ROOT�
INPUT_DIRNAME�)r��template�	expansionrrMs     r<r1zMakefileWriter.ExpandInputRoot�s3���x�'�,?�x�,O�
�o��� �
�
�D��Kr>c��|jdk(r:|jdk7s|jdk7rd|j�d|j��Sd|jzS)zCReturns the location of the final output for an installable target.r�rr�z$(builddir)/lib.r�z$(builddir)/)r�r9r�r�r�s r<r�z,MakefileWriter._InstallableTargetInstallPath�sM��	
�	�	�%�%�	
����	�����!9��)-���d�j�j�
A�A��D�J�J�&�&r>)NF)NNFFFN)rrk)$�__name__�
__module__�__qualname__�__doc__r�r�rr�r�r�r�r�r�rjr�r�r�r�r�r�r�r�r�r4rr2r�r�rr�rrgr�r�r1r�r�r>r<r�r��s����
+�6B�J�6a�H}�@#�L#��6z�x�B(/�VO�
@�D�G�E�,*�i)�X,0��'�6�GK�!�7�0BF�HL�;�|P�f��K�H��H�;��	'r>r�c�>�|d}|dD�cgc],}tjj||j���.}}tjj	|d|j�}|jtj�s tjjd|�}|jd|djtt|��tjj|dgtj|�z|z�d�z�y	cc}w)
z,Write the target to regenerate the Makefile.rB�build_files_arg�
gyp_binaryrz�quiet_cmd_regen_makefile = ACTION Regenerating $@
cmd_regen_makefile = cd $(srcdir); %(cmd)s
%(makefile_name)s: %(deps)s
	$(call do_cmd,regen_makefile)

r�z-fmake)�
makefile_namer��cmdN)r,r-�RelativePathrK�FixIfRelativePathr�rL�seprMrOr\r r�r�RegenerateFlags)r8�
root_makefiler	�build_filesrBrp�build_files_argsrs        r<�WriteAutoRegenerationRuler�s	��
�9��'�&,�->�&?�A�"��j�j�-�-�h��8L�8L�M�A��A��z�z�+�+�F�<�,@�,3�,@�,@�B�*�	�	�	�r�v�v�	&������c�:�.�J����,�)��(�(�3�y�+�6�7����0�0� �(�+��(�(��1�2�%�&�'�/(�	(�
)��As�1Dc���|d}|D]k}dg}|jr |jdk7r|d|jfz
}|jd|z�td|�d|���tj|��my)NrB�makerz-Cz
BUILDTYPE=z
Building [z]: )rKr�r��
subprocess�
check_call)�data�configurationsr8rBrn�	argumentss      r<�PerformBuildr�s{���9��'��%�f���I����� 4� 4�� ;��4��-�-�-�-�i�
���\�F�*�+�	���
3�4����)�$�
%r>c
���3�|d�3tjj|�}|jdi�}|jdd�}|jdd�}|jdd�}�3fd�}	d}
t	|D�cgc]
}||d	��c}�}|D]}||}
|
d
dk7s�|
d
}
n|
sd}
d}d
�3j
z}tjj�3j|�}�3jratjj�3j�3j|�}tjj|�3j�}dad}d}d}|||
|dtd|||d�
}|dk(r!d}|j|dtt d��n�|dk(r|jdt"i�ny|dk(rd}d}|j||t$d��nV|dk(r|jd dd!��n<|d"k(rd#}|jd$|i�n!|d%k(rd#}|j|t&d dd&��|jt)d'd(�t)d)d*�t)d+d,�t)d-d.�t)d/d0�t)d1d2�t)d3d4�t)d5d6�d7��tjj+|d8�\}}}||jd9g�}i}|D],\}}|j-d:�s�d;|z||dt/d:�<�.d}|D]�\}}t1j2d<|�r�|d8d=k7rd;|z}|j|�}|r
|�d>|��}||=|d?vrQ|d@|zz
}|j5ddA�}|tj6vrtj6|}|dB|�dC|�dD�z
}|dEz
}��||�dF|�dD�z
}��||d9<tjj9|�t;|dG�}|j=t>|z�|r|j=dH�|D]!}|j=dI|z�tA|��#tjjC|�} tjjE|| �t	�}!|dJD]9}tjjG|||�D]}|!jI|���;t	�}"t	�}#|D�]�}$tjj+|$�\}}}||jd9g�}%||%k(s
JdK|%�dL|����|"jItjj|�3j��||dM}&|&D]�}'tjjtjjK|'|��3j�}(tjjM|(�})|dNr&|)jO|dN�r|"jI|)���|"jI|(���|	||dz|z�3j
zdOz�\}*}+||$}
|
dP},|dk(r#tjPjS|||
�tU||�}-|-jW|$|*|+|
|,|$|!v�Q�tjj|+tjjC|��}.|#jI|.���tjj�3jXt
jZ��}/|"D�]
}tjj|/|�}|D�cgc]}|jO|�r||!vr||dR��!}0}|0s�Q|	|tjj]tjj_|��d8dSz�\}*}+tjjtjjC|�tjjC|+��}1-ja|+|1|0|���
|j=dD�tc|#�D]A}2|j=dT|2zdUz�|j=dV|2zdDz�|j=dE��C|j=dD�|jdW�s |jdXdY�rte||||"�|j=tf�|ji�ycc}wcc}w)ZNrBr@rCrDrA�default_targetr�c���tjjtjj|��j�}tjj�j||�}�jr6tjj�j�j||�}tjjtjj|��j�}||fS)z9Determine where to write a Makefile for a given gyp file.)
r,r-rrLrMr�depthrOrJrK)�
build_file�	base_namer��output_filerBs    �r<�CalculateMakefilePathz-GenerateOutput.<locals>.CalculateMakefilePath�s�����
�
�'�'������
�(C�(/�
�
�7�I��'�'�,�,�w�}�}�i��C�K�����G�G�L�L�
�-�-��1�1�9�i�I�k��
�
�'�'������
�(C�(/�(<�(<�>�I��k�!�!r>r��default_configuration�Defaultr�Makefilez
$(srcdir)/�flockz-afz-MMDr�r)
r�builddirr#r&�flock_index�
link_commands�extra_commands�srcdir�copy_archive_args�makedep_argsrz./gyp-mac-tool flock�)r&r(r)r*r(r)�zosz-fPRz
-qmakedep=gcc)r,r-r)�solarisz./gyp-flock-tool flock)r&r(r�z-pPRfr,r*)r,r)r&r()�	CC_target�CCz$(CC))�	AR_target�ARz$(AR))�
CXX_target�CXXz$(CXX))�LINK_target�LINKz$(LINK))�CC_hostr2�gcc)�AR_hostr4�ar)�CXX_hostr6zg++)�	LINK_hostr8z$(CXX.host))z	CC.targetz	AR.targetz
CXX.targetzLINK.target�CC.hostzAR.host�CXX.hostz	LINK.hostr�make_global_settings�_wrapperz
$(abspath %s)z
.*_wrapperr�r�)r2r?r6r@z3ifneq (,$(filter $(origin %s), undefined default))
r�r�rBrWzendif
z ?= r�zU# Define LOCAL_PATH for build of Android applications.
LOCAL_PATH := $(call my-dir)

zTOOLSET := %s
rz;make_global_settings needs to be the same for all targets. z vs. �included_files�home_dot_gypz.mkrrEr�z	.Makefilezmifeq ($(strip $(foreach prefix,$(NO_LOAD),\
    $(findstring $(join ^,$(prefix)),\
                 $(join ^,z)))),)
z
  include �
standalone�auto_regenerationT)5r,r-r.rHr�r�rLrMrOrKrJrr��LINK_COMMANDS_LINUXr6�LINK_COMMANDS_MAC�SHARED_HEADER_MAC_COMMANDS�LINK_COMMANDS_ANDROID�LINK_COMMANDS_OS390�LINK_COMMANDS_AIXr�ParseQualifiedTargetrmr�r��matchr~�environr�r�r\�
SHARED_HEADERr`r�CopyTool�
AllTargetsr�UnrelativePath�abspathr�r��MergeGlobalXcodeSettingsToSpecr�r�r�getcwdryr�rrXr�
SHARED_FOOTERr�)4�target_list�target_dictsrr8r9r@rQrArr"r#r��toolsetsr�r+r	r�
flock_command�copy_archive_arguments�makedep_arguments�
header_paramsrr��make_global_settings_array�wrappersrU�valuerA�wrapper�env_keyrr��	dest_path�needed_targetsr�include_listr��this_make_global_settingsrC�
included_file�relative_include_file�abs_include_filer�r!r�r]�mkfile_rel_path�depth_rel_path�gyp_targets�makefile_rel_path�include_filerBs4                                                   @r<�GenerateOutputrp�s<	����9��'��:�:����'�&��J�J�0�"�5�/�!�%�%�l�E�:�-�'�+�+�,A�4�H��"�&�&�'7��?�.�"�(��
��L�f�,�v�&�y�1�L�
M�(���f����D��#�$�	�1�"�#:�;���	�

�%���&��w�~�~�-�-��'�'�,�,�w�3�3�]�C�-�����G�G�L�L����g�6�6�
�G�M�
�Z�Z�
$�
$�V�W�-E�-E�
F�F� �M��-� ����&��4���*���1�'��-��u�_�*�M������*�4�	���������.������#��'�����3�)�,���
������)�������$������3������$�����3�*�)��	�����%�&9�7�C�%�&9�7�C�%�&;�X�F�%�&=�y�I�%�&7��?�%�&7��>�%�&9�5�A�%�&;�]�K�	�	��Z�Z�4�4�[��^�D��*�a��#�J�/�3�3�4J�B�O��
�(�.�A�j�c�5�
�|�|�J��)8�5�)@�h�s�$�S��_�$�%�&�A���.�:�j�c�5�	�x�x��c�"���Q�x�3����%�e��l�l�3��G�� �%�(�e�
�3�-�
�2�2��
@�3�
F�H�����C��%�g�	�B�J�J�	��
�
�7�#���s�E�:�:���i�'���c�5�9�9��':�.+?�-�&�'��*�*���]�+��}�c�*�-����m�m�3�4�����	
���.�g����)�G�3�4��}�-�.�
�g�g�o�o�m�,�)��*�*���f�i�(��5�.��=�)�!�j��*�*�'�'��\�:�N�!������ �!�!���+���,�%�,&��"%�*�*�"A�"A��#��J���!%�Z� 0� 4� 4�5K�R� P��%�)B�B�;�	"�$8�	:�;�B��O�O�C�J�J�+�+�J��8L�8L�M�N��*�%�&6�7�N�'�/�
�"�j�j�5�5�

�*�*�
#�
#�M�:�
>�
�
�
� �������)>�?����
 �
�
%�
%�f�^�&<�
=����(�)����-�.�/� 3�:����w�����/�%�7�9��I�{��(�)�D��#�$�G�
���	���8�8��j�9I�4�P�
�O�V�
4�F�
�L�L�!�9�k�4��-��?��A�
�j�j�-�-�k�.0�g�g�o�o�m�.L�N�O����_�%�Y,&�^�:�:�*�*�7�=�=�"�)�)�+�F�.��'�j������n�j�9�J�EP�-�6��'�'�
�3��^�+� ��'�
�6�-�K�-���2�:�
��������)�)�*�5�6�q�9�K�G�I��I�{��
�
�/�/������
�0N�02������0L�N��
����%6��%�'�'�(���d���\�*�
#�l�
���	%�'3�	4�6@�	A�B�����|�3�d�:�;����	�"�
#����d��
�
�
�l�
+�
�
�
�1�4�
8��f�m�]�K�P����m�$������WM��P-s�>c+�=$c0)z\ )6�
__future__rrLr��sysrr,�
gyp.common�gyp.xcode_emulationrrr�r0�$generator_supports_multiple_toolsetsrIr!r"r#rPr=rRr�rGrHrJrLrKrPrIr`r�r�rWr�r5rsrwrzr�r�r�r�r�r�r�r�r�r�r��objectr�rrrpr�r>r<�<module>rws
��0&�	�	�
��
���)��������8�)��%�+�$�"�#�&���$(,�$�',�#�/1�+�%'�"�$&�!���"A�J�B��"��H����8��$��(H&�P):�QH:�P=�QI�R"3�SI3�R_6�Sh�P+�Qh+�RM�SHM�R6G�SIG�RJ)�SJ)�T,=�UJ=�V!&�Wl�
�\��>�((�#�
(�#�
�
�
��	
�	�
�
���
���!�
.�
-����.�
�
���
M�@��
��p'�V�p'�f')�2%�Hr>

Youez - 2016 - github.com/yon3zu
LinuXploit