Import('env')
import sys

files = ["BootManager.cpp",
        "Config.cpp",
        "FileSearch.cpp",
        "Frame.cpp",
        "GameListCtrl.cpp",
        "Globals.cpp",
        "ISOFile.cpp",
        "Main.cpp",
        "MemcardManager.cpp",
        "MemoryCards/GCMemcard.cpp",
#        "MainNoGUI.cpp",
        "PluginManager.cpp",
        "PluginOptions.cpp",
        "stdafx.cpp",
        ]

wxenv = env.Copy()
wxenv.Append(
	CXXFLAGS = ' ' + ' '.join([
		'`wx-config --cppflags`',
		'-DUSE_XPM_BITMAPS',
		'-DwxNEEDS_CHARPP',
		'`sdl-config --cflags`',
		]),
	LINKFLAGS = ' ' + ' '.join([
		'-L/usr/local/lib',
		'-pthread',
		'`wx-config --libs`',
		'`sdl-config --libs`'
		])
	)

if sys.platform == 'darwin':
	icon = 'Dolphin'
	version = 'svn'
	wxenv.Program('../../../../Binary/mac/Dolphin.app/Contents/MacOS/Dolphin', files, LIBS = ["debwx", "discio", "core", "bdisasm", "videocommon", "common" , "z"])
	wxenv.Plist("../../../../Binary/mac/Dolphin.app/Contents/Info.plist", Value(dict(
		CFAppleHelpAnchor = 'index',
		CFBundleExecutable = 'Dolphin',
		CFBundleGetInfoHTML = 'Dolphin ' + version,
		CFBundleIconFile = icon,
		CFBundleIdentifier = 'com.dolphin-emu.dolphin',
		CFBundleName = 'Dolphin',
		CFBundlePackageType = 'APPL',
		CFBundleShortVersionString = version,
		CFBundleSignature = 'dlfn',
		CFBundleVersion = version,
		LSRequiresCarbon = True,
		NSPrefPaneIconFile = icon,
		NSPrefPaneIconLabel = 'Dolphin',
		)))
else:
	wxenv.Program("../../../../Binary/linux/Dolphin", files, LIBS = ["debwx", "discio", "core", "bdisasm", "videocommon", "common"])
