2 # Copyright 2013 the V8 project authors. All rights reserved.
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are
7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following
11 # disclaimer in the documentation and/or other materials provided
12 # with the distribution.
13 # * Neither the name of Google Inc. nor the names of its
14 # contributors may be used to endorse or promote products derived
15 # from this software without specific prior written permission.
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 cat > build/gyp/gyp.mingw << EOF
33 # Copyright (c) 2009 Google Inc. All rights reserved.
34 # Use of this source code is governed by a BSD-style license that can be
35 # found in the LICENSE file.
39 # TODO(mark): sys.path manipulation is some temporary testing stuff.
42 except ImportError, e:
44 sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
47 def MonkeyBuildFileTargets(target_list, build_file):
48 """From a target_list, returns the subset from the specified build_file.
50 build_file = build_file.replace('/', '\\\\')
51 return [p for p in target_list if gyp.common.BuildFile(p) == build_file]
52 gyp.common.BuildFileTargets = MonkeyBuildFileTargets
54 import gyp.generator.make
56 def Monkey_ITIP(self):
57 """Returns the location of the final output for an installable target."""
59 # Xcode puts shared_library results into PRODUCT_DIR, and some gyp files
60 # rely on this. Emulate this behavior for mac.
61 if (self.type == 'shared_library' and
62 (self.flavor != 'mac' or self.toolset != 'target')):
63 # Install all shared libs into a common directory (per toolset) for
64 # convenient access with LD_LIBRARY_PATH.
65 return '\$(builddir)%slib.%s%s%s' % (sep, self.toolset, sep, self.alias)
66 return '\$(builddir)' + sep + self.alias
67 gyp.generator.make.MakefileWriter._InstallableTargetInstallPath = Monkey_ITIP
69 if __name__ == '__main__':
70 sys.exit(gyp.main(sys.argv[1:]))
73 # Delete old generated Makefiles.
74 find out -name '*.mk' -or -name 'Makefile*' -exec rm {} \;
76 # Generate fresh Makefiles.
77 mv build/gyp/gyp build/gyp/gyp.original
78 mv build/gyp/gyp.mingw build/gyp/gyp
79 make out/Makefile.ia32
80 mv build/gyp/gyp build/gyp/gyp.mingw
81 mv build/gyp/gyp.original build/gyp/gyp
83 # Patch generated Makefiles: replace most backslashes with forward slashes,
84 # fix library names in linker flags.
85 FILES=$(find out -name '*.mk' -or -name 'Makefile*')
90 | sed -e 's|\([)a-zA-Z0-9]\)\\\([a-zA-Z]\)|\1/\2|g' \
91 -e 's|\([)a-zA-Z0-9]\)\\\\\([a-zA-Z]\)|\1/\2|g' \
92 -e 's|'%s/n'|'%s\\\\n'|g' \
93 -e 's|-lwinmm\.lib|-lwinmm|g' \
94 -e 's|-lws2_32\.lib|-lws2_32|g' \