import glob, os env = Environment( CPPPATH = [ 'GameShell/Source/MacOSX', 'GameShell/Source/Common', '/opt/local/lib/ghc-6.6/include'], LIBPATH = [ '/opt/local/lib', '/opt/local/lib/ghc-6.6'], CCFLAGS = [ '-Wall', '-Wextra', '-Wno-unused-parameter', '-Werror'], ENV = os.environ) GS_SOURCES = map(lambda m: 'GameShell/Source/MacOSX/' + m + '.m', [ 'CGDirectDisplayAdditions', 'GSApplication', 'GSCallbacks', 'GSController', 'GSGlobals', 'GSModeChoiceController', 'GSOpenGLView', 'NSDictionary-DisplayModeAdditions']) + [ 'GameShell/Source/MacOSX/GSKeyCodes.c'] GSH_SOURCES = [ 'GameShell_stub.c', 'GameShellHaskell.c', 'GameShell.o', 'TestMain.o'] HS_LIBS = map(lambda o: 'HS' + o, [ 'rts', 'haskell98', 'OpenGL', 'OpenGL_cbits', 'base', 'base_cbits']) env.Command( target = ['GameShell.hi', 'GameShell.o', 'GameShell_stub.c', 'GameShell_stub.h'], source = 'GameShell.hs', action = 'ghc -c GameShell.hs') env.Command( target = ['TestMain.hi', 'TestMain.o'], source = ['TestMain.hs', 'GameShell.hi'], action = 'ghc -c $SOURCE') env.Program( target = 'HaskellGameShell.app/Contents/MacOS/HaskellGameShell', source = GS_SOURCES + GSH_SOURCES, FRAMEWORKS = ['Carbon', 'Cocoa', 'OpenGL'], LIBS = HS_LIBS + ['gmp']) env.Command( target = 'HaskellGameShell.app/Contents/PkgInfo', source = [], action = 'echo "APPL????" > $TARGET') env.Install( dir = 'HaskellGameShell.app/Contents/', source = 'Info.plist') env.Command( target = Dir('HaskellGameShell.app/Contents/Resources/English.lproj'), source = Dir('GameShell/Resources/English.lproj'), action = Copy('$TARGET', '$SOURCE'))