]> git.saurik.com Git - apple/javascriptcore.git/blame - DerivedSources.pro
JavaScriptCore-576.tar.gz
[apple/javascriptcore.git] / DerivedSources.pro
CommitLineData
f9bf01c6
A
1# DerivedSources - qmake build info
2
3CONFIG -= debug_and_release
4
5TEMPLATE = lib
6TARGET = dummy
7
8QMAKE_EXTRA_TARGETS += generated_files
9
10CONFIG(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
16LUT_FILES += \
17 runtime/ArrayPrototype.cpp \
18 runtime/DatePrototype.cpp \
19 runtime/JSONObject.cpp \
20 runtime/MathObject.cpp \
21 runtime/NumberConstructor.cpp \
22 runtime/RegExpConstructor.cpp \
23 runtime/RegExpObject.cpp \
24 runtime/StringPrototype.cpp
25
26KEYWORDLUT_FILES += \
27 parser/Keywords.table
28
29JSCBISON += \
30 parser/Grammar.y
31
32RVCT_STUB_FILES += \
33 jit/JITStubs.cpp
34
35defineTest(addExtraCompiler) {
36 eval($${1}.CONFIG = target_predeps no_link)
37 eval($${1}.variable_out =)
38 eval($${1}.dependency_type = TYPE_C)
39
40 wkScript = $$eval($${1}.wkScript)
41 eval($${1}.depends += $$wkScript)
42
43 export($${1}.CONFIG)
44 export($${1}.variable_out)
45 export($${1}.dependency_type)
46 export($${1}.depends)
47
48 QMAKE_EXTRA_COMPILERS += $$1
49 generated_files.depends += compiler_$${1}_make_all
50 export(QMAKE_EXTRA_COMPILERS)
51 export(generated_files.depends)
52 return(true)
53}
54
55# GENERATOR 1-A: LUT creator
56lut.output = $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.lut.h
57lut.input = LUT_FILES
58lut.wkScript = $$PWD/create_hash_table
59lut.commands = perl $$lut.wkScript ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
60lut.depends = ${QMAKE_FILE_NAME}
61addExtraCompiler(lut)
62
63# GENERATOR 1-B: particular LUT creator (for 1 file only)
64keywordlut.output = $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}Lexer.lut.h
65keywordlut.input = KEYWORDLUT_FILES
66keywordlut.wkScript = $$PWD/create_hash_table
67keywordlut.commands = perl $$keywordlut.wkScript ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
68keywordlut.depends = ${QMAKE_FILE_NAME}
69addExtraCompiler(keywordlut)
70
71# GENERATOR 2: bison grammar
72jscbison.output = $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.cpp
73jscbison.input = JSCBISON
74jscbison.commands = bison -d -p jscyy ${QMAKE_FILE_NAME} -o $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.c && $(MOVE) $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.c ${QMAKE_FILE_OUT} && $(MOVE) $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.h $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.h
75jscbison.depends = ${QMAKE_FILE_NAME}
76addExtraCompiler(jscbison)
77
78# GENERATOR 3: JIT Stub functions for RVCT
79rvctstubs.output = $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}Generated${QMAKE_FILE_BASE}_RVCT.h
80rvctstubs.wkScript = $$PWD/create_rvct_stubs
81rvctstubs.commands = perl $$rvctstubs.wkScript ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT}
82rvctstubs.depends = ${QMAKE_FILE_NAME}
83rvctstubs.input = RVCT_STUB_FILES
84rvctstubs.CONFIG += no_link
85addExtraCompiler(rvctstubs)
86
87# GENERATOR: "chartables.c": compile and execute the chartables generator (and add it to sources)
88win32-msvc*|wince*: PREPROCESSOR = "--preprocessor=\"$$QMAKE_CC /E\""
89ctgen.output = $$JSC_GENERATED_SOURCES_DIR/chartables.c
90ctgen.wkScript = $$PWD/pcre/dftables
91ctgen.input = ctgen.wkScript
92ctgen.commands = perl $$ctgen.wkScript ${QMAKE_FILE_OUT} $$PREPROCESSOR
93ctgen.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_JSC_GENERATED_SOURCES_DIR}${QMAKE_FILE_BASE}
94addExtraCompiler(ctgen)
95