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

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

CC           	= @CC@
CFLAGS  	= @CFLAGS@ @GCCFLAGS@
DEFINES      	= 
DEF_BLTINIT	= -DBLT_LIBRARY=\"$(BLT_LIBRARY)\"
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@
INCLUDES	= -I. $(TK_INCLUDE) $(TCL_INCLUDE) $(X_INCLUDE)

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

#N_OBJS		= bltTed.o
#N_SRCS		= bltTed.c

TK_3_OBJS	= bltBell.o bltCutbuffer.o
TK_3_SRCS	= bltBell.c bltCutbuffer.c

TK_4_OBJS	= bltTile.o tkButton.o tkFrame.o tkScrollbar.o
TK_4_SRCS	= bltTile.c tkButton.c tkFrame.c tkScrollbar.c

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)

SRCS 		= bltGraph.c bltGrAxis.c bltGrBar.c bltGrElem.c \
		  bltGrGrid.c bltGrHairs.c bltGrLegd.c bltGrLine.c \
		  bltGrMarker.c bltGrMisc.c bltGrPs.c \
        	  bltBgexec.c bltBitmap.c bltBusy.c \
		  bltDebug.c bltDragDrop.c bltHtext.c \
		  bltSpline.c bltTable.c bltVector.c bltWatch.c bltWin.c \
        	  bltInit.c bltInput.c bltList.c bltText.c bltUtil.c \
		  $(TK_@TK_MAJOR_VERSION@_SRCS) $(N_SRCS)

libname  	= libBLT.a
CC_SWITCHES	= $(CFLAGS) $(DEFINES) $(INCLUDES)
INSTALL  	= @INSTALL@
INSTALL_DATA  	= @INSTALL_DATA@
RANLIB   	= @RANLIB@
SHELL    	= /bin/sh
AR       	= ar rc
RM       	= rm -f
LINT		= lint
LINTFLAGS	= -axhbn
srcdir 		= @srcdir@
VPATH		= @srcdir@

all: $(libname)

$(libname):  $(OBJS)
	$(RM) $@
	$(AR) $@ $(OBJS)
	$(RANLIB) $@

install: $(libname) install-dirs
	$(INSTALL_DATA) $(libname) $(LIBDIR)
	$(RANLIB) $(LIBDIR)/$(libname)

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

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

lint:
	$(LINT) $(LINTFLAGS) $(DEFINES) $(INCLUDES) $(SRCS)

bltInit.o: bltInit.c
	$(CC) -c $(CC_SWITCHES) $(DEF_BLTINIT) $<

.c.o:
	$(CC) -c $(CC_SWITCHES) $<
