Bumping the PLT count back to 5.
[WebKit-https.git] / JavaScriptCore / generate-derived-sources
1 #!/bin/sh
2
3 DerivedSourcesDir="${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore"
4
5 mkdir -p "${DerivedSourcesDir}"
6
7 # Invoke the create_hash_table perl script to create all of our lookup tables
8
9 if [ kjs/array_object.cpp -nt "$DerivedSourcesDir/array_object.lut.h" -o kjs/create_hash_table -nt "$DerivedSourcesDir/array_object.lut.h" ]; then
10   kjs/create_hash_table kjs/array_object.cpp > "$DerivedSourcesDir/array_object.lut.h" -i
11 fi
12
13 if [ kjs/date_object.cpp -nt "$DerivedSourcesDir/date_object.lut.h" -o kjs/create_hash_table -nt "$DerivedSourcesDir/date_object.lut.h" ]; then
14   kjs/create_hash_table kjs/date_object.cpp > "$DerivedSourcesDir/date_object.lut.h" -i
15 fi
16
17 if [ kjs/math_object.cpp -nt "$DerivedSourcesDir/math_object.lut.h" -o kjs/create_hash_table -nt "$DerivedSourcesDir/math_object.lut.h" ]; then
18   kjs/create_hash_table kjs/math_object.cpp > "$DerivedSourcesDir/math_object.lut.h" -i
19 fi
20
21 if [ kjs/number_object.cpp -nt "$DerivedSourcesDir/number_object.lut.h" -o kjs/create_hash_table -nt "$DerivedSourcesDir/number_object.lut.h" ]; then
22   kjs/create_hash_table kjs/number_object.cpp > "$DerivedSourcesDir/number_object.lut.h" -i
23 fi
24
25 if [ kjs/regexp_object.cpp -nt "$DerivedSourcesDir/regexp_object.lut.h" -o kjs/create_hash_table -nt "$DerivedSourcesDir/regexp_object.lut.h" ]; then
26   kjs/create_hash_table kjs/regexp_object.cpp > "$DerivedSourcesDir/regexp_object.lut.h" -i
27 fi
28
29 if [ kjs/string_object.cpp -nt "$DerivedSourcesDir/string_object.lut.h" -o kjs/create_hash_table -nt "$DerivedSourcesDir/string_object.lut.h" ]; then
30   kjs/create_hash_table kjs/string_object.cpp > "$DerivedSourcesDir/string_object.lut.h" -i
31 fi
32
33 if [ kjs/keywords.table -nt "$DerivedSourcesDir/lexer.lut.h" -o kjs/create_hash_table -nt "$DerivedSourcesDir/lexer.lut.h" ]; then
34   kjs/create_hash_table kjs/keywords.table > "$DerivedSourcesDir/lexer.lut.h" -i
35 fi
36
37 # Generate the grammar using bison
38 if [ kjs/grammar.y -nt "$DerivedSourcesDir/grammar.cpp" -o kjs/grammar.y -nt "$DerivedSourcesDir/grammar.h" ]; then
39   echo "Generating the JS grammar using bison..."
40   bison -d -p kjsyy kjs/grammar.y -o "$DerivedSourcesDir/grammar.cpp"
41   cat "$DerivedSourcesDir/grammar.cpp.h" "$DerivedSourcesDir/grammar.hpp" > "$DerivedSourcesDir/grammar.h" 2>/dev/null
42 fi
43
44 if [ "$BUILT_PRODUCTS_DIR/dftables" -nt "$DerivedSourcesDir/chartables.c" ]; then
45   echo "Generating chartables.c using dftables..."
46   "$BUILT_PRODUCTS_DIR/dftables" "$DerivedSourcesDir/chartables.c"
47 fi