OBJECTS=application.o background.o board.o boardlines.o datafile.o \
duplexpipe.o gtp.o game.o options.o menu.o pixelformat.o point.o \
pushbutton.o rect.o sdlapplication.o sdlboard.o sdlgo.o \
sdlpushbutton.o screensurface.o stonedata.o stones.o surface.o \
vertex.o widget.o ttfont.o color.o

CC=g++
COMPILESWITCH=-Wall -g -c
LINKSWITCH=-o SDL_Go -lpthread -lSDL -lSDL_ttf -lttf

all: $(OBJECTS)
	$(CC) $(OBJECTS) $(LINKSWITCH)

application.o: application.cc application.h widget.h screensurface.h
	$(CC) $(COMPILESWITCH) application.cc

background.o: background.cc background.h rect.h color.h surface.h
	$(CC) $(COMPILESWITCH) background.cc

board.o: board.cc board.h vertex.h options.h
	$(CC) $(COMPILESWITCH) board.cc

boardlines.o: boardlines.cc boardlines.h vertex.h color.h point.h surface.h
	$(CC) $(COMPILESWITCH) boardlines.cc

color.o: color.cc color.h 
	$(CC) $(COMPILESWITCH) color.cc

datafile.o: datafile.cc datafile.h pixelformat.h vertex.h surface.h \
board.h color.h boardlines.h background.h menu.h stones.h game.h
	$(CC) $(COMPILESWITCH) datafile.cc

duplexpipe.o: duplexpipe.cc duplexpipe.h
	$(CC) $(COMPILESWITCH) duplexpipe.cc

gtp.o: gtp.cc gtp.h vertex.h duplexpipe.h board.h
	$(CC) $(COMPILESWITCH) gtp.cc

game.o: game.cc game.h vertex.h gtp.h board.h
	$(CC) $(COMPILESWITCH) game.cc

menu.o: menu.cc menu.h rect.h surface.h point.h
	$(CC) $(COMPILESWITCH) menu.cc

options.o: options.cc options.h
	$(CC) $(COMPILESWITCH) options.cc

pixelformat.o: pixelformat.cc pixelformat.h color.h
	$(CC) $(COMPILESWITCH) pixelformat.cc

point.o: point.cc point.h
	$(CC) $(COMPILESWITCH) point.cc

pushbutton.o: pushbutton.cc pushbutton.h widget.h
	$(CC) $(COMPILESWITCH) pushbutton.cc

rect.o: rect.cc rect.h point.h
	$(CC) $(COMPILESWITCH) rect.cc

sdlapplication.o: sdlapplication.cc sdlapplication.h application.h \
options.h datafile.h sdlpushbutton.h sdlboard.h game.h
	$(CC) $(COMPILESWITCH) sdlapplication.cc

sdlboard.o: sdlboard.cc sdlboard.h vertex.h point.h widget.h rect.h datafile.h
	$(CC) $(COMPILESWITCH) sdlboard.cc

sdlgo.o: sdlgo.cc sdlapplication.h
	$(CC) $(COMPILESWITCH) sdlgo.cc

sdlpushbutton.o: sdlpushbutton.cc sdlpushbutton.h pushbutton.h widget.h rect.h datafile.h
	$(CC) $(COMPILESWITCH) sdlpushbutton.cc

screensurface.o: screensurface.cc screensurface.h surface.h
	$(CC) $(COMPILESWITCH) screensurface.cc

stonedata.o: stonedata.cc stonedata.h rect.h point.h surface.h vertex.h
	$(CC) $(COMPILESWITCH) stonedata.cc

stones.o: stones.cc stones.h stonedata.h boardlines.h surface.h color.h point.h
	$(CC) $(COMPILESWITCH) stones.cc

surface.o: surface.cc surface.h color.h point.h rect.h pixelformat.h
	$(CC) $(COMPILESWITCH) surface.cc

ttfont.o: ttfont.cc ttfont.h surface.h color.h
	$(CC) $(COMPILESWITCH) ttfont.cc

vertex.o: vertex.cc vertex.h
	$(CC) $(COMPILESWITCH) vertex.cc

widget.o: widget.cc widget.h rect.h point.h
	$(CC) $(COMPILESWITCH) widget.cc



