OLD | NEW |
| (Empty) |
1 #!/bin/sh | |
2 | |
3 # Copyright (c) 2008 The Chromium Authors. All rights reserved. | |
4 # Use of this source code is governed by a BSD-style license that can be | |
5 # found in the LICENSE file. | |
6 | |
7 set -ex | |
8 JS_FILES="runtime.js \ | |
9 v8natives.js \ | |
10 array.js \ | |
11 string.js \ | |
12 uri.js \ | |
13 math.js \ | |
14 messages.js \ | |
15 apinatives.js \ | |
16 debug-delay.js \ | |
17 mirror-delay.js \ | |
18 date-delay.js \ | |
19 regexp-delay.js \ | |
20 macros.py" | |
21 | |
22 V8ROOT="${SRCROOT}/../v8" | |
23 | |
24 SRC_DIR="${V8ROOT}/src" | |
25 | |
26 NATIVE_JS_FILES="" | |
27 | |
28 for i in ${JS_FILES} ; do | |
29 NATIVE_JS_FILES+="${SRC_DIR}/${i} " | |
30 done | |
31 | |
32 V8_GENERATED_SOURCES_DIR="${CONFIGURATION_TEMP_DIR}/generated" | |
33 mkdir -p "${V8_GENERATED_SOURCES_DIR}" | |
34 | |
35 LIBRARIES_CC="${V8_GENERATED_SOURCES_DIR}/libraries.cc" | |
36 LIBRARIES_EMPTY_CC="${V8_GENERATED_SOURCES_DIR}/libraries-empty.cc" | |
37 | |
38 python "${V8ROOT}/tools/js2c.py" \ | |
39 "${LIBRARIES_CC}.new" \ | |
40 "${LIBRARIES_EMPTY_CC}.new" \ | |
41 ${NATIVE_JS_FILES} | |
42 | |
43 # Only use the new files if they're different from the existing files (if any), | |
44 # preserving the existing files' timestamps when there are no changes. This | |
45 # minimizes unnecessary build activity for a no-change build. | |
46 | |
47 if ! diff -q "${LIBRARIES_CC}.new" "${LIBRARIES_CC}" >& /dev/null | |
48 then | |
49 mv "${LIBRARIES_CC}.new" "${LIBRARIES_CC}" | |
50 else | |
51 rm "${LIBRARIES_CC}.new" | |
52 fi | |
53 | |
54 if ! diff -q "${LIBRARIES_EMPTY_CC}.new" "${LIBRARIES_EMPTY_CC}" >& /dev/null | |
55 then | |
56 mv "${LIBRARIES_EMPTY_CC}.new" "${LIBRARIES_EMPTY_CC}" | |
57 else | |
58 rm "${LIBRARIES_EMPTY_CC}.new" | |
59 fi | |
OLD | NEW |