# ------------------------------------------------------------------------
# 	Makefile for shared version of BLT library
# ------------------------------------------------------------------------

LIBROOT		= BLT
LIBBLT         = lib$(LIBROOT)$(SHLIB_SUFFIX)

# ------------------------------------------------------------------------
# 	C Compiler options 
# ------------------------------------------------------------------------

CC 		= @CC@
CFLAGS 		= @CFLAGS@ @GCCFLAGS@
DEFINES 	= 
DEF_BLTINIT	= -DBLT_LIBRARY=\"$(BLT_LIBRARY)\"
SHLIB_CCFLAGS 	= @SHLIB_CCFLAGS@
SHLIB_LDFLAGS 	= @SHLIB_LDFLAGS@
SHLIB_LD 	= @SHLIB_LOADER@
SHLIB_SUFFIX 	= @SHLIB_SUFFIX@
TOPDIR 		= @DESTDIR@
LIBDIR 		= @LIBDIR@
BLT_LIBRARY 	= @BLT_LIBRARY@

# ------------------------------------------------------------------------
# 	Directories containing Tcl and Tk include files and libraries
# ------------------------------------------------------------------------

TCL_INCLUDE 	= @TCLINCSW@
TK_INCLUDE 	= @TKINCSW@
X_INCLUDE 	= @XINCSW@

# ------------------------------------------------------------------------
# 	Don't edit anything beyond this point
# ------------------------------------------------------------------------

TK_3_OBJS	= bltBell.o bltCutbuffer.o
TK_4_OBJS	= bltTile.o tkButton.o tkFrame.o tkScrollbar.o

#N_OBJS		= bltTed.o

OBJS 		= bltGraph.o bltGrAxis.o bltGrBar.o bltGrElem.o \
		  bltGrGrid.o bltGrHairs.o bltGrLegd.o bltGrLine.o \
		  bltGrMarker.o  bltGrMisc.o bltGrPs.o \
        	  bltBgexec.o bltBitmap.o bltBusy.o \
		  bltDebug.o bltDragDrop.o bltHtext.o bltSpline.o \
		  bltTable.o bltVector.o bltWatch.o bltWinOp.o \
        	  bltInit.o bltInput.o bltList.o bltText.o bltUtil.o \
		  $(TK_@TK_MAJOR_VERSION@_OBJS) $(N_OBJS)

INCLUDES 	= -I$(srcdir) $(TK_INCLUDE) $(TCL_INCLUDE) $(X_INCLUDE)
CC_SWITCHES	= $(SHLIB_CCFLAGS) $(CFLAGS) $(DEFINES) $(INCLUDES)
INSTALL 	= @INSTALL@
INSTALL_DATA 	= @INSTALL_DATA@
SHELL 		= /bin/sh
RM 		= rm -f
srcdir 		= @srcdir@/..

all: $(LIBBLT) 

$(LIBBLT):  $(OBJS)
	$(RM) $@
	$(SHLIB_LD) $(SHLIB_LDFLAGS) -o $@ $(OBJS)

install: install-dirs
	-if test -f $(LIBBLT) ; then \
	    $(INSTALL_DATA) $(LIBBLT) $(LIBDIR) ; \
	fi

install-dirs:
	@for i in $(TOPDIR) $(LIBDIR) ; do \
	    if test ! -d $$i ; then \
		mkdir $$i ; \
	    fi ; \
	done

clean:
	$(RM) $(OBJS) lib$(LIBROOT)* *.bak *\~ "#"*  *pure* .pure*

# ------------------------------------------------------------------------
# 	in lieu of viewpath-ing...
#
bltGraph.o:	$(srcdir)/bltGraph.c
	$(CC) -c $(CC_SWITCHES) $?
bltGrAxis.o:	$(srcdir)/bltGrAxis.c
	$(CC) -c $(CC_SWITCHES) $?
bltGrBar.o:	$(srcdir)/bltGrBar.c
	$(CC) -c $(CC_SWITCHES) $?
