### makefile --- makefile for my Allegro SpeedHack 1999 entry
##
## This file is gift-ware.  This file is given to you freely
## as a gift.  You may use, modify, redistribute, and generally hack
## it about in any way you like, and you do not have to give anyone
## anything in return.
##
## I do not accept any responsibility for any effects, adverse or
## otherwise, that this code may have on just about anything that
## you can think of.  Use it at your own risk.
##
## Copyright (C) 1999  Michael Bukin

CC = gcc
CFLAGS = -O2 -g -Wall
DEFS = 
INCLUDES = 
LDFLAGS = 
LIBS = 

INSTALL_DATA = install -m 0644
INSTALL_PROGRAM = install -m 0755
MAKEINFO = makeinfo --no-split
RM = rm -f

ifdef DJDIR
prefix = $(DJDIR)
else
prefix = /usr/local
endif
bindir = $(prefix)/bin
libdir = $(prefix)/lib
infodir = $(prefix)/info
includedir = $(prefix)/include

COMPILE = $(CC) $(INCLUDES) $(CFLAGS) $(DEFS)
#$(COMPILE) -c $<
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
#$(LINK) $(objs) $(libs)

game_objs = data.o game.o level.o main.o menu.o options.o

targets = game.exe
info_targets = 

.PHONY: all
all: $(targets)

.PHONY: info
info: $(info_targets)

.PHONY: install
install: $(targets)

.PHONY: install-info
install-info: $(info_targets)

game.exe: $(game_objs)
	$(LINK) $(game_objs) -lalleg $(LIBS) -lm

%.o: %.c
	$(COMPILE) -c $<

.PHONY: clean
clean:
	-$(RM) *.o

.PHONY: realclean
realclean: clean
	-$(RM) $(targets)
	-$(RM) $(info_targets)

data.o: data.c data.h
game.o: game.c data.h game.h level.h
level.o: level.c data.h level.h
main.o: main.c data.h menu.h options.h
menu.o: menu.c game.h menu.h
options.o: options.c options.h

### makefile ends here
