# Makefile
SHELL = /bin/sh
SRCS = area.c doevent.c err.c hb.c wind.c game.c
OBJS = area.o doevent.o err.o hb.o wind.o game.o
INCLUDES = area.h err.h wind.h game.h

CC = gcc
LEX = flex
YACC = bison -d 

CFLAGS = -g $(INCLUDE) $(DEFINE) -Wall

DEFINE =
INCLUDE =
CPP = $(CC) -E $(INCLUDE) $(DEFINE)
LFLAGS =
LIBS = -lX11

all: hexbombs

hexbombs: $(OBJS)
	$(CC) -g $(LFLAGS) -o hexbombs $(OBJS) $(LIBS)

clean:
	rm -f \#* *.o core Makefile.bak tmp_make *~
	-ln -s /tmp/core ./core

dep:
	cp Makefile Makefile.bak
	sed '/\#\#\# Dependencies/q' < Makefile > tmp_make
	(for i in *.c; do $(CPP) -MM $$i; done) >> tmp_make
	cp tmp_make Makefile

### Dependencies
area.o : area.c err.h hb.h wind.h area.h 
doevent.o : doevent.c hb.h err.h 
err.o : err.c err.h 
game.o : game.c hb.h 
hb.o : hb.c err.h hb.h wind.h game.h 
wind.o : wind.c err.h hb.h wind.h area.h 
