BIN_PATH=@prefix@/bin
SHARE_PATH=@prefix@/share/fookb
MAN_PATH=@prefix@/man/man1

srcdir = ..
# FLAGS=-Wall -g -DDEBUG @DEFS@
FLAGS=-Wall @DEFS@

GCC=@CC@

INCLUDEDIR=@X_CFLAGS@
LIBDIR=@X_LIBS@
PRELIBS=@X_PRE_LIBS@
EXTRALIBS=@X_EXTRA_LIBS@

LIBS=@LIBS@

# DEBUG
# DLIBS=-lefence
DLIBS=

fookb: fookb.o params.o images.o sound.o opts.o globals.o
	${GCC} ${PRELIBS} ${LIBDIR} ${EXTRALIBS} ${DLIBS} ${LIBS} -o fookb fookb.o params.o images.o sound.o opts.o globals.o @WUTIL_LIB@

fookb.o: $(srcdir)/fookb.c $(srcdir)/fookb.h $(srcdir)/params.h
	${GCC} -c ${FLAGS} ${INCLUDEDIR} -I$(srcdir) $(srcdir)/fookb.c

params.o: $(srcdir)/params.c $(srcdir)/params.h
	${GCC} -c ${FLAGS} ${INCLUDEDIR} -I$(srcdir) $(srcdir)/params.c

images.o: $(srcdir)/images.c $(srcdir)/images.h
	${GCC} -c ${FLAGS} ${INCLUDEDIR} -I$(srcdir) $(srcdir)/images.c

sound.o: $(srcdir)/sound.h $(srcdir)/sound.c $(srcdir)/params.h
	${GCC} -c ${FLAGS} ${INCLUDEDIR} -I$(srcdir) $(srcdir)/sound.c

opts.o: $(srcdir)/opts.h $(srcdir)/fookb.h $(srcdir)/opts.c
	${GCC} -c ${FLAGS} ${INCLUDEDIR} -I$(srcdir) $(srcdir)/opts.c

globals.o: $(srcdir)/globals.c
	${GCC} -c ${FLAGS} ${INCLUDEDIR} -I$(srcdir) $(srcdir)/globals.c

clean:
	rm -f fookb fookb.o params.o images.o sound.o opts.o globals.o

superclean: clean
	rm -f Makefile config.*

superpuperclean: superclean
	rm -f configure

install: fookb
	#mkdir -p ${BIN_PATH}
	#mkdir -p ${DESTDIR}${SHARE_PATH}
	#mkdir -p ${MAN_PATH}
	#cp fookb ${BIN_PATH}
	cp $(srcdir)/1.xpm ${DESTDIR}${SHARE_PATH}
	cp $(srcdir)/2.xpm ${DESTDIR}${SHARE_PATH}
	cp $(srcdir)/3.xpm ${DESTDIR}${SHARE_PATH}
	cp $(srcdir)/4.xpm ${DESTDIR}${SHARE_PATH}
	cp $(srcdir)/rus.xpm ${DESTDIR}${SHARE_PATH}
	cp $(srcdir)/lat.xpm ${DESTDIR}${SHARE_PATH}
	cp $(srcdir)/boom.xpm ${DESTDIR}${SHARE_PATH}
	cp $(srcdir)/beep_spring.au ${DESTDIR}${SHARE_PATH}
	#cp fookb.1x ${MAN_PATH}
