SubDir TOP WebKit ;

local defines = [ FDefines BUILDING_HAIKU__=1 ] ;

# To turn off debugging symbols export NDEBUG=1 in the environment
SubDirC++Flags $(defines) ;
SubDirCcFlags $(defines) ;

SubDirSysHdrs $(TOP) JavaScriptCore ;
SubDirSysHdrs $(TOP) WebCore svg ;
SubDirSysHdrs $(TOP) WebCore bindings js ;

SubDirHdrs $(TOP) ;
SubDirHdrs $(TOP) WebCore ;

SubDirHdrs $(TOP) JavaScriptCore API ;
SubDirHdrs $(TOP) JavaScriptCore assembler ;
SubDirHdrs $(TOP) JavaScriptCore bytecode ;
SubDirHdrs $(TOP) JavaScriptCore interpreter ;
SubDirHdrs $(TOP) JavaScriptCore jit ;
SubDirHdrs $(TOP) JavaScriptCore parser ;
SubDirHdrs $(TOP) JavaScriptCore runtime ;
SubDirHdrs $(TOP) JavaScriptCore wtf ;

SubDirHdrs $(TOP) WebCore DerivedSources WebCore ;
SubDirHdrs $(TOP) WebCore ForwardingHeaders wtf ;
SubDirHdrs $(TOP) WebCore ForwardingHeaders runtime ;
SubDirHdrs $(TOP) WebCore bindings js ;
SubDirHdrs $(TOP) WebCore bridge ;
SubDirHdrs $(TOP) WebCore bridge jsc ;
SubDirHdrs $(TOP) WebCore css ;
SubDirHdrs $(TOP) WebCore dom ;
SubDirHdrs $(TOP) WebCore editing ;
SubDirHdrs $(TOP) WebCore history ;
SubDirHdrs $(TOP) WebCore html ;
SubDirHdrs $(TOP) WebCore inspector ;
SubDirHdrs $(TOP) WebCore loader ;
SubDirHdrs $(TOP) WebCore loader appcache ;
SubDirHdrs $(TOP) WebCore loader icon ;
SubDirHdrs $(TOP) WebCore page ;
SubDirHdrs $(TOP) WebCore page animation ;
SubDirHdrs $(TOP) WebCore platform ;
SubDirHdrs $(TOP) WebCore platform animation ;
SubDirHdrs $(TOP) WebCore platform graphics ;
SubDirHdrs $(TOP) WebCore platform graphics haiku ;
SubDirHdrs $(TOP) WebCore platform graphics transforms ;
SubDirHdrs $(TOP) WebCore platform network ;
SubDirHdrs $(TOP) WebCore platform network curl ;
SubDirHdrs $(TOP) WebCore platform text ;
SubDirHdrs $(TOP) WebCore platform sql ;
SubDirHdrs $(TOP) WebCore plugins ;
SubDirHdrs $(TOP) WebCore rendering ;
SubDirHdrs $(TOP) WebCore rendering style ;
SubDirHdrs $(TOP) WebCore storage ;
SubDirHdrs $(TOP) WebCore svg ;
SubDirHdrs $(TOP) WebCore svg animation ;
SubDirHdrs $(TOP) WebCore svg graphics ;


#-----------------------------------------------------------------------------
# WebKit API
#-----------------------------------------------------------------------------
SEARCH_SOURCE += [ FDirName $(TOP) WebKit haiku API ] ;
SEARCH_SOURCE += [ FDirName $(TOP) WebKit haiku WebCoreSupport ] ;

SharedLibrary libwebkit.so :
	# WebCoreSupport
	ChromeClientHaiku.cpp
	ContextMenuClientHaiku.cpp
	CookieJarClientHaiku.cpp
	DragClientHaiku.cpp
	EditorClientHaiku.cpp
	FrameLoaderClientHaiku.cpp
	InspectorClientHaiku.cpp
	# API
	NetworkCookie.cpp
	NetworkCookieJar.cpp
	WebDownload.cpp
	WebDownloadPrivate.cpp
	WebFrame.cpp
	WebPage.cpp
	WebSettings.cpp
	WebSettingsPrivate.cpp
	WebView.cpp
	WebWindow.cpp

	:
	libjavascriptcore.so libwebcore.so
	# Other required libraries
	icuuc stdc++
	# Haiku libraries
	be translation tracker
;


#-----------------------------------------------------------------------------
# HaikuLauncher
#-----------------------------------------------------------------------------
SEARCH_SOURCE += [ FDirName $(TOP) WebKit haiku HaikuLauncher ] ;

Application HaikuLauncher :
	LauncherApp.cpp
	LauncherWindow.cpp

	:
	libjavascriptcore.so libwebcore.so libwebkit.so
	# Other required libraries
	curl icuuc icudt png sqlite3 xml2 z
	# Haiku libraries
	be bsd network stdc++ translation
	:
	Launcher.rdef
;


#-----------------------------------------------------------------------------
# WebPositive
#-----------------------------------------------------------------------------
SEARCH_SOURCE += [ FDirName $(TOP) WebKit haiku WebPositive ] ;
SEARCH_SOURCE += [ FDirName $(TOP) WebKit haiku WebPositive autocompletion ] ;
SEARCH_SOURCE += [ FDirName $(TOP) WebKit haiku WebPositive support ] ;
SEARCH_SOURCE += [ FDirName $(TOP) WebKit haiku WebPositive tabview ] ;

# SVN revision
local svnRevisionFile = [ FGristFiles svn_revision ] ;
MakeLocate $(svnRevisionFile) : $(LOCATE_TARGET) ;
CreateSVNRevisionFile $(svnRevisionFile) ;


Application WebPositive :
	# autocompletion
	AutoCompleter.cpp
	AutoCompleterDefaultImpl.cpp
	TextViewCompleter.cpp
	# support
	BaseURL.cpp
    BitmapButton.cpp
    DateTime.cpp
    FontSelectionView.cpp
    IconButton.cpp
    SettingsMessage.cpp
    StringForSize.cpp
    # tabview
    TabContainerView.cpp
    TabManager.cpp
    TabView.cpp
	# WebPositive
    AuthenticationPanel.cpp
	BrowserApp.cpp
	BrowserWindow.cpp
    BrowsingHistory.cpp
    CredentialsStorage.cpp
    DownloadProgressView.cpp
    DownloadWindow.cpp
    SettingsKeys.cpp
	SettingsWindow.cpp
	svn_revision.cpp
	URLInputGroup.cpp

	:
	libjavascriptcore.so libwebcore.so libwebkit.so
	# Other required libraries
	curl icuuc icudata png sqlite3 xml2 z
	# Haiku libraries
	be bsd locale localestub network stdc++ tracker translation
	:
	WebPositive.rdef
;
