/* $Id: Imakefile,v 1.8.2.1 2003/10/12 11:58:17 aida_s Exp $ */
#include "../Canna.conf"
#ifdef TermcapLibrary
TERMCAP_LIB = TermcapLibrary
#else
# if SystemV || SystemV4
TERMCAP_LIB = -lcurses
# else
TERMCAP_LIB = -ltermcap
# endif
#endif
#ifndef CanuumConfigureEnv
# define CanuumConfigureEnv CPPFLAGS="$(ALLDEFINES)" CC='$(CC)' CFLAGS='$(PURE_CFLAGS)'
#endif
#ifndef CanuumConfigureArgs
# define CanuumConfigureArgs --with-term-libs="$(TERMCAP_LIB)"
#endif

    CANNAROOT = ..
INSTUGIDFLAGS = 
     CANNASRC = $(CANNAROOT)/lib/canna16
      DEFINES = -DCANNA -DJAPANESE $(SIGNAL_DEFINES) -DHAVE_CONFIG_H \
		-DCONFIG_TERMINFO -DUSE_LIBSPT
     INCLUDES = -I$(CANNAROOT)/include -I. `libspt-config --cflags`
SYS_LIBRARIES = $(TERMCAP_LIB) `libspt-config --libs`

         SRCS = header.c printf.c termio.c termcap.c \
		screen.c cursor.c jhlp.c xutoj.c canna.c
         OBJS = header.o printf.o termio.o termcap.o \
		screen.o cursor.o jhlp.o xutoj.o canna.o

            TARGET = canuum
XCOMM --prefix is not used but add just in case
CONFIGURE_CMD = CanuumConfigureEnv IN_MAKE=yes ./configure --prefix=$(cannaPrefix) CanuumConfigureArgs
PURE_CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) /* $(THREADS_CFLAGS) $(MODULE_CFLAGS) */

AllTarget($(TARGET))
NormalProgramTarget($(TARGET),$(OBJS),$(DEPCANNALIB16),$(CANNALIB16),)
InstallMultipleFlags($(TARGET),$(cannaBinDir),$(INSTUGIDFLAGS))
InstallManPage($(TARGET),$(cannaManDir))
DependTarget()
LintTarget()
distclean::
	$(RM) config.h config.cache config.status
includes:: config.h
XCOMM Invoke configure only when config.h does not exist for faster build
config.h:
	$(CONFIGURE_CMD)
XCOMM If you want to invoke configure explicitly, do "make config"
config::
	$(CONFIGURE_CMD)
reconfig::
	$(RM) config.cache
	$(CONFIGURE_CMD)
