#=========================================================================
# Makefile for compilation of Windows 95/98/2000 version of Terminal
# shared library (DLL), using:
#
#   PDCurses 2.6
#   ( http://sourceforge.net/projects/pdcurses/ )
#
#   MinGW32 version 2.0.0. with all recommended updates (according to 
#   ${MINGW_HOME}/include/_mingw.h, the MinGW version is 2.3).
#   ( http://sourceforge.net/projects/mingw/ )
#
#   MSYS version 1.0.8
#   ( http://www.mingw.org/msys.shtml )
#
#=========================================================================
# I have tested this on Windows 98 Second Edition and on
# Windows 2000.
#
# After you have installed MinGW and PDCurses, copy the PDCurses library
# file (pdcurses.a) to the current directory (${CHARVA_HOME}/c/src) and
# edit the value of PDCURSES_HOME and JAVA_HOME (below).

OS = win32

# The file "jni.h" is in ${JAVA_HOME}/include
# The file "jni_md.h" (included from jni.h) contains machine-dependent 
# type definitions and is in ${JAVA_HOME}/include/${OS}
JAVA_HOME=/e/j2sdk1.4.2

# The file "curses.h" is in ${PDCURSES_HOME}; set this to the directory
# where you installed PDCurses.
PDCURSES_HOME=/c/pdcurses

SHARED_OBJECT_EXT = dll
TARGET = ../lib/Terminal.${SHARED_OBJECT_EXT}
DEPENDS = Toolkit.c ../include/charva_awt_Toolkit.h Makefile.win32.txt

CC = gcc
CFLAGS = -o0 -g -D_PDCURSES_ -c

INCLUDES = -I${JAVA_HOME}/include -I${PDCURSES_HOME} -I${JAVA_HOME}/include/${OS} -I../include

LIBS = ${PDCURSES_HOME}/obj/pdcurses.a


all : ${TARGET}


${TARGET} : ${DEPENDS}
	${CC} ${CFLAGS} ${INCLUDES} Toolkit.c -o ../lib/Toolkit.o
	dllwrap --add-stdcall-alias -o ${TARGET} -s ../lib/Toolkit.o ${LIBS}
