2009-11-13 Norbert Leser <norbert.leser&nokia.com>
[WebKit-https.git] / JavaScriptCore / JavaScriptCore.pri
1 # JavaScriptCore - Qt4 build info
2 VPATH += $$PWD
3
4 CONFIG(debug, debug|release) {
5     isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = generated$${QMAKE_DIR_SEP}debug
6     OBJECTS_DIR = obj/debug
7 } else { # Release
8     isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = generated$${QMAKE_DIR_SEP}release
9     OBJECTS_DIR = obj/release
10 }
11
12 symbian: {
13     # Need to guarantee this comes before system includes of /epoc32/include
14     MMP_RULES += "USERINCLUDE ../JavaScriptCore/profiler"
15 }
16
17 INCLUDEPATH = \
18     $$PWD \
19     $$PWD/.. \
20     $$PWD/assembler \
21     $$PWD/bytecode \
22     $$PWD/bytecompiler \
23     $$PWD/debugger \
24     $$PWD/interpreter \
25     $$PWD/jit \
26     $$PWD/parser \
27     $$PWD/profiler \
28     $$PWD/runtime \
29     $$PWD/wrec \
30     $$PWD/wtf \
31     $$PWD/wtf/unicode \
32     $$PWD/yarr \
33     $$PWD/API \
34     $$PWD/ForwardingHeaders \
35     $$GENERATED_SOURCES_DIR \
36     $$INCLUDEPATH
37
38 DEFINES += BUILDING_QT__ BUILDING_JavaScriptCore BUILDING_WTF
39
40 GENERATED_SOURCES_DIR_SLASH = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}
41 win32-* {
42     LIBS += -lwinmm
43 }
44 contains(JAVASCRIPTCORE_JIT,yes) {
45     DEFINES+=ENABLE_JIT=1
46     DEFINES+=ENABLE_YARR_JIT=1
47     DEFINES+=ENABLE_YARR=1
48 }
49 contains(JAVASCRIPTCORE_JIT,no) {
50     DEFINES+=ENABLE_JIT=0
51     DEFINES+=ENABLE_YARR_JIT=0
52     DEFINES+=ENABLE_YARR=0
53 }
54
55 # In debug mode JIT disabled until crash fixed
56 win32-* {
57     CONFIG(debug):!contains(DEFINES, ENABLE_JIT=1): DEFINES+=ENABLE_JIT=0
58 }
59
60 # Rules when JIT enabled (not disabled)
61 !contains(DEFINES, ENABLE_JIT=0) {
62     linux-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) {
63         QMAKE_CXXFLAGS += -fno-stack-protector
64         QMAKE_CFLAGS += -fno-stack-protector
65     }
66 }
67
68 wince* {
69     SOURCES += $$QT_SOURCE_TREE/src/3rdparty/ce-compat/ce_time.c
70     DEFINES += WINCEBASIC
71 }
72
73 include(pcre/pcre.pri)
74
75 LUT_FILES += \
76     runtime/DatePrototype.cpp \
77     runtime/JSONObject.cpp \
78     runtime/NumberConstructor.cpp \
79     runtime/StringPrototype.cpp \
80     runtime/ArrayPrototype.cpp \
81     runtime/MathObject.cpp \
82     runtime/RegExpConstructor.cpp \
83     runtime/RegExpObject.cpp
84
85 KEYWORDLUT_FILES += \
86     parser/Keywords.table
87
88 JSCBISON += \
89     parser/Grammar.y
90
91 SOURCES += \
92     wtf/Assertions.cpp \
93     wtf/ByteArray.cpp \
94     wtf/HashTable.cpp \
95     wtf/MainThread.cpp \
96     wtf/RandomNumber.cpp \
97     wtf/RefCountedLeakCounter.cpp \
98     wtf/TypeTraits.cpp \
99     wtf/unicode/CollatorDefault.cpp \
100     wtf/unicode/icu/CollatorICU.cpp \
101     wtf/unicode/UTF8.cpp \
102     API/JSBase.cpp \
103     API/JSCallbackConstructor.cpp \
104     API/JSCallbackFunction.cpp \
105     API/JSCallbackObject.cpp \
106     API/JSClassRef.cpp \
107     API/JSContextRef.cpp \
108     API/JSObjectRef.cpp \
109     API/JSStringRef.cpp \
110     API/JSValueRef.cpp \
111     API/OpaqueJSString.cpp \
112     runtime/InitializeThreading.cpp \
113     runtime/JSGlobalData.cpp \
114     runtime/JSGlobalObject.cpp \
115     runtime/JSStaticScopeObject.cpp \
116     runtime/JSVariableObject.cpp \
117     runtime/JSActivation.cpp \
118     runtime/JSNotAnObject.cpp \
119     runtime/JSONObject.cpp \
120     runtime/LiteralParser.cpp \
121     runtime/MarkStack.cpp \
122     runtime/TimeoutChecker.cpp \
123     bytecode/CodeBlock.cpp \
124     bytecode/StructureStubInfo.cpp \
125     bytecode/JumpTable.cpp \
126     assembler/ARMAssembler.cpp \
127     assembler/MacroAssemblerARM.cpp \
128     jit/JIT.cpp \
129     jit/JITCall.cpp \
130     jit/JITArithmetic.cpp \
131     jit/JITOpcodes.cpp \
132     jit/JITPropertyAccess.cpp \
133     jit/ExecutableAllocator.cpp \
134     jit/JITStubs.cpp \
135     bytecompiler/BytecodeGenerator.cpp \
136     runtime/ExceptionHelpers.cpp \
137     runtime/JSPropertyNameIterator.cpp \
138     interpreter/Interpreter.cpp \
139     bytecode/Opcode.cpp \
140     bytecode/SamplingTool.cpp \
141     yarr/RegexCompiler.cpp \
142     yarr/RegexInterpreter.cpp \
143     yarr/RegexJIT.cpp \
144     interpreter/RegisterFile.cpp
145
146 symbian {
147     SOURCES += jit/ExecutableAllocatorSymbian.cpp \
148               runtime/MarkStackSymbian.cpp
149 } else {
150     win32-*|wince* {
151         SOURCES += jit/ExecutableAllocatorWin.cpp \
152                   runtime/MarkStackWin.cpp
153     } else {
154         SOURCES += jit/ExecutableAllocatorPosix.cpp \
155                   runtime/MarkStackPosix.cpp
156     }
157 }
158
159 !contains(DEFINES, USE_SYSTEM_MALLOC) {
160     SOURCES += wtf/TCSystemAlloc.cpp
161 }
162
163 # AllInOneFile.cpp helps gcc analize and optimize code
164 # Other compilers may be able to do this at link time
165 SOURCES += \
166     runtime/ArgList.cpp \
167     runtime/Arguments.cpp \
168     runtime/ArrayConstructor.cpp \
169     runtime/ArrayPrototype.cpp \
170     runtime/BooleanConstructor.cpp \
171     runtime/BooleanObject.cpp \
172     runtime/BooleanPrototype.cpp \
173     runtime/CallData.cpp \
174     runtime/Collector.cpp \
175     runtime/CommonIdentifiers.cpp \
176     runtime/ConstructData.cpp \
177     wtf/CurrentTime.cpp \
178     runtime/DateConstructor.cpp \
179     runtime/DateConversion.cpp \
180     runtime/DateInstance.cpp \
181     runtime/DatePrototype.cpp \
182     debugger/Debugger.cpp \
183     debugger/DebuggerCallFrame.cpp \
184     debugger/DebuggerActivation.cpp \
185     wtf/dtoa.cpp \
186     runtime/Error.cpp \
187     runtime/ErrorConstructor.cpp \
188     runtime/ErrorInstance.cpp \
189     runtime/ErrorPrototype.cpp \
190     interpreter/CallFrame.cpp \
191     runtime/Executable.cpp \
192     runtime/FunctionConstructor.cpp \
193     runtime/FunctionPrototype.cpp \
194     runtime/GetterSetter.cpp \
195     runtime/GlobalEvalFunction.cpp \
196     runtime/Identifier.cpp \
197     runtime/InternalFunction.cpp \
198     runtime/Completion.cpp \
199     runtime/JSArray.cpp \
200     runtime/JSAPIValueWrapper.cpp \
201     runtime/JSByteArray.cpp \
202     runtime/JSCell.cpp \
203     runtime/JSFunction.cpp \
204     runtime/JSGlobalObjectFunctions.cpp \
205     runtime/JSImmediate.cpp \
206     runtime/JSLock.cpp \
207     runtime/JSNumberCell.cpp \
208     runtime/JSObject.cpp \
209     runtime/JSString.cpp \
210     runtime/JSValue.cpp \
211     runtime/JSWrapperObject.cpp \
212     parser/Lexer.cpp \
213     runtime/Lookup.cpp \
214     runtime/MathObject.cpp \
215     runtime/NativeErrorConstructor.cpp \
216     runtime/NativeErrorPrototype.cpp \
217     parser/Nodes.cpp \
218     runtime/NumberConstructor.cpp \
219     runtime/NumberObject.cpp \
220     runtime/NumberPrototype.cpp \
221     runtime/ObjectConstructor.cpp \
222     runtime/ObjectPrototype.cpp \
223     runtime/Operations.cpp \
224     parser/Parser.cpp \
225     parser/ParserArena.cpp \
226     runtime/PropertyDescriptor.cpp \
227     runtime/PropertyNameArray.cpp \
228     runtime/PropertySlot.cpp \
229     runtime/PrototypeFunction.cpp \
230     runtime/RegExp.cpp \
231     runtime/RegExpConstructor.cpp \
232     runtime/RegExpObject.cpp \
233     runtime/RegExpPrototype.cpp \
234     runtime/ScopeChain.cpp \
235     runtime/SmallStrings.cpp \
236     runtime/StringConstructor.cpp \
237     runtime/StringObject.cpp \
238     runtime/StringPrototype.cpp \
239     runtime/Structure.cpp \
240     runtime/StructureChain.cpp \
241     runtime/UString.cpp \
242     profiler/HeavyProfile.cpp \
243     profiler/Profile.cpp \
244     profiler/ProfileGenerator.cpp \
245     profiler/ProfileNode.cpp \
246     profiler/Profiler.cpp \
247     profiler/TreeProfile.cpp \
248     wtf/DateMath.cpp \
249     wtf/FastMalloc.cpp \
250     wtf/Threading.cpp \
251     wtf/qt/MainThreadQt.cpp
252
253 !contains(DEFINES, ENABLE_SINGLE_THREADED=1) {
254     SOURCES += wtf/qt/ThreadingQt.cpp
255 } else {
256     DEFINES += ENABLE_JSC_MULTIPLE_THREADS=0
257     SOURCES += wtf/ThreadingNone.cpp
258 }
259
260 # GENERATOR 1-A: LUT creator
261 lut.output = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.lut.h
262 lut.commands = perl $$PWD/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
263 lut.depend = ${QMAKE_FILE_NAME}
264 lut.input = LUT_FILES
265 lut.CONFIG += no_link
266 addExtraCompiler(lut)
267
268 # GENERATOR 1-B: particular LUT creator (for 1 file only)
269 keywordlut.output = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}Lexer.lut.h
270 keywordlut.commands = perl $$PWD/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
271 keywordlut.depend = ${QMAKE_FILE_NAME}
272 keywordlut.input = KEYWORDLUT_FILES
273 keywordlut.CONFIG += no_link
274 addExtraCompiler(keywordlut)
275
276 # GENERATOR 2: bison grammar
277 jscbison.output = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.cpp
278 jscbison.commands = bison -d -p jscyy ${QMAKE_FILE_NAME} -o $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.c && $(MOVE) $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.c ${QMAKE_FILE_OUT} && $(MOVE) $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.h $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.h
279 jscbison.depend = ${QMAKE_FILE_NAME}
280 jscbison.input = JSCBISON
281 jscbison.variable_out = GENERATED_SOURCES
282 jscbison.dependency_type = TYPE_C
283 jscbison.CONFIG = target_predeps
284 addExtraCompilerWithHeader(jscbison)
285