# Makefile for XCurses-based SAA library
#
# The variable 'srcdir' refers to the source-distribution, and can be set with
# the configure script by "--srcdir=DIR".
#

SHELL		= /bin/sh
THIS		= Makefile

@SET_MAKE@

srcdir		= @srcdir@
saadir		= $(srcdir)/../saa

VPATH		= @srcdir@
prefix		= @prefix@
exec_prefix	= @exec_prefix@
libdir		= $(exec_prefix)
includedir	= @includedir@

PDCURSES_HOME		=$(srcdir)/..
PDCURSES_CONFIG_H		=../config.h
PDCURSES_CURSES_H		=$(PDCURSES_HOME)/curses.h
PDCURSES_HEADERS		=$(PDCURSES_CONFIG_H) $(PDCURSES_CURSES_H)
SAA_HEADERS		=$(saadir)/saa.h $(saadir)/txtwin.h $(saadir)/mouse.h

INSTALL		= @INSTALL@
INSTALL_DATA	= @INSTALL_DATA@

LN_S		= @LN_S@

CC		= @CC@
CFLAGS		= @CFLAGS@

INCDIR		= $(srcdir)
CPPFLAGS	= -I$(INCDIR) -I$(srcdir)/.. -I.. @DEFS@ -DXCURSES -DUSE_PDCURSES @SYS_DEFS@

CCFLAGS		= -c $(CFLAGS) $(CPPFLAGS) @MH_XINC_DIR@

LINK		= $(CC)
LDFLAGS		= 

RANLIB		= @RANLIB@

LIBRARIES	= libsaa.a

################################################################################
all :	$(LIBRARIES)

install : 
	echo Does nothing at the moment

clean :
	-rm -rf *.o trace $(LIBRARIES)

distclean: clean
	-rm -f Makefile

mostlyclean: clean

realclean: distclean

#------------------------------------------------------------------------

LIBOBJS =   \
saa.o       \
txtwin.o

libsaa.a : $(LIBOBJS)
	ar rv $@ $?
	$(RANLIB) $@

saa.o: $(srcdir)/saa.c $(saadir)/saa.h $(saadir)/txtwin.h $(saadir)/mouse.h
	$(CC) $(CCFLAGS) -o $@ $(srcdir)/saa.c

txtwin.o: $(srcdir)/txtwin.c $(saadir)/txtwin.h
	$(CC) $(CCFLAGS) -o $@ $(srcdir)/txtwin.c
