CC=g++

all: main

# hackery to make this makefile work on mac os x. this would be a bit
# easier if the project was setup in a less linux-centric manner
FRAMEWORK =
LINFLAGS =
ifeq ($(shell uname -s), Darwin)
       FRAMEWORK += -framework OpenGL -framework GLUT
       LINFLAGS += -lobjc
else
       LINFLAGS += -lGL -lglut -lGLU -lICE -lSM
endif


CFLAGS = -O2 -Wall
 
SRCS = infovis.cpp support.cpp
OBJS = $(SRCS:%.cpp=%.o) 

main: $(OBJS)
	$(CC) $(FRAMEWORK) $(CFLAGS) $(OBJS) $(LINFLAGS) -o infovis

%.o:	%.cpp
	$(CC) -c $(CFLAGS) $<

clean:
	rm -f *.o core
	rm -f infovis

