/* $Id: Imakefile,v 1.8.2.4 2004/05/19 15:39:22 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 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 = IN_MAKE=yes $(CANNAROOT)/confwrapper run ./configure --prefix=$(cannaPrefix) CanuumConfigureArgs
PURE_CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) /* $(THREADS_CFLAGS) $(MODULE_CFLAGS) */

AllTarget(ProgramTargetName($(TARGET)))
NormalProgramTarget($(TARGET),$(OBJS),$(DEPCANNALIB16),$(CANNALIB16),)
InstallMultipleFlags($(TARGET),$(cannaBinDir),$(INSTUGIDFLAGS))
InstallManPage($(TARGET),$(cannaManDir))
DependTarget()
LintTarget()
distclean::
	$(RM) config.h config.cache config.status cwenv.sh
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 cwenv.sh
	$(CONFIGURE_CMD)
XCOMM Invoked from confwrapper
cwenv.sh:
	$(CANNAROOT)/confwrapper mkenv CPPFLAGS $(ALLDEFINES) > $@
	$(CANNAROOT)/confwrapper mkenv CC env $(CC) >> $@
	$(CANNAROOT)/confwrapper mkenv CFLAGS $(PURE_CFLAGS) >> $@
