#
# Requirements:
#
# OpenGL, GLU: standard
# SDL:         http://www.libsdl.org 
#              http://www.libsdl.org/release/
# SDL_image:   http://www.libsdl.org/projects/SDL_image 
#              http://www.libsdl.org/projects/SDL_image/release/
#
# On Mac OS X, you have to fix the SDL_image framework header
# (installed at Library/Frameworks/SDL_image.framework/Headers/SDL_image.h)
# so that the includes use <SDL/...> instead of "..."
# OR use the SDL distribution from Fink instead.

include ../../toprules.make
INCLUDES += -I$(TOPDIR)
LDFLAGS += -L$(TOPDIR)
ifeq ($(OS),Darwin)
INCLUDES += -F$(HOME)/Library/Frameworks
LDFLAGS += -bind_at_load
LIBS = -framework SDL -framework SDL_image -framework OpenGL -framework Cocoa
extra = .SDLMain.o
else
LIBS = -lSDL -lSDL_image -lSDL_ttf -lGL -lGLU -lcolyseus-wan -lpthread -lm -lz -lgmp
extra = 
endif

TOPDIR = ../..
TARGET = viz

all: $(TARGET)

$(TARGET): $(objs) $(extra) 
	$(CPP) $(CFLAGS) $(LDFLAGS) $(objs) $(extra) $(LIBS) -o $(TARGET)

# stupid Mac OS X SDL puts main function in this template
.SDLMain.o: SDLMain.m
	$(CC) -c $(CFLAGS) $(LDFLAGS) $< -o $@

DIST_FILES = *.cpp *.h *.jpg *.m

include ../../botrules.make
