# Makefile for Dungeon Bash
#
# Linux/gcc only; I'm writing this in riceboy-hacker mode.  Deal.

OBJS=combat.o display.o main.o map.o monsters.o objects.o permobj.o permons.o rng.o u.o

GAME=dungeonbash
# MPR: per <lj user="ewx">, users are advised to remove -Werror when
# building on Darwin due to a bug in Darwin's version of "ncurses.h".
#
# It is apparently possible to build this code for Windows XP, although I have
# no details.
MAJVERS=1
MINVERS=2
CFLAGS=-c -g -Wall -Wstrict-prototypes -Wwrite-strings -Wmissing-prototypes -Werror -DMAJVERS=$(MAJVERS) -DMINVERS=$(MINVERS)
LINKFLAGS=-lpanel -lncurses -g

all: $(GAME)

$(GAME): $(OBJS)
	$(CC) $(OBJS) $(LINKFLAGS) -o $(GAME)

archive: clean
	(cd .. && tar cvzf dungeonbash-$(MAJVERS).$(MINVERS).tar.gz dungeonbash-$(MAJVERS).$(MINVERS))

clean:
	-rm -f *.o $(GAME)

display.o: display.c dunbash.h

main.o: main.c dunbash.h

combat.o: combat.c dunbash.h

u.o: u.c dunbash.h

permobj.o: permobj.c dunbash.h

map.o: map.c dunbash.h

permons.o: permons.c dunbash.h

objects.o: objects.c dunbash.h

monsters.o: monsters.c dunbash.h
