#
# Useful ./configure options with respect to this Makefile:
# --prefix
# --exec_prefix
# --bindir
# --datadir
# --mandir
# --with-ncurses
# --disable-mouse

prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
datadir = @datadir@/cblocks
mandir = @mandir@

CC = @CC@
CFLAGS =@CFLAGS@@MOUSEFLAGS@ '-DDATADIR="$(datadir)"'
LDFLAGS =@LDFLAGS@
LOADLIBES =@LOADLIBES@@MOUSELIBS@

OBJS = cblocks.o movelist.o parse.o fileread.o answers.o play.o dirio.o userio.o

cblocks: $(OBJS)

clean:
	rm -f $(OBJS) cblocks Makefile

install: cblocks
	install -d $(bindir)
	install -c ./cblocks $(bindir)/cblocks
	install -d $(mandir)/man6
	install -c ./cblocks.6 $(mandir)/man6/cblocks.6
	install -d -g games $(datadir)
	install -c ./series/* $(datadir)/

movelist.o: movelist.c gen.h movelist.h
dirio.o   : dirio.c gen.h dirio.h
userio.o  : userio.c gen.h cblocks.h userio.h
parse.o   : parse.c gen.h cblocks.h userio.h fileread.h movelist.h \
            parse.h
fileread.o: fileread.c gen.h cblocks.h movelist.h dirio.h userio.h \
            answers.h fileread.h parse.h
answers.o : answers.c gen.h cblocks.h dirio.h movelist.h fileread.h \
            play.h answers.h
play.o    : play.c gen.h cblocks.h userio.h play.h movelist.h fileread.h
cblocks.o : cblocks.c gen.h cblocks.h movelist.h dirio.h fileread.h \
            answers.h play.h userio.h
