# Gargoyle Glk -- a pretty glk library

SubDir TOP garglk ;
ObjDir garglk ;

SubDirCcFlags $(GARGLKCCFLAGS) ;

if $(OS) = MINGW
{
    SubDirHdrs $(TOP) support freetype-2.3.7 include ;
    SubDirHdrs $(TOP) support zlib-1.2.3 ;
    SubDirHdrs $(TOP) support libpng-1.2.32 ;
    SubDirHdrs $(TOP) support jpeg-6b ;
    SubDirHdrs $(TOP) support sdl-1.2.13 ;
}

if $(USESDL)
{
    SubDirHdrs $(TOP) support sdl_sound-1.0.3 ;
}

GARGSRCS = 
    gi_blorb.c gi_dispa.c
    cggestal.c cgblorb.c cgfref.c cgmisc.c cgstyle.c cgstream.c cgunicod.c
    window.c winblank.c winpair.c wingrid.c wintext.c wingfx.c winmask.c
    event.c draw.c config.c
    imgload.c imgscale.c
    fontdata.c 
    ;

if $(USESDL) { GARGSRCS += sndsdl.c ; }
else if $(USEFMOD) { GARGSRCS += sndfmod.c ; }
else { GARGSRCS += sndnull.c ; }

if $(OS) = MINGW
{
    GARGSRCS += syswin.c icons.rc ;
    Main gargoyle : launcher.c ;
    SharedLinkLibraries gargoyle : libgarglk ;
}
else
{
    GARGSRCS += sysgtk.c ;
    MakeLocate gargoyle : $(LOCATE_TARGET) ;
    Shell gargoyle : launcher.sh ;
}

Library libgarglkmain : main.c ;
SharedLibrary libgarglk : $(GARGSRCS) ;

if ( $(OS) = LINUX || $(OS) = SOLARIS ) && $(USESDL)
{
    LinkLibrariesOnSharedLibrary libgarglk : SDL_sound_static ;
}