bltGrElem.o:	$(srcdir)/bltGrElem.c
	$(CC) -c $(CC_SWITCHES) $?
bltGrGrid.o:	$(srcdir)/bltGrGrid.c
	$(CC) -c $(CC_SWITCHES) $?
bltGrHairs.o:	$(srcdir)/bltGrHairs.c
	$(CC) -c $(CC_SWITCHES) $?
bltGrLegd.o: 	$(srcdir)/bltGrLegd.c
	$(CC) -c $(CC_SWITCHES) $?
bltGrLine.o:	$(srcdir)/bltGrLine.c
	$(CC) -c $(CC_SWITCHES) $?
bltGrMisc.o: 	$(srcdir)/bltGrMisc.c
	$(CC) -c $(CC_SWITCHES) $?
bltGrPs.o: 	$(srcdir)/bltGrPs.c
	$(CC) -c $(CC_SWITCHES) $?
bltGrMarker.o: 	$(srcdir)/bltGrMarker.c
	$(CC) -c $(CC_SWITCHES) $?
bltBgexec.o: 	$(srcdir)/bltBgexec.c
	$(CC) -c $(CC_SWITCHES) $?
bltBitmap.o: 	$(srcdir)/bltBitmap.c
	$(CC) -c $(CC_SWITCHES) $?
bltBusy.o: 	$(srcdir)/bltBusy.c
	$(CC) -c $(CC_SWITCHES) $?
bltDebug.o: $(srcdir)/bltDebug.c
	$(CC) -c $(CC_SWITCHES) $?
bltDragDrop.o: $(srcdir)/bltDragDrop.c
	$(CC) -c $(CC_SWITCHES) $?
bltHtext.o: 	$(srcdir)/bltHtext.c
	$(CC) -c $(CC_SWITCHES) $?
bltSpline.o: 	$(srcdir)/bltSpline.c
	$(CC) -c $(CC_SWITCHES) $?
bltTable.o: 	$(srcdir)/bltTable.c
	$(CC) -c $(CC_SWITCHES) $?
bltTed.o: 	$(srcdir)/bltTed.c
	$(CC) -c $(CC_SWITCHES) $?
bltVector.o: 	$(srcdir)/bltVector.c
	$(CC) -c $(CC_SWITCHES) $?
bltWatch.o: $(srcdir)/bltWatch.c
	$(CC) -c $(CC_SWITCHES) $?
bltWinOp.o:       $(srcdir)/bltWinOp.c
	$(CC) -c $(CC_SWITCHES) $?
bltBell.o: 	$(srcdir)/bltBell.c 
	$(CC) -c $(CC_SWITCHES) $?
bltCutbuffer.o: $(srcdir)/bltCutbuffer.c
	$(CC) -c $(CC_SWITCHES) $?
bltInit.o: 	$(srcdir)/bltInit.c       
	$(CC) -c $(CC_SWITCHES) $(DEF_BLTINIT) $?
bltInput.o: 	$(srcdir)/bltInput.c       
	$(CC) -c $(CC_SWITCHES) $?
bltList.o: 	$(srcdir)/bltList.c
	$(CC) -c $(CC_SWITCHES) $?
bltText.o: 	$(srcdir)/bltText.c
	$(CC) -c $(CC_SWITCHES) $?
bltTile.o: 	$(srcdir)/bltTile.c
	$(CC) -c $(CC_SWITCHES) $?
bltUtil.o: 	$(srcdir)/bltUtil.c
	$(CC) -c $(CC_SWITCHES) $?
tkButton.o: 	$(srcdir)/tkButton.c
	$(CC) -c $(CC_SWITCHES) $?
tkFrame.o: 	$(srcdir)/tkFrame.c
	$(CC) -c $(CC_SWITCHES) $?
tkScrollbar.o: 	$(srcdir)/tkScrollbar.c
	$(CC) -c $(CC_SWITCHES) $?


