04a7a5470093a00f9eec57a31cad1f597610a964
[WebKit-https.git] / Source / JavaScriptCore / DerivedSources.pro
1 # DerivedSources - qmake build info
2
3 CONFIG -= debug_and_release
4
5 TEMPLATE = lib
6 TARGET = dummy
7
8 QMAKE_EXTRA_TARGETS += generated_files
9
10 CONFIG(standalone_package) {
11     isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = $$PWD/generated
12 } else {
13     isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = generated
14 }
15
16 LUT_FILES += \
17     runtime/ArrayConstructor.cpp \
18     runtime/ArrayPrototype.cpp \
19     runtime/BooleanPrototype.cpp \
20     runtime/DateConstructor.cpp \
21     runtime/DatePrototype.cpp \
22     runtime/ErrorPrototype.cpp \
23     runtime/JSGlobalObject.cpp \
24     runtime/JSONObject.cpp \
25     runtime/MathObject.cpp \
26     runtime/NumberConstructor.cpp \
27     runtime/NumberPrototype.cpp \
28     runtime/ObjectConstructor.cpp \
29     runtime/ObjectPrototype.cpp \
30     runtime/RegExpConstructor.cpp \
31     runtime/RegExpObject.cpp \
32     runtime/RegExpPrototype.cpp \
33     runtime/StringConstructor.cpp \
34     runtime/StringPrototype.cpp \
35
36 KEYWORDLUT_FILES += \
37     parser/Keywords.table
38
39 JIT_STUB_FILES += \
40     jit/JITStubs.cpp
41
42 defineTest(addExtraCompiler) {
43     eval($${1}.CONFIG = target_predeps no_link)
44     eval($${1}.variable_out =)
45     eval($${1}.dependency_type = TYPE_C)
46
47     wkScript = $$eval($${1}.wkScript)
48     eval($${1}.depends += $$wkScript)
49
50     export($${1}.CONFIG)
51     export($${1}.variable_out)
52     export($${1}.dependency_type)
53     export($${1}.depends)
54
55     QMAKE_EXTRA_COMPILERS += $$1
56     generated_files.depends += compiler_$${1}_make_all
57     export(QMAKE_EXTRA_COMPILERS)
58     export(generated_files.depends)
59     return(true)
60 }
61
62 # GENERATOR 1-A: LUT creator
63 lut.output = $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.lut.h
64 lut.input = LUT_FILES
65 lut.wkScript = $$PWD/create_hash_table
66 lut.commands = perl $$lut.wkScript ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
67 lut.depends = ${QMAKE_FILE_NAME}
68 addExtraCompiler(lut)
69
70 # GENERATOR 1-B: particular LUT creator (for 1 file only)
71 keywordlut.output = $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}Lexer.lut.h
72 keywordlut.input = KEYWORDLUT_FILES
73 keywordlut.wkScript = $$PWD/create_hash_table
74 keywordlut.commands = perl $$keywordlut.wkScript ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
75 keywordlut.depends = ${QMAKE_FILE_NAME}
76 addExtraCompiler(keywordlut)
77
78 # GENERATOR 2-A: JIT Stub functions for RVCT
79 rvctstubs.output = $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}Generated${QMAKE_FILE_BASE}_RVCT.h
80 rvctstubs.wkScript = $$PWD/create_jit_stubs
81 rvctstubs.commands = perl -i $$rvctstubs.wkScript --prefix RVCT ${QMAKE_FILE_NAME} > ${QMAKE_FILE_OUT}
82 rvctstubs.depends = ${QMAKE_FILE_NAME}
83 rvctstubs.input = JIT_STUB_FILES
84 rvctstubs.CONFIG += no_link
85 addExtraCompiler(rvctstubs)
86
87 # GENERATOR 2-B: JIT Stub functions for MSVC
88 msvcstubs.output = $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}Generated${QMAKE_FILE_BASE}_MSVC.asm
89 msvcstubs.wkScript = $$PWD/create_jit_stubs
90 msvcstubs.commands = perl -i $$msvcstubs.wkScript --prefix MSVC ${QMAKE_FILE_NAME} > ${QMAKE_FILE_OUT}
91 msvcstubs.depends = ${QMAKE_FILE_NAME}
92 msvcstubs.input = JIT_STUB_FILES
93 msvcstubs.CONFIG += no_link
94 addExtraCompiler(msvcstubs)
95
96 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
97 retgen.output = $$JSC_GENERATED_SOURCES_DIR/RegExpJitTables.h
98 retgen.wkScript = $$PWD/create_regex_tables 
99 retgen.input = retgen.wkScript
100 retgen.commands = python $$retgen.wkScript > ${QMAKE_FILE_OUT}
101 addExtraCompiler(retgen)