neophyte: neophyte.o chess.o engine.o io.o
	gcc -Wall -o neophyte neophyte.o chess.o engine.o io.o -pthread

neophyte.o : neophyte.c chess.h io.h
	gcc -c -Wall neophyte.c

chess.o : chess.c chess.h
	gcc -c -Wall chess.c

engine.o : engine.c engine.h chess.h
	gcc -c -Wall engine.c

io.o: io.c io.h chess.h
	gcc -c -Wall io.c

neophyte.db: neophyte.do chess.do engine.do io.do
	gcc -Wall -o neophyte.db neophyte.do chess.do engine.do io.do -pthread

neophyte.do : neophyte.c chess.h io.h
	gcc -c -g -DDEBUG -Wall -o neophyte.do neophyte.c

chess.do : chess.c chess.h
	gcc -c -g -DDEBUG -Wall -o chess.do chess.c

engine.do : engine.c engine.h chess.h
	gcc -c -g -DDEBUG -Wall -o engine.do engine.c

io.do: io.c io.h chess.h
	gcc -c -g -DDEBUG -Wall -o io.do io.c

profile: profile.c chess.h engine.h
	gcc -pg -o profile profile.c engine.c chess.c

clean:
	rm -f *# *~ *.o *.do *.out neophyte neophyte.db neophyte.log profile