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