2008-05-15 Ariya Hidayat <ariya.hidayat@trolltech.com>
[WebKit-https.git] / JavaScriptCore / JavaScriptCore.pri
1 # JavaScriptCore - Qt4 build info
2 VPATH += $$PWD
3
4 INCLUDEPATH += tmp
5 INCLUDEPATH += $$PWD $$PWD/kjs $$PWD/wtf $$PWD/wtf/unicode
6 DEPENDPATH += $$PWD $$PWD/kjs $$PWD/wtf $$PWD/wtf/unicode
7 DEFINES -= KJS_IDENTIFIER_HIDE_GLOBALS 
8 DEFINES += BUILDING_QT__
9
10 win32-msvc*: INCLUDEPATH += $$PWD/os-win32
11
12 isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = tmp
13
14 include(pcre/pcre.pri)
15
16 LUT_FILES += \
17     kjs/date_object.cpp \
18     kjs/number_object.cpp \
19     kjs/string_object.cpp \
20     kjs/array_object.cpp \
21     kjs/math_object.cpp \
22     kjs/regexp_object.cpp
23
24 KEYWORDLUT_FILES += \
25     kjs/keywords.table
26
27 KJSBISON += \
28     kjs/grammar.y
29
30 SOURCES += \
31     wtf/Assertions.cpp \
32     wtf/HashTable.cpp \
33     wtf/MainThread.cpp \
34     wtf/unicode/CollatorDefault.cpp \
35     wtf/unicode/icu/CollatorICU.cpp \
36     wtf/unicode/UTF8.cpp \
37     API/JSBase.cpp \
38     API/JSCallbackConstructor.cpp \
39     API/JSCallbackFunction.cpp \
40     API/JSCallbackObject.cpp \
41     API/JSClassRef.cpp \
42     API/JSContextRef.cpp \
43     API/JSObjectRef.cpp \
44     API/JSStringRef.cpp \
45     API/JSValueRef.cpp \
46     kjs/InitializeThreading.cpp \
47     kjs/JSGlobalObject.cpp \
48     kjs/JSVariableObject.cpp
49
50 # AllInOneFile.cpp helps gcc analize and optimize code
51 # Other compilers may be able to do this at link time
52 SOURCES += \
53     kjs/function.cpp \
54     kjs/debugger.cpp \
55     kjs/array_instance.cpp \
56     kjs/array_object.cpp \
57     kjs/bool_object.cpp \
58     kjs/collector.cpp \
59     kjs/CommonIdentifiers.cpp \
60     kjs/date_object.cpp \
61     kjs/DateMath.cpp \
62     kjs/dtoa.cpp \
63     kjs/error_object.cpp \
64     kjs/ExecState.cpp \
65     kjs/function_object.cpp \
66     kjs/identifier.cpp \
67     kjs/internal.cpp \
68     kjs/interpreter.cpp \
69     kjs/JSImmediate.cpp \
70     kjs/JSLock.cpp \
71     kjs/JSWrapperObject.cpp \
72     kjs/lexer.cpp \
73     kjs/list.cpp \
74     kjs/lookup.cpp \
75     kjs/math_object.cpp \
76     kjs/nodes.cpp \
77     kjs/nodes2string.cpp \
78     kjs/number_object.cpp \
79     kjs/object.cpp \
80     kjs/object_object.cpp \
81     kjs/operations.cpp \
82     kjs/Parser.cpp \
83     kjs/property_map.cpp \
84     kjs/property_slot.cpp \
85     kjs/PropertyNameArray.cpp \
86     kjs/regexp.cpp \
87     kjs/regexp_object.cpp \
88     kjs/scope_chain.cpp \
89     kjs/string_object.cpp \
90     kjs/ustring.cpp \
91     kjs/value.cpp \
92     profiler/ProfileNode.cpp \
93     profiler/Profile.cpp \
94     profiler/Profiler.cpp \
95     wtf/FastMalloc.cpp \
96     wtf/ThreadingQt.cpp \
97     wtf/qt/MainThreadQt.cpp
98
99 !CONFIG(QTDIR_build) {
100     defineTest(addExtraCompiler) {
101         QMAKE_EXTRA_COMPILERS += $$1
102         generated_files.depends += compiler_$${1}_make_all
103         export(QMAKE_EXTRA_COMPILERS)
104         export(generated_files.depends)
105         return(true)
106     }
107 }
108
109 # GENERATOR 1-A: LUT creator
110 lut.output = $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.lut.h
111 lut.commands = perl $$PWD/kjs/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
112 lut.depend = ${QMAKE_FILE_NAME}
113 lut.input = LUT_FILES
114 lut.CONFIG += no_link
115 addExtraCompiler(lut)
116
117 # GENERATOR 1-B: particular LUT creator (for 1 file only)
118 keywordlut.output = $$GENERATED_SOURCES_DIR/lexer.lut.h
119 keywordlut.commands = perl $$PWD/kjs/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
120 keywordlut.depend = ${QMAKE_FILE_NAME}
121 keywordlut.input = KEYWORDLUT_FILES
122 keywordlut.CONFIG += no_link
123 addExtraCompiler(keywordlut)
124
125 # GENERATOR 2: bison grammar
126 kjsbison.output = $$GENERATED_SOURCES_DIR/${QMAKE_FILE_BASE}.cpp
127 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
128 kjsbison.depend = ${QMAKE_FILE_NAME}
129 kjsbison.input = KJSBISON
130 kjsbison.variable_out = GENERATED_SOURCES
131 kjsbison.dependency_type = TYPE_C
132 kjsbison.CONFIG = target_predeps
133 kjsbison.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_GENERATED_SOURCES_DIR}${QMAKE_FILE_BASE}.h
134 addExtraCompiler(kjsbison)