1 # DerivedSources - qmake build info 2 3 CONFIG -= debug_and_release 4 5 TEMPLATE = lib 6 TARGET = dummy 7 8 QMAKE_EXTRA_TARGETS += generated_files 9 10 CONFIG(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 16 LUT_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 26 KEYWORDLUT_FILES += \ 27 parser/Keywords.table 28 29 JSCBISON += \ 30 parser/Grammar.y 31 32 RVCT_STUB_FILES += \ 33 jit/JITStubs.cpp 34 35 defineTest(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 56 lut.output = $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.lut.h 57 lut.input = LUT_FILES 58 lut.wkScript = $$PWD/create_hash_table 59 lut.commands = perl $$lut.wkScript ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT} 60 lut.depends = ${QMAKE_FILE_NAME} 61 addExtraCompiler(lut) 62 63 # GENERATOR 1-B: particular LUT creator (for 1 file only) 64 keywordlut.output = $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}Lexer.lut.h 65 keywordlut.input = KEYWORDLUT_FILES 66 keywordlut.wkScript = $$PWD/create_hash_table 67 keywordlut.commands = perl $$keywordlut.wkScript ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT} 68 keywordlut.depends = ${QMAKE_FILE_NAME} 69 addExtraCompiler(keywordlut) 70 71 # GENERATOR 2: bison grammar 72 jscbison.output = $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.cpp 73 jscbison.input = JSCBISON 74 jscbison.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 75 jscbison.depends = ${QMAKE_FILE_NAME} 76 addExtraCompiler(jscbison) 77 78 # GENERATOR 3: JIT Stub functions for RVCT 79 rvctstubs.output = $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}Generated${QMAKE_FILE_BASE}_RVCT.h 80 rvctstubs.wkScript = $$PWD/create_rvct_stubs 81 rvctstubs.commands = perl $$rvctstubs.wkScript ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT} 82 rvctstubs.depends = ${QMAKE_FILE_NAME} 83 rvctstubs.input = RVCT_STUB_FILES 84 rvctstubs.CONFIG += no_link 85 addExtraCompiler(rvctstubs) 86 87 # GENERATOR: "chartables.c": compile and execute the chartables generator (and add it to sources) 88 win32-msvc*|wince*: PREPROCESSOR = "--preprocessor=\"$$QMAKE_CC /E\"" 89 ctgen.output = $$JSC_GENERATED_SOURCES_DIR/chartables.c 90 ctgen.wkScript = $$PWD/pcre/dftables 91 ctgen.input = ctgen.wkScript 92 ctgen.commands = perl $$ctgen.wkScript ${QMAKE_FILE_OUT} $$PREPROCESSOR 93 ctgen.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_JSC_GENERATED_SOURCES_DIR}${QMAKE_FILE_BASE} 94 addExtraCompiler(ctgen) 95 96