include $(REP_DIR)/lib/import/import-qt_jscore.mk

SHARED_LIB = yes

# extracted from src/3rdparty/webkit/JavaScriptCore/Makefile
QT_DEFINES += -DBUILDING_QT__=1 -DWTF_USE_ACCELERATED_COMPOSITING -DNDEBUG -DBUILDING_QT__ -DBUILDING_JavaScriptCore -DBUILDING_WTF -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB

# additional defines for the Genode version
CC_OPT += -DSQLITE_NO_SYNC=1 -DSQLITE_THREADSAFE=0

# enable C++ functions that use C99 math functions (disabled by default in the Genode tool chain)
CC_CXX_OPT += -D_GLIBCXX_USE_C99_MATH

# use default warning level to avoid noise when compiling contrib code
CC_WARN =

# extracted from src/3rdparty/webkit/JavaScriptCore/Makefile
QT_SOURCES = \
		pcre_compile.cpp \
		pcre_exec.cpp \
		pcre_tables.cpp \
		pcre_ucp_searchfuncs.cpp \
		pcre_xclass.cpp \
		JSBase.cpp \
		JSCallbackConstructor.cpp \
		JSCallbackFunction.cpp \
		JSCallbackObject.cpp \
		JSClassRef.cpp \
		JSContextRef.cpp \
		JSObjectRef.cpp \
		JSStringRef.cpp \
		JSValueRef.cpp \
		OpaqueJSString.cpp \
		ARMAssembler.cpp \
		MacroAssemblerARM.cpp \
		CodeBlock.cpp \
		JumpTable.cpp \
		Opcode.cpp \
		SamplingTool.cpp \
		StructureStubInfo.cpp \
		BytecodeGenerator.cpp \
		NodesCodegen.cpp \
		DebuggerActivation.cpp \
		DebuggerCallFrame.cpp \
		Debugger.cpp \
		CallFrame.cpp \
		Interpreter.cpp \
		RegisterFile.cpp \
		ExecutableAllocatorFixedVMPool.cpp \
		ExecutableAllocatorPosix.cpp \
		ExecutableAllocatorSymbian.cpp \
		ExecutableAllocatorWin.cpp \
		ExecutableAllocator.cpp \
		JITArithmetic.cpp \
		JITCall.cpp \
		JIT.cpp \
		JITOpcodes.cpp \
		JITPropertyAccess.cpp \
		JITPropertyAccess32_64.cpp \
		JITStubs.cpp \
		Lexer.cpp \
		Nodes.cpp \
		ParserArena.cpp \
		Parser.cpp \
		Profile.cpp \
		ProfileGenerator.cpp \
		ProfileNode.cpp \
		Profiler.cpp \
		ArgList.cpp \
		Arguments.cpp \
		ArrayConstructor.cpp \
		ArrayPrototype.cpp \
		BooleanConstructor.cpp \
		BooleanObject.cpp \
		BooleanPrototype.cpp \
		CallData.cpp \
		Collector.cpp \
		CommonIdentifiers.cpp \
		Completion.cpp \
		ConstructData.cpp \
		DateConstructor.cpp \
		DateConversion.cpp \
		DateInstance.cpp \
		DatePrototype.cpp \
		ErrorConstructor.cpp \
		Error.cpp \
		ErrorInstance.cpp \
		ErrorPrototype.cpp \
		ExceptionHelpers.cpp \
		Executable.cpp \
		FunctionConstructor.cpp \
		FunctionPrototype.cpp \
		GetterSetter.cpp \
		GlobalEvalFunction.cpp \
		Identifier.cpp \
		InitializeThreading.cpp \
		InternalFunction.cpp \
		JSActivation.cpp \
		JSAPIValueWrapper.cpp \
		JSArray.cpp \
		JSByteArray.cpp \
		JSCell.cpp \
		JSFunction.cpp \
		JSGlobalData.cpp \
		JSGlobalObject.cpp \
		JSGlobalObjectFunctions.cpp \
		JSImmediate.cpp \
		JSLock.cpp \
		JSNotAnObject.cpp \
		JSNumberCell.cpp \
		JSObject.cpp \
		JSONObject.cpp \
		JSPropertyNameIterator.cpp \
		JSStaticScopeObject.cpp \
		JSString.cpp \
		JSValue.cpp \
		JSVariableObject.cpp \
		JSWrapperObject.cpp \
		LiteralParser.cpp \
		Lookup.cpp \
		MarkStackPosix.cpp \
		MarkStackSymbian.cpp \
		MarkStackWin.cpp \
		MarkStack.cpp \
		MathObject.cpp \
		NativeErrorConstructor.cpp \
		NativeErrorPrototype.cpp \
		NumberConstructor.cpp \
		NumberObject.cpp \
		NumberPrototype.cpp \
		ObjectConstructor.cpp \
		ObjectPrototype.cpp \
		Operations.cpp \
		PropertyDescriptor.cpp \
		PropertyNameArray.cpp \
		PropertySlot.cpp \
		PrototypeFunction.cpp \
		RegExpConstructor.cpp \
		RegExp.cpp \
		RegExpObject.cpp \
		RegExpPrototype.cpp \
		ScopeChain.cpp \
		SmallStrings.cpp \
		StringConstructor.cpp \
		StringObject.cpp \
		StringPrototype.cpp \
		StructureChain.cpp \
		Structure.cpp \
		TimeoutChecker.cpp \
		UString.cpp \
		UStringImpl.cpp \
		Assertions.cpp \
		ByteArray.cpp \
		CurrentTime.cpp \
		DateMath.cpp \
		dtoa.cpp \
		FastMalloc.cpp \
		HashTable.cpp \
		MainThread.cpp \
		MainThreadQt.cpp \
		ThreadingQt.cpp \
		RandomNumber.cpp \
		RefCountedLeakCounter.cpp \
		RegisterFileAllocatorSymbian.cpp \
		BlockAllocatorSymbian.cpp \
		ThreadingNone.cpp \
		Threading.cpp \
		TypeTraits.cpp \
		CollatorDefault.cpp \
		CollatorICU.cpp \
		UTF8.cpp \
		RegexCompiler.cpp \
		RegexInterpreter.cpp \
		RegexJIT.cpp \
		Grammar.cpp \
		TCSystemAlloc.cpp

