Uc@sFddlZddlZddlZddlZddlZddlZddlZddlmZidd6dd6dd6dd6d d 6d d 6d d6dd6dd6dd6dd6dd6dd6dd6Ze Z e a ga gagaeadZdZdZd Zd!Zd"Zd#Zd$ed%ed&ed'ed(ed)Zd*Zd+Zd,Zd-Zd.Zd/Zid0d16d2d36d2d46d2d56d0d66d0d76Z d8Z!d9Z"d:Z#d;Z$d<Z%d=Z&d>Z'd?Z(da)d@Z*dAdBZ+iZ,iZ-dCfdDYZ.dEZ/dFZ0dGZ1dS(HiN(tGetEnvironFallbackttEXECUTABLE_PREFIXtEXECUTABLE_SUFFIXtlibtSTATIC_LIB_PREFIXtSHARED_LIB_PREFIXs.atSTATIC_LIB_SUFFIXs $(obj).$(TOOLSET)/$(TARGET)/genitINTERMEDIATE_DIRs $(obj)/gentSHARED_INTERMEDIATE_DIRs $(builddir)t PRODUCT_DIRs%(INPUT_ROOT)stRULE_INPUT_ROOTs%(INPUT_DIRNAME)stRULE_INPUT_DIRNAMEs $(abspath $<)tRULE_INPUT_PATHs $(suffix $<)tRULE_INPUT_EXTs $(notdir $<)tRULE_INPUT_NAMEs $(BUILDTYPE)tCONFIGURATION_NAMEcCs+tjj|}|dkr|jdd|jdd|jdtd|jdtddd ljj}t|d ga t|d ga t|d ga t j id d6dd6n[|}|dkrd}n|jd||jdd|jdd|jddd S(sDCalculate additional variables for use in the build (called by gyp).tmactOStSHARED_LIB_SUFFIXs.dylibtSHARED_LIB_DIRR tLIB_DIRiNt+generator_additional_non_configuration_keyst"generator_additional_path_sectionst!generator_extra_sources_for_rulestobjcs.mtobjcxxs.mmtandroidtlinuxs.sos$(builddir)/lib.$(TOOLSET)s$(obj).$(TOOLSET)(tgyptcommont GetFlavort setdefaulttgenerator_default_variablestgyp.generator.xcodet generatortxcodetgetattrRRRtCOMPILABLE_EXTENSIONStupdate(tdefault_variablestparamstflavortxcode_generatortoperating_system((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pytCalculateVariables?s.          cCs|jdi}|jdd }|r3tan|djpJ|dj}|jdd}tjjtjj ||d}i|djd6|d6a d S( sOCalculate the generator specific info that gets fed to input (called by gyp).tgenerator_flagstandroid_ndk_versiontoptionst output_dirtouttgypfilesttopleveltqualified_out_dirN( tgettNonetTruet#generator_wants_sorted_dependenciestgenerator_outputt toplevel_dirtostpathtnormpathtjointgenerator_filelist_paths(R)R.R/R1t builddir_nameR5((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pytCalculateGeneratorInputInfoas   t?squiet_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)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) # 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)) -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) shquiet_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) squiet_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) squiet_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)) 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) s* # 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 ?= $(CFLAGS) CXX.target ?= %(CXX.target)s CXXFLAGS.target ?= $(CXXFLAGS) LINK.target ?= %(LINK.target)s LDFLAGS.target ?= $(LDFLAGS) AR.target ?= $(AR) # C++ apps need to be linked with g++. # # Note: flock is used to seralize linking. Linking is a memory-intensive # process so running parallel links can often lead to thrashing. To disable # the serialization, override LINK via an envrionment variable as follows: # # export LINK=g++ # # This will allow make to invoke N linker processes as specified in -jN. LINK ?= %(flock)s $(builddir)/linker.lock $(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 ?= CXX.host ?= %(CXX.host)s CXXFLAGS.host ?= LINK.host ?= %(LINK.host)s 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),s ,$1) unreplace_spaces = $(subst s,$(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 = -MMD -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)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $< quiet_cmd_cxx = CXX($(TOOLSET)) $@ cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< %(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 -af "$<" "$@") %(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 sa 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 s* for # spaces already and dirx strips the s 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: s 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 "$@" cCsttjdtj}|jdx4|D],}|jd||jdt|q/W|jdx4|D],}|jd||jdt|qsW|jdx4|D],}|jd||jdt|qW|jddS( Ntkeys1# Suffix rules, putting all outputs into $(obj). s4$(obj).$(TOOLSET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD s @$(call do_cmd,%s,1) s, # Try building from generated source, too. s<$(obj).$(TOOLSET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD s s1$(obj).$(TOOLSET)/%%.o: $(obj)/%%%s FORCE_DO_CMD (tsortedR&tkeyststrtlowertwrite(twritert extensionstext((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pytWriteRootHeaderSuffixRuless       s1# Suffix rules, putting all outputs into $(obj). s+# Try building from generated source, too. s# "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 s/# This file is generated by gyp; do not edit. tccs.ctcxxs.ccs.cpps.cxxs.ss.Scs/x(fdtDD]}|rtSqWtS(s:Return true if the file is compilable (should be in OBJS).c3s|]}j|VqdS(N(tendswith(t.0te(tfilename(s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pys 8s(R&R8tFalse(RStres((RSs3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyt Compilable6scCs |jdS(sAReturn true if the file is linkable (should be on the link line).s.o(RP(RS((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pytLinkable>scCstjj|ddS(s1Translate a compilable filename to its .o target.is.o(R<R=tsplitext(RS((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pytTargetCscCsd|jdddS(sQuotes 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 t's'\''(treplace(ts((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pytEscapeShellArgumentHscCs|jddS(srMake has its own variable expansion syntax using $. We must escape it for string to be interpreted literally.t$s$$(R[(R\((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pytEscapeMakeVariableExpansionPscCs(t|}t|}|jddS(sBEscapes a CPP define so that it will reach the compiler unaltered.t#s\#(R]R_R[(R\((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pytEscapeCppDefineVs  cCs-d|kr)d|jddd}n|S(sSTODO: Should this ideally be replaced with one or more of the above functions?t"s\"(R[(tstring((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pytQuoteIfNecessary_s cCstjdd|S(sGConvert a string to a value that is acceptable as a make variable name.s [^a-zA-Z0-9_]t_(tretsub(Rc((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pytStringToMakefileVariablegscCs.d|kr|Stjj|r&|St|S(s,Convert a path to its source directory form.s$((R<R=tisabst srcdir_prefix(R=((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyt Sourceifyms  s\ cCs|jd|S(Nt (R[(R\tquote((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyt QuoteSpacesvstMakefileWritercBsIeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZd!dedZd!edZd!d!eeedZdZddZd!dZdZdZdZ dZ!dZ"dZ#d Z$RS("sMakefileWriter packages up the writing of one target-specific foobar.mk. Its only real entry point is Write(), and is mostly used for namespacing. cCs||_||_i|_i|_i|_xtjD]u}|jjid|t|f|6|jjid|t|f|6|jjid|t|f|6q:WdS(NsT$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD @$(call do_cmd,%s,1) s\$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD @$(call do_cmd,%s,1) sQ$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD @$(call do_cmd,%s,1) (R.R*tsuffix_rules_srcdirtsuffix_rules_objdir1tsuffix_rules_objdir2R&RFR'(tselfR.R*RL((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyt__init__s        c stjj|t|d_jjt|_|_|d_ |d_ |d_ tj j j|_jdkrtj j|_n d_j|\}}g} g} g} g} g} jrj|_j|_nj|__t|jdd_d_jsqj jkrtjjj_j }nj_j}j!d j j!d j d |krj"|d | | | |nd|kr-j#|d| | | |nd|krSj$|d| |njr|jdg| }j%|| j&| n|jdg| }|r j'|||| | |tj j(jfdj)t*t+|}|r j!t,t-g|D]}tjj.|d^q}x4|D],}|j/krFj!j/|qFqFWj!t0x4|D],}|j1krj!j1|qqWx4|D],}|j2krj!j2|qqWj!djr| j3jqq nj4|||| || | ||t5|<j dkrljt6|sis!# End of this set of suffix ruleststatic_libraryR/N(s executablesloadable_modulesshared_library(sstatic_librarysshared_library(:RRtEnsureDirExiststopentfpRItheadertqualified_targetR=ttargetRwRxtxcode_emulationt IsMacBundleR*t is_mac_bundlet XcodeSettingstxcode_settingsR7t ComputeDepstComputeMacBundleOutputtoutputtComputeMacBundleBinaryOutputt output_binaryt ComputeOutputtboolR6tis_standalone_static_libraryt_INSTALLABLE_TARGETSR<tbasenametaliast_InstallableTargetInstallPathtWriteLnt WriteActionst WriteRulest WriteCopiestWriteMacBundleResourcestWriteMacInfoPlistt WriteSourcestMacPrefixHeadertPchifytfilterRVt#SHARED_HEADER_SUFFIX_RULES_COMMENT1tsetRXRpt#SHARED_HEADER_SUFFIX_RULES_COMMENT2RqRrtappendt WriteTargetttarget_outputsttarget_link_depsR.tWriteAndroidNdkModuleRuletclose(RsRt base_pathtoutput_filenametspectconfigst part_of_alltdepst link_depst extra_outputst extra_sourcestextra_link_depstextra_mac_bundle_resourcestmac_bundle_depst install_pathtall_mac_bundle_resourcest all_sourcesRR\RKRL((Rss3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pytWrites                      /        cCstjj|t|d|_|jjt|jdtj j tj j |||jd|jd|rd|}n|jd|dj |f|jj dS( sWrite 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 Rusexport builddir_name ?= %ss .PHONY: allsall:s -C s $(MAKE)%s %sRlN( RRRRRRIRRR<R=R?tdirnameR(RsRt makefile_pathttargetst build_dir((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyt WriteSubMake%s  #    c Cs|j}x|D]}td|j|df}|jd|d|d} |d} t} x:| D]2} tjj| d} | ro| j| qoqoWt |j dt r|| 7}nt |j dt r|| 7}n|d }|j d kr3g|D]}t jj||^q}nt jj|}d |kro|jd ||d fn|jd ||ft| dkrd dj| d|}ndt|jpd}|jd|j}|jd|j}|jd|||f|jt|j| } |jdt| d|jdt| d|j| d|jx*| D]"}d|kstd|qWx*| D]"}d|kstd|qWg| D]}t jj||^q} g| D]}t jj||^q} |j| ttt|j| d|d|d|}|jd|dj| f|jd||jqW|jdS(sWrite 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' s%s_%st action_names### Rules for action "%s":tinputstoutputsitprocess_outputs_as_sourcest'process_outputs_as_mac_bundle_resourcestactionRtmessagesquiet_cmd_%s = ACTION %s $@s mkdir -p %sRls; scd %s; t.s $(TARGET)stcmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; %s%ss%s: obj := $(abs_obj)s%s: builddir := $(abs_builddir)s3Spaces in action input filenames not supported (%s)s4Spaces in action output filenames not supported (%s)Rtcommandsaction_%s_outputss%s := %ss$(%s)N(tGetSortedXcodeEnvRhRRRR<R=tsplittaddtintR6RTR*RRt ExpandEnvVarsRtEncodePOSIXShellListtlenR?RkR[RtmapRRntWriteSortedXcodeEnvtAssertionErrort WriteDoCmdR(RsR}RRRRtenvRtnameRRtdirsR2tdirtaction_commandsRt cd_actiontinputRtotitoutputs_variable((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyR@sf          (      (($   c Cs|j}xp|D]h}td|j|df}d} |jd|g} x|jdgD]} t} tjj| \} }tjj |\}}g|dD]}|j ||| ^q}x6|D].}tjj |}|r| j |qqWt |jdtr/||7}nt |jdtrT||7}nttt|j| g|jd g}d || fg}|d kr|d g7}ng|D]}tjj||^q}g|D]}tjj||^q}t|j|}| |7} |jd |d|jd|d|j||dg|tjd}x?|D]7}tj|d|}d|kswtd|qwW|jddj|g|dD]}|j ||| ^q}d}t| dkr&ddj| }ndt|jp8d}|jdkryg|D]}tjj||^qU}ntjj|}|jd|j }|jd|j }|jd|j }|jdi|d6|d6| d6|d6|d6|jd i| d6|d6|j| d!7} qfWd"|}|j!| ||j"d#||jd$||jqW|jd%|jdd&S('sWrite 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' s%s_%st rule_nameis### Generated for rule %s:t rule_sourcesRRRRs$(call do_cmd,%s_%d)tresources_grits@touch --no-create $@s%s: obj := $(abs_obj)s%s: builddir := $(abs_builddir)t FORCE_DO_CMDs\$\([^ ]* \$<\)RRls/Spaces in rule filenames not yet supported (%s)sall_deps += %sRs mkdir -p %s; scd %s; RRs $(TARGET)scmd_%(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)sRtcounttmkdirsRs9quiet_cmd_%(name)s_%(count)d = RULE %(name)s_%(count)d $@isrule_%s_outputss$(%s)s$### Finished generating for rule: %ss%### Finished generating for all rulesN(#RRhRRR6RR<R=RRXtExpandInputRootRRRRTRRkRRRRt WriteMakeRuleRftcompileRgRR?RR*RRR[Rt WriteListR( RsR~RRRRRtruleRRt all_outputst rule_sourceRtrule_source_dirnametrule_source_basenametrule_source_roottrule_source_extR2RRRR}RRtvariables_with_spacesRtacRRRRR((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRs    )    ((  )(     c CsF|jdt|jd}g}x|D]}x|dD]}t|j|}tjj|d}t|jtjj|d|} |j } t j j | | } t j j || }|j | g|gd||j| q>Wq-W|jd|djtt|f|jd ||jd S( sWrite 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' s### Generated for copy rule.t_copiestfilesit destinationtcopys%s = %sRls$(%s)N(RRhRRkRR<R=RR?RRRRRRRRn( RsRRRtvariableRRR=RSRR((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyR#s"   )cCs|jdxntjjtd|jttt|j|D]8\}}|j |g|gddt |j |qBWdS(s0Writes Makefile code for 'mac_bundle_resources'.s&### Generated for mac_bundle_resourcesR smac_tool,,,copy-bundle-resourceRN( RRRtGetMacBundleResourcesR!RRRkRRR8R(Rst resourcest bundle_depsRRU((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRIs   (cstjjtdjfd\}}}}|s>dS|rdtjj|}j||dddt j |g|gdd g|}nj |j d |j |g|gd d t|j|dS( s0Write Makefile code for bundle Info.plist files.R cstj|S(N(RkR(R(Rs(s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRYsNs$(obj).$(TOOLSET)/$(TARGET)/s: INFOPLIST_DEFINESs-Dtquoters$(call do_cmd,infoplist)s@plutil -convert xml1 $@ $@tadditional_settingssmac_tool,,,copy-info-plistR(RRtGetMacInfoPlistR!RR<R=RRRaRRRRR8R(RsRt info_plistR2tdefinest extra_envtintermediate_plist((Rss3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRUs&    cCs(xt|jD]}||} |j| jdd|dddt|jdkr|jj|} |jj|} |jj |} |jj |} |jj |}n-| jd} | jd} | jd } |j d |j| d ||j d |j| d ||j d|j| d||jdkr|j d|j| d||j d|j|d|n| jd}|rt tt |j|}n|j|d|ddqWtt|}t |jt |jt t|}|j|dx*|D]"}d|ks:td|q:W|j d|j d|j |r|jdg|dddtn|r|jdg|dd dtn|j||}|r:|j d!x.|D]&\}}}|j d"||fqW|j d#n|r|jd|j d$|j d%|j d&|jd'd(|j d)|jd*d+|jdkr|j d,|jd-d.|j d/|jd0d1qn|j|j|tt|7}|j d2S(3sWrite 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' RsDEFS_%stprefixs-DRRtcflagstcflags_ct cflags_ccs## Flags passed to all source files.s CFLAGS_%ss# Flags passed to only C files.s CFLAGS_C_%ss!# Flags passed to only C++ files.s CFLAGS_CC_%ss"# Flags passed to only ObjC files.sCFLAGS_OBJC_%ss$# Flags passed to only ObjC++ files.sCFLAGS_OBJCC_%st include_dirssINCS_%ss-ItOBJSRls-Spaces in object filenames not supported (%s)s?# Add to the list of files we specially track dependencies for.sall_deps += $(OBJS)s$(OBJS)tcomments6Make sure our dependencies are built before any of us.t order_onlys1Make sure our actions/rules run before any of us.s:# Dependencies from obj files to their precompiled headerss%s: %ss%# End precompiled header dependenciessn# CFLAGS et al overrides must be target-local. # See "Target-specific Variable Values" in the GNU Make manual.s$(OBJS): TOOLSET := $(TOOLSET)sD$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) %s tcs/$(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))sF$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) %s RNs0$(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))sG$(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) %s tmsK$(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))sI$(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) %s tmmsM$(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))N(RERFRR6RaR*Rt GetCflagst GetCflagsCt GetCflagsCCt GetCflagsObjCtGetCflagsObjCCRRRkRRRVt ObjectifyRYRRR8tGetObjDependenciesRt GetIncludetWritePchTargetstGetPchBuildCommandsRW(RsRRRRRRtprecompiled_headert confignametconfigRRRt cflags_objct cflags_objcctincludest compilabletobjstobjtpchdepstsourcetgch((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRps "     '                 cCs|s dSx|D]\}}}}idd6dd6dd6dd 6|}id d6d d6d d6d d 6|}|jd|||fd||jd||f|jd||jdd|kstd||jd||jdqWdS(s,Writes make rules to compile prefix headers.Ns$(CFLAGS_C_$(BUILDTYPE))R s$(CFLAGS_CC_$(BUILDTYPE))RNs4$(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))Rs6$(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))RtGYP_PCH_CFLAGStGYP_PCH_CXXFLAGStGYP_PCH_OBJCFLAGStGYP_PCH_OBJCXXFLAGSs %s: %s := %s sA$(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) s%s: %s FORCE_DO_CMDs @$(call do_cmd,pch_%s,1)RRls*Spaces in gch filenames not supported (%s)sall_deps += %s(RR(Rst pch_commandsR%t lang_flagtlangRt extra_flagstvar_name((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRs2  cCs^|j st|jdkr;|jdkr;|jjS|d}d}d}|jdkr|d d kr}|d}nd }d }n|jdkr|d d kr|d}nd }d }nE|jd krd |}n)|jdkr dd|jd|fGHn|jd|}|jd|}|jd}|rRd|}n|||S(sReturn the 'output basename' of a gyp spec. E.g., the loadable module 'foobar' in directory 'baz' will produce 'libfoobar.so' RRRzR|R{RvRiRs.as.sotnones%s.stamps,ERROR: What output file should be generated?RwRtproduct_prefixt product_nametproduct_extensionR(sstatic_librarys executablesshared_librarysloadable_module(sloadable_modulesshared_library(RRR*RwRtGetExecutablePathR6(RsRRt target_prefixt target_extt product_ext((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pytComputeOutputBasename s8         cCs+|jdko*|jdko*|jdkS(NRRRRzR|R{(sstatic_librarys executablesshared_librarysloadable_module(RxR*Rw(Rs((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyt_InstallImmediately5s$cCs|j sttjjd|j|j}|jdksJ|jrSd}n|jd|}tjj||j |S(sReturn the 'output' (full output path) of a gyp spec. E.g., the loadable module 'foobar' in directory 'baz' will produce '$(obj)/baz/libfoobar.so' s$(obj).Rzs $(builddir)t product_dir( RRR<R=R?RxRwR8R6R7(RsRR=((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyR:s  cCs5|jsttd}tjj||jjS(sDReturn the 'output' (full output path) to a bundle output directory.R (RRR!R<R=R?RtGetWrapperName(RsRR=((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRIs cCs&td}tjj||jjS(sAReturn the 'output' (full output path) to the binary in a bundle.R (R!R<R=R?RR3(RsRR=((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRPs cCsg}g}d|kr|jg|dD]}t|r)t|^q)x2|dD]&}|tkrU|jt|qUqUW|j|ntjj|tjj|fS(sCompute 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). t dependencies(textendRRRRRtuniquer(RsRRRtdep((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRVs  cCs&|j|jg|dddtdS(NR s Build our special outputs first.R (RRR8(RsRR((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pytWriteDependencyOnExtraOutputslscs jd|rEjj|j||dddtni}jdkrxt|jD]} || } jdkr<j j | t dfd} t j jj} j j| ttjjtjj| jttjjtjj| j} | r| || gj-gdd?d=tqDnjj0ks_j/r jd krwd@}njd0krdA}nd)}j1}jg}jdkr d'|kr jdBkr |jks t,dC|jfnjj-g|gdd<d=t|jkr j) sF t,j.|gjgdDddE|dF||j|njj2kr j2j-kr jj2g|ddG|d=tn|r jd>g|gddH|d=tq ndIS(Ls&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' s### Rules for final target.R s4Preserve order dependency of special output on deps.R R/RR cstj|S(N(RkR(R(Rs(s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRstldflagscss*|] }|jdp!d|kVqdS(s.sos.so.N(RP(RQR>((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pys ss-Wl,-rpath=\$$ORIGIN/lib.%s/s$-Wl,-rpath-link=\$(builddir)/lib.%s/t library_dirss-L%ss LDFLAGS_%ssLIBTOOLFLAGS_%st librariestLIBSs*%s: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))s%s: LIBS := $(LIBS)s4%s: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))s!$(TARGET_POSTBUILDS_$(BUILDTYPE))s%s: TARGET_POSTBUILDS_%s := %sitcdR^s%s: builddir := $(abs_builddir)s%s: POSTBUILDS := %sRlt BUNDLE_DEPSs%s: $(BUNDLE_DEPS)R|R{s+ @$(call do_cmd,mac_package_framework,,,%s)s @$(call do_postbuilds)s @true # No-op, used by testss @touch -c %ssQPostbuilds for bundles should be done on the bundle, not the binary (target '%s')R9s.Postbuilds do not work with custom product_dirRzs%s: LD_INPUTS := %sthostRt link_hostt postbuildstlinkRs2Spaces in alink input filenames not supported (%s)topenbsdtwint alink_thintalinktsolinks3Spaces in module input filenames not supported (%s)tsolink_module_hostt solink_modulettouchsWARNING: no output forsAdd target aliastphonytalls!Add target alias to "all" target.sshared librarysstatic libraryRs%s != %sRs Copy this to the %s output path.Rs!Short alias for building this %s.sAdd %s to "all" target.N(sshared_librarysloadable_module(smacsopenbsdswin(3RR?RRR8RwRERFR*Rt GetLdflagsR!RRtInvertRelativePathR=tAddImplicitPostbuildsRnR<R>R?RR6tanyRRxRtGetLibtoolflagsR=tAdjustLibrariesR<RtGetSpecPostbuildCommandsRtGetSortedXcodePostbuildEnvRtinserttxrangeRt startswithR]RRtGetFrameworkVersionRRRRRRR(RsRRRRRRRttarget_postbuildsRRR@t gyp_to_buildttarget_postbuildRAt library_dirRBRHRtlink_dept file_descRtinstallable_deps((Rss3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRrs<      !     % #                        $ RcCscd}|rEg|D]}|||^q}ddj|}n|jjd||fdS(sWrite 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. Rs \ s %s :=%s N(R?RRI(Rst value_listRRRtvaluestl((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyR^s #c Csd}|r'd|kstd}n|j||dd||fgd|dtg|D]}t|t^q]}|jdd j|d S( sWrite 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. Rt,s,,1R}s$(call do_cmd,%s%s)R tforcesall_deps += %sRlN(RRR8RntSPACE_REPLACEMENTRR?( RsRRRRR RHtsuffixR((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRms "c Cs}tt|}tt|}|r8|jd|n|r[|jddj|n|ryd}dj|} nd}|d} |rd} nd} |r|jd|dn|jd | |dj|| f|r x"|D]} |jd | qWn| rot|d kro|jd dj|d |df|jd dj|d n|jdS(sWrite 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 s# s.PHONY: Rls| Ris FORCE_DO_CMDs%s: TOOLSET := $(TOOLSET)s %s: %s%s%ss %sis%s: %ss%s: ;N(RRnRR?R( RsRRR}R R RkRRt order_insertt pick_outputt force_appendR((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRs2    (!c Cs|jdkrdS|jd|jd|jd||jd|jd |jd |jd id d 6d d6d d6}d}x`|D]X}tjj|d}||kr||cd7<||||kr|}qqqW|jd||jt|jtt |dd}idd6} i} t | | |j||t d| dd|j||t dt dd|jdkr|jdn>|jdkr|jdn|jdkr|jdn|jdS( sWrite 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. RzR|RNs/# Variable definitions for Android applicationssinclude $(CLEAR_VARS)sLOCAL_MODULE := siLOCAL_CFLAGS := $(CFLAGS_$(BUILDTYPE)) $(DEFS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(INCS_$(BUILDTYPE))s+LOCAL_CPPFLAGS := $(CFLAGS_CC_$(BUILDTYPE))sLOCAL_C_INCLUDES :=s/LOCAL_LDLIBS := $(LDFLAGS_$(BUILDTYPE)) $(LIBS)is.ccs.cpps.cxxisLOCAL_CPP_EXTENSION := tLOCAL_SRC_FILEScSsog}xb|D]Z}tjj|}|j|r |j|r |j|t|t| !q q W|S(N(R<R=RR^RPRR(RRRmtmodulestfilepathRS((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyt DepsToModuless  (RR*RRtLOCAL_SHARED_LIBRARIESRRtLOCAL_STATIC_LIBRARIESsinclude $(BUILD_EXECUTABLE)sinclude $(BUILD_SHARED_LIBRARY)sinclude $(BUILD_STATIC_LIBRARY)(s executablesshared_librarysstatic_library( RwRR<R=RXRRRRRVR-R!( Rst module_nameRRtcpp_exttdefault_cpp_extRSRLRtR)R(((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRsR            cCs|jj|ddS(Ns (RRI(Rsttext((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRscCs1tjj|jdtjjd|jd|S(Ns$(abs_builddir)s $(abs_srcdir)s $(BUILDTYPE)(RRRRR<R=R?(RsR((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRs  cCs,|jjdd}|jdi|d6S(NtCHROMIUM_STRIP_SAVE_FILERR(RtGetPerTargetSettingR(Rststrip_save_file((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyR[!s   cCs;x4|D],\}}|jdt|||fqWdS(Ns%s: export %s := %s(RRn(RsRRtktv((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyR,scCsNd|kr(|jdd|j}nd|krJd|j|f}n|S(s,Convert a path to its output directory form.s$(s$(obj)/s$(obj).%s/$(TARGET)/s$(obj)s$(obj).%s/$(TARGET)/%s(R[Rx(RsR=((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyR7s   cCsR|j|}d|kr>|jdd|j|f}|Sd|j||fS(s:Convert a prefix header path to its output directory form.s$(s$(obj)/s$(obj).%s/$(TARGET)/pch-%ss$(obj).%s/$(TARGET)/pch-%s/%s(RR[Rx(RsR=R,((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyR@s   cCs;d|kr|jdStjjtjj|j|S(slConvert a subdirectory-relative path into a base-relative path. Skips over paths that contain variables.s$(t/(trstripR<R=R>R?(RsR=((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRJs  cCs8d|krd|kr|S|i|d6|d6}|S(Ns%(INPUT_ROOT)ss%(INPUT_DIRNAME)st INPUT_ROOTt INPUT_DIRNAME((Rsttemplatet expansionRR=((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRUs  cCsL|jdkrA|jdks-|jdkrAd|j|jfSd|jS(sCReturns the location of the final output for an installable target.R|RRs$(builddir)/lib.%s/%ss $(builddir)/(RwR*RxR(Rs((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyR_sN(%t__name__t __module__t__doc__RtRRRRRRRRRR7R8RRRRR?RR7RdRRTRRRRRR[RRRRRR(((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyRosF   d  &  | ! (         > S   cCs|d}g|dD]}tjj||j^q}tjj|d|j}|jtjstjj d|}n|j di|d6dj t t |d6tjj |d gtj||d 6d S( s,Write the target to regenerate the Makefile.R0tbuild_files_argt gyp_binaryRsquiet_cmd_regen_makefile = ACTION Regenerating $@ cmd_regen_makefile = cd $(srcdir); %(cmd)s %(makefile_name)s: %(deps)s $(call do_cmd,regen_makefile) t makefile_nameRlRs-fmaketcmdN(RRt RelativePathR;tFixIfRelativePathR^R<tsepR=R?RIRRkRtRegenerateFlags(R)t root_makefileRt build_filesR0RStbuild_files_argsR((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pytWriteAutoRegenerationRuleks ,  cCs|d}xr|D]j}dg}|jrN|jdkrN|d|jf7}n|jd|d||fGHtj|qWdS(NR0tmakeRs-Cs BUILDTYPE=sBuilding [%s]: %s(R;Rt subprocesst check_call(tdatatconfigurationsR)R0Rt arguments((s3ext/snowcrash/tools/gyp/pylib/gyp/generator/make.pyt PerformBuilds   c1 s0 |dtjj|}|jdi}|jdd}|jdd}|jdd}fd} d} tg|D]} || d ^q} x6|D].} || } | d d kr| d } PqqW| sd } nd }d j}tjj j |}j r[tjj j j |}tjj |j }da nd}i|d6|d6| d 6|d6dd6td6dd6|d6}|dkrd}|ji|d6dd6td6td6n|dkr|jitd6n~|dkr*|jidd6dd6nT|dkrM|jidd6n1|dkr~|jitd6dd6dd6n|jitd[d"d#6td\d&d'6td]d*d+6td^d.d/6td_d1d26td`d4d56tdad7d86tdbd:d;6tjj|d<\}}}||jd=g}i}d>||d-s         " !%'"