# To use this, you must set three variables. GLKINCLUDEDIR must be the 
# directory containing glk.h, glkstart.h, and the Make.library file.
# GLKLIBDIR must be the directory containing the library.a file.
# And GLKMAKEFILE must be the name of the Make.library file. Two
# sets of values appear below; uncomment one of them and change the
# directories appropriately.

#GLKINCLUDEDIR = ../cheapglk
#GLKLIBDIR = ../cheapglk
#GLKMAKEFILE = Make.cheapglk

GLKINCLUDEDIR = ../glkterm
GLKLIBDIR = ../glkterm
GLKMAKEFILE = Make.glkterm

#GLKINCLUDEDIR = ../xglk
#GLKLIBDIR = ../xglk
#GLKMAKEFILE = Make.xglk

# Pick a C compiler.
#CC = cc
CC = gcc -ansi

# If you plan to install the game to a permanent location, modify the
# next line to a directory that suits you, and then copy the "dundat"
# file into that directory. Otherwise, the game will look for "dundat"
# in the current directory.
DATADIR = .

# To include the in-game debugger, uncomment the following line:
# GDT_FLAG = -DHAVE_GDT=1

OPTIONS = -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-unused

include $(GLKINCLUDEDIR)/$(GLKMAKEFILE)

CFLAGS = $(OPTIONS) -I$(GLKINCLUDEDIR)
LIBS = -L$(GLKLIBDIR) $(GLKLIB) $(LINKLIBS) 

OBJS = commons.o miscfort.o osdepend.o \
  dungeon.o game.o objects.o parser.o rooms.o subr.o timefnc.o verbs.o gdt.o

OBJS += glkstart.o

CFLAGS += -DPATH_DUNDAT=\"${DATADIR}/\" -DUSE_OS_RANDOM $(GDT_FLAG)

dungeon: $(OBJS)
	$(CC) $(CFLAGS) -o dungeon $(OBJS) $(LIBS)

clean:
	rm -f *~ *.o dungeon

all:	dungeon
