# Makefile for building the shared library "libTerminal.so"
# for the Solaris operating system.
#
# NOTE: If you use the native "curses" library instead of the
# open-source "ncurses" library, you MUST change the 
# "include <ncurses.h>" in Toolkit.c to "include <curses.h>".
#
OS = solaris
LIBS = -lncurses
SHARED_OBJECT_EXT = so
TARGET = libTerminal.${SHARED_OBJECT_EXT}

CC = gcc
CFLAGS = -fpic -shared

# 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}
INCLUDES = -I /usr/include/ncurses -I${JAVA_HOME}/include -I${JAVA_HOME}/include/${OS} -I../include


all : ${TARGET}

${TARGET} : Toolkit.c ../include/charva_awt_Toolkit.h Makefile.${OS}.txt
	${CC} ${CFLAGS} ${INCLUDES} Toolkit.c ${LIBS} -o ../lib/${TARGET}

# Derek Wyatt <wyatt@syndesis.com> reports that you can use "cc"
# instead of "gcc" if you use the following rule (assuming you 
# made ncurses statically):
#
#${TARGET} : Toolkit.c charva_awt_Toolkit.h Makefile.${OS}
#	cc -c ${INCLUDES} Toolkit.c -o Toolkit.o -Bstatic -lncurses
#	cc -G -o libTerminal.so Toolkit.o -Bstatic -lncurses
           



