/* This is the file you should edit, before compiling.
 * You should not have to alter any other file. See
 * "INSTALL" for details on compiling
 *
 * The next few things are probably the only things you might
 * need to change.
 *
 * UNCOMPRESS: put your favourite  uncompress command in here.
 *   If you don't have gzip... get it!
 *   If you still won't.. well then you'll have to change the line
 *     to something that will uncompress the file to stdout
 *   You'll also have to change the UNCOMPRESSEXT to .Z, or whatever's
 *   appropriate to you.
 *
 * Note: If you don't choose to compress your dictionaries, for 
 * whatever reason.. that's okay.
 * If it doesn't have the UNCOMPRESSEXT extension, kdrill will assume
 * it is not compressed
 */

/* You might need the full pathname to gzip. If you dont have it at all,
 * just leave this be. Or substitute with 'compress'. But you should
 * really get gzip, as appropriate
 */
UNCOMPRESS = gzip -d -c
UNCOMPRESSEXT = .gz

/* UNCOMPRESS = compress -d -c
 * UNCOMPRESSEXT = .Z
 */

/* You can change these here, and KDrill.ad will 
 * get created with the matching values. Yaaay!
 */
DICTLOCATION= /usr/local/lib/kanjidic.gz
EDICTLOCATION= /usr/local/lib/edict.gz

# If for some reason, the user prefs stuff isn't working for you, 
# and you can't compile, uncomment this
# I THINK X11R5 and newer should always support this, though.
# XrmFileFlag=-DNOXRMSAVE


# Where to install? This is an example.
# The system should pick some default for you.
# If you dont like it, uncomment this and use it as you like.
# This isn't compiled in anywhere, it's just a convenience thing.
# BINDIR = /usr/local/bin/X11



/******************************************************************
 *   Okay, halt, whoa, cease, desist, go no further...            *
 ******************************************************************/

DEPLIBS = XawClientDepLibs
LOCAL_LIBRARIES = XawClientLibs

COMPRESSDEFS = -DUNCOMPRESS='"$(UNCOMPRESS)"' \
		-DUNCOMPRESSEXT='"$(UNCOMPRESSEXT)"'


DICTDEFS = -DDICTLOCATION='"KDrill*kdictfile:	 $(DICTLOCATION)"'
EDICTDEFS = -DEDICTLOCATION='"KDrill*edictfile:	 $(EDICTLOCATION)"'


/* 
 * I don't like putting <X11/...> for everything, so..
 */
INCLUDES = -I$(INCROOT)/X11

/*
 *  If you need to debug things, use this
 * CDEBUGFLAGS = -g
 */

EXTRA_DEFINES = $(XrmFileFlag)


SRCS = main.c options.c readfile.c game.c init.c widgets.c grades.c \
	frequency.c mainwindow.c search.c log.c utils.c kanasearch.c \
	convert.c multikanji.c kanjisearch.c strokesearch.c \
	searchwidgets.c prefs.c badguess.c skipsearch.c
OBJS = main.o options.o readfile.o game.o init.o widgets.o grades.o \
	frequency.o mainwindow.o search.o log.o utils.o kanasearch.o \
	convert.o multikanji.o kanjisearch.o strokesearch.o \
	searchwidgets.o prefs.o badguess.o skipsearch.o

ComplexProgramTarget(kdrill)

InstallProgram(kdrill, INSTALL_DIR)

SpecialObjectRule(utils.o,utils.c, $(COMPRESSDEFS) )
SpecialObjectRule(init.o,init.c, $(DICTDEFS) $(EDICTDEFS) )
InstallAppDefaults(KDrill)

AllTarget(KDrill.ad)

KDrill.ad:	KDrill.ad-dist Imakefile Makefile
	sed -e "s:EDICTLOCATION:$(EDICTLOCATION):" -e "s:KDICTLOCATION:$(DICTLOCATION):" < KDrill.ad-dist > $@
