# C options
CC = gcc
FLAGS = -c `sdl-config --cflags` -O2 -Wall -DSABLE_RESOURCEDIR=\"$(INSTALL_RESDIR)/sable/\" -Iinclude $(CFLAGS)

# C++ options.
CXX = g++
CXXFLAGS = $(FLAGS)

# Linker options.
LD = g++
LDFLAGS = 
LIBS = `sdl-config --libs` -lGL -lGLU -lSDL_image -lSDL_mixer

COBJS = vcontrol/vcontrol.o \
	bcplrandom.o \
	svaf/svaf_read.o svaf/svaf_amalgam.o svaf/svaf_render.o
CXXOBJS = entity.o entityfarm.o environment.o game.o \
       ground.o input.o menu.o obb.o sable.o textures.o \
       sound.o logo.o 
OBJS = $(COBJS) $(CXXOBJS)

sable: $(OBJS)
	$(LD) $(LDFLAGS) -o sable $(OBJS) $(LIBS)

clean:
	rm -f sable *.o vcontrol/*.o svaf/*.o

depend:
	find . -name \*.c\* | xargs makedepend -Y. -Iinclude >& /dev/null

$(COBJS): %.o: %.c
	$(CC) $(FLAGS) -o $@ $<

$(CXXOBJS): %.o: %.cpp
	$(CXX) $(CXXFLAGS) -o $@ $<
# DO NOT DELETE

./sable.o: include/sable.h include/textures.h include/entity.h include/svaf.h
./sable.o: include/obb.h include/environment.h include/input.h
./sable.o: include/sound.h
./input.o: include/input.h include/vcontrol.h
./ground.o: include/sable.h include/ground.h include/textures.h
./entity.o: include/sable.h include/entity.h include/svaf.h include/obb.h
./entity.o: include/input.h include/entityfarm.h include/sound.h
./bcplrandom.o: include/bcplrandom.h
./entity.o: include/sable.h include/entity.h include/svaf.h include/obb.h
./entity.o: include/input.h include/entityfarm.h include/sound.h
./logo.o: include/sable.h include/logo.h include/environment.h
./logo.o: include/textures.h include/input.h
./sound.o: include/sable.h include/sound.h
./sable.o: include/sable.h include/textures.h include/environment.h
./sable.o: include/input.h include/sound.h
./environment.o: include/sable.h include/environment.h include/logo.h
./environment.o: include/menu.h include/game.h include/entity.h
./environment.o: include/svaf.h include/obb.h include/entityfarm.h
./obb.o: include/sable.h include/obb.h
./textures.o: include/sable.h include/textures.h
./menu.o: include/sable.h include/menu.h include/environment.h
./menu.o: include/textures.h include/entity.h include/svaf.h include/obb.h
./menu.o: include/input.h include/sound.h
./game.o: include/sable.h include/sound.h include/environment.h
./game.o: include/game.h include/entity.h include/svaf.h include/obb.h
./game.o: include/entityfarm.h include/input.h include/textures.h
./game.o: include/ground.h
./entityfarm.o: include/entityfarm.h include/sable.h include/entity.h
./entityfarm.o: include/svaf.h include/obb.h
./menu.o: include/sable.h include/menu.h include/environment.h
./menu.o: include/textures.h include/input.h include/sound.h
./environment.o: include/sable.h include/environment.h include/logo.h
./environment.o: include/menu.h include/game.h include/entity.h
./environment.o: include/svaf.h include/obb.h include/entityfarm.h
./ground.o: include/sable.h include/ground.h include/textures.h
./game.o: include/sable.h include/sound.h include/environment.h
./game.o: include/game.h include/entity.h include/svaf.h include/obb.h
./game.o: include/entityfarm.h include/input.h include/textures.h
./game.o: include/ground.h
./vcontrol/vcontrol.o: include/vcontrol.h
./svaf/svaf_amalgam.o: include/svaf.h
./svaf/svaf_read.o: include/svaf.h
./svaf/svaf_render.o: include/svaf.h
./svaf/svaf_render.o: include/svaf.h
