#
# Makefile for Danny's game
#

HEADERS		= headers.h constants.h prototypes.h globaldecs.h

C_SRCS		= drawing.c globaldefs.c gui.c sprites.c core.c\
		  utility.c

C_OBJS		= drawing.o globaldefs.o gui.o sprites.o core.o\
		  utility.o

OBJS		= ${C_OBJS}

EXE		= bse2

#
# You should not need to change anything below this line, except
# for maybe including warnings and such in your compile flags
#

#
# Relevant man pages:
#
# man gcc
#

GCC		= gcc

#GCC_FLAGS	= -c -g -ansi -W -Wall -D__EXTENSIONS__
#
# Compile time flags, used to turn on warnings and such
# 
GCC_FLAGS	= -c -g -Wall

#
# Linker flags, used for linking in other libraries
#
LD_FLAGS	= -g `allegro-config --libs`

#
# Standard rules
#

#
# For each .c file make sure there exists a .o file, if it doesn't
# build a new .o file from the .c file
#
.c.o:
	@echo "Compiling each C source file separately ..."
	$(GCC) $(GCC_FLAGS) $<
	@echo ""

#
# Simply have our project target be a single default $(EXE) executable.
#

$(EXE):	$(OBJS)
	@echo "Linking all object modules ..."
	$(GCC) -o $(EXE) $(LD_FLAGS) $(OBJS)
	@echo ""
	@echo "Done."

${C_OBJS}:      ${HEADERS}


clean:
	@echo "Cleaning up project directory ..."
	rm -f *.o $(EXE) *.ln core 
	@echo ""
	@echo "Clean."

new:
	make clean
	make