# some source files need to be generated by moc from other source/header files before
# they get #included again by the original source file in the compiling stage

# source files generated from existing header files ("moc_%.cpp: %.h" rule in spec-qt4.mk)
# extracted from "compiler_moc_header_make_all" target
COMPILER_MOC_HEADER_MAKE_ALL_FILES =

# source files generated from existing source files ("%.moc: %.cpp" rule in spec-qt4.mk)
# extracted from "compiler_moc_source_make_all" rule
COMPILER_MOC_SOURCE_MAKE_ALL_FILES = \
									MainThreadQt.moc \
									ThreadingQt.moc

INC_DIR += $(REP_DIR)/src/lib/qt4/mkspecs/qws/genode-x86-g++ \
           $(REP_DIR)/include/qt4 \
           $(REP_DIR)/contrib/$(QT4)/include \
           $(REP_DIR)/include/qt4/QtCore \
           $(REP_DIR)/contrib/$(QT4)/include/QtCore \
           $(REP_DIR)/include/qt4/QtCore/private \
           $(REP_DIR)/contrib/$(QT4)/include/QtCore/private \
           $(REP_DIR)/include/qt4/QtNetwork \
           $(REP_DIR)/contrib/$(QT4)/include/QtNetwork \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/assembler \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/assembler \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/bytecode \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/bytecode \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/bytecompiler \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/bytecompiler \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/debugger \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/debugger \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/interpreter \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/interpreter \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/jit \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/jit \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/parser \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/parser \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/pcre \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/pcre \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/profiler \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/profiler \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/runtime \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/runtime \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/wtf \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/wtf \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/wtf/symbian \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/wtf/symbian \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/wtf/unicode \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/wtf/unicode \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/yarr \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/yarr \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/API \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/API \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/ForwardingHeaders \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/ForwardingHeaders \
           $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/generated \
           $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/generated \
           $(REP_DIR)/src/lib/qt4/src/corelib/global

LIBS += qt_network qt_core libc libm


vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/pcre
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/API
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/assembler
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/bytecode
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/bytecompiler
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/debugger
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/interpreter
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/jit
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/parser
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/profiler
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/runtime
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/wtf
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/wtf/qt
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/wtf/symbian
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/wtf/unicode
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/wtf/unicode/icu
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/yarr
vpath % $(REP_DIR)/src/lib/qt4/src/3rdparty/webkit/JavaScriptCore/generated


vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/pcre
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/API
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/assembler
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/bytecode
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/bytecompiler
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/debugger
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/interpreter
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/jit
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/parser
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/profiler
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/runtime
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/wtf
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/wtf/qt
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/wtf/symbian
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/wtf/unicode
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/wtf/unicode/icu
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/yarr
vpath % $(REP_DIR)/contrib/$(QT4)/src/3rdparty/webkit/JavaScriptCore/generated

include $(REP_DIR)/lib/mk/qt.mk
