575be7a9786419db20f59640b9819dd8ba1bd7ce
[WebKit-https.git] / JavaScriptCore / JavaScriptCore.pri
1 # JavaScriptCore - Qt4 build info
2 VPATH += $$PWD
3
4 INCLUDEPATH += tmp
5 INCLUDEPATH += $$PWD $$PWD/kjs $$PWD/bindings $$PWD/bindings/c $$PWD/wtf
6 DEPENDPATH += $$PWD $$PWD/kjs $$PWD/bindings $$PWD/bindings/c $$PWD/wtf
7 DEFINES -= KJS_IDENTIFIER_HIDE_GLOBALS 
8 qt-port:INCLUDEPATH += $$PWD/bindings/qt
9 qt-port:DEFINES += BUILDING_QT__
10 gtk-port:DEFINES += BUILDING_GTK__
11
12 # http://bugs.webkit.org/show_bug.cgi?id=16406
13 # [Gtk] JavaScriptCore needs -lpthread
14 gtk-port:!win32-*:LIBS += -lpthread
15
16 win32-msvc*: INCLUDEPATH += $$PWD/os-win32
17
18 isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = tmp
19
20 include(pcre/pcre.pri)
21
22 LUT_FILES += \
23     kjs/date_object.cpp \
24     kjs/number_object.cpp \
25     kjs/string_object.cpp \
26     kjs/array_object.cpp \
27     kjs/math_object.cpp \
28     kjs/regexp_object.cpp
29
30 KEYWORDLUT_FILES += \
31     kjs/keywords.table
32
33 KJSBISON += \
34     kjs/grammar.y
35
36 SOURCES += \
37     wtf/Assertions.cpp \
38     wtf/HashTable.cpp \
39     wtf/unicode/UTF8.cpp \
40     bindings/NP_jsobject.cpp \
41     bindings/npruntime.cpp \
42     bindings/runtime_array.cpp \
43     bindings/runtime.cpp \
44     bindings/runtime_method.cpp \
45     bindings/runtime_object.cpp \
46     bindings/runtime_root.cpp \
47     bindings/c/c_class.cpp \
48     bindings/c/c_instance.cpp \
49     bindings/c/c_runtime.cpp \
50     bindings/c/c_utility.cpp \
51     API/JSBase.cpp \
52     API/JSCallbackConstructor.cpp \
53     API/JSCallbackFunction.cpp \
54     API/JSCallbackObject.cpp \
55     API/JSClassRef.cpp \
56     API/JSContextRef.cpp \
57     API/JSObjectRef.cpp \
58     API/JSStringRef.cpp \
59     API/JSValueRef.cpp \
60     kjs/JSGlobalObject.cpp \
61     kjs/JSVariableObject.cpp
62
63 # AllInOneFile.cpp helps gcc analize and optimize code
64 # Other compilers may be able to do this at link time
65 gtk-port:CONFIG(release) {
66 SOURCES += \
67     kjs/AllInOneFile.cpp
68 } else {
69 SOURCES += \
70     kjs/function.cpp \
71     kjs/debugger.cpp \
72     kjs/array_instance.cpp \
73     kjs/array_object.cpp \
74     kjs/bool_object.cpp \
75     kjs/collector.cpp \
76     kjs/CommonIdentifiers.cpp \
77     kjs/date_object.cpp \
78     kjs/DateMath.cpp \
79     kjs/dtoa.cpp \
80     kjs/error_object.cpp \
81     kjs/ExecState.cpp \
82     kjs/function_object.cpp \
83     kjs/identifier.cpp \
84     kjs/internal.cpp \
85     kjs/interpreter.cpp \
86     kjs/JSImmediate.cpp \
87     kjs/JSLock.cpp \
88     kjs/JSWrapperObject.cpp \
89     kjs/lexer.cpp \
90     kjs/list.cpp \
91     kjs/lookup.cpp \
92     kjs/math_object.cpp \
93     kjs/nodes.cpp \
94     kjs/nodes2string.cpp \
95     kjs/number_object.cpp \
96     kjs/object.cpp \
97     kjs/object_object.cpp \
98     kjs/operations.cpp \
99     kjs/Parser.cpp \
100     kjs/property_map.cpp \
101     kjs/property_slot.cpp \
102     kjs/PropertyNameArray.cpp \
103     kjs/regexp.cpp \
104     kjs/regexp_object.cpp \
105     kjs/scope_chain.cpp \
106     kjs/string_object.cpp \
107     kjs/ustring.cpp \
108     kjs/value.cpp \
109     wtf/FastMalloc.cpp
110
111 !qt-port:SOURCES += \
112     wtf/TCSystemAlloc.cpp
113 }
114
115 qt-port:SOURCES += \
116     bindings/qt/qt_class.cpp \
117     bindings/qt/qt_instance.cpp \
118     bindings/qt/qt_runtime.cpp
119
120 gtk-port:SOURCES += \
121     wtf/ThreadingGtk.cpp
122 }
123
124 !gtk-port:SOURCES += \
125     wtf/ThreadingNone.cpp
126 }
127
128 !CONFIG(QTDIR_build) {
129     defineTest(addExtraCompiler) {
130         QMAKE_EXTRA_COMPILERS += $$1
131         generated_files.depends += compiler_$${1}_make_all
132         export(QMAKE_EXTRA_COMPILERS)
133         export(generated_files.depends)
134         return(true)
135     }
136 }
137
138 # GENERATOR 1-A: LUT creator
139 lut.output = $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.lut.h
140 lut.commands = perl $$PWD/kjs/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
141 lut.depend = ${QMAKE_FILE_NAME}
142 lut.input = LUT_FILES
143 lut.CONFIG += no_link
144 addExtraCompiler(lut)
145
146 # GENERATOR 1-B: particular LUT creator (for 1 file only)
147 keywordlut.output = $$GENERATED_SOURCES_DIR/lexer.lut.h
148 keywordlut.commands = perl $$PWD/kjs/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
149 keywordlut.depend = ${QMAKE_FILE_NAME}
150 keywordlut.input = KEYWORDLUT_FILES
151 keywordlut.CONFIG += no_link
152 addExtraCompiler(keywordlut)
153
154 # GENERATOR 2: bison grammar
155 kjsbison.output = $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.cpp
156 kjsbison.commands = bison -d -p kjsyy ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_BASE}.tab.c && $(MOVE) ${QMAKE_FILE_BASE}.tab.c ${QMAKE_FILE_OUT} && $(MOVE) ${QMAKE_FILE_BASE}.tab.h $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.h
157 kjsbison.depend = ${QMAKE_FILE_NAME}
158 kjsbison.input = KJSBISON
159 kjsbison.variable_out = GENERATED_SOURCES
160 kjsbison.dependency_type = TYPE_C
161 kjsbison.CONFIG = target_predeps
162 kjsbison.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_GENERATED_SOURCES_DIR}${QMAKE_FILE_BASE}.h
163 addExtraCompiler(kjsbison)