#
#	Makefile	- makes the Mini SQL tcl code
#
# Copyright (c) 1994   Brad Pepers
#
# Permission to use, copy, and distribute for non-commercial purposes,
# is hereby granted without fee, providing that the above copyright
# notice appear in all copies and that both the copyright notice and this
# permission notice appear in supporting documentation.
#
# This software is provided "as is" without any expressed or implied
# warranty.
#
# $Id: Makefile,v 1.2 1998/09/18 18:46:48 abbottd Exp $
#
# $Log: Makefile,v $
# Revision 1.2  1998/09/18 18:46:48  abbottd
# Fixed make for vxWorks (sperate install from compile)
#
# Revision 1.1.1.1  1996/09/05 14:29:49  heyes
# Initial Import
#
# Revision 1.7  1994/08/25  00:28:05  pepers
# Changed for mSQL version 0.2
#
# Revision 1.6  1994/07/28  23:20:02  pepers
# Removed tclMain and tkMain
#
# Revision 1.5  1994/07/28  23:17:29  pepers
# Added paths for home and work
#
# Revision 1.4  1994/07/28  22:44:47  pepers
# Changed around how commands work
#
# Revision 1.3  1994/07/28  02:08:19  pepers
# Added clean, realclean, and tar
#
# Revision 1.2  1994/07/27  22:43:22  pepers
# Fixed log files
#
# Revision 1.1  1994/07/27  22:41:21  pepers
# First version of mSQL to Tcl/Tk interface
#


TCL_INC=${CODA}/common/include
TCL_LIB=${CODA}/VXWORKS68K51/lib
TCL_BIN=${CODA}/VXWORKS68K51/bin
VX_INC=${WIND_BASE}/target/h


CC=cc68k
AR=ar68k
RANLIB=ranlib68k
CFLAGS=-I$(TCL_INC) -I$(VX_INC) -L$(TCL_LIB) -msoft-float -DCPU=MC68040 -DVXWORKS -DVXWORKS68K51

TCL_LIBS=-ltcl7.4
MSQL_LIBS=-lmsql -lnsl -lsocket -lm

all : libSQL.a

install :
	cp tclSQL.h ${TCL_INC}
	cp libSQL.a ${TCL_LIB}
	cp tclSQL.o ${TCL_BIN}/tclSQL.o
	$(RANLIB) ${TCL_LIB}/libSQL.a

libSQL.a: tclSQL.o
	rm -f libSQL.a
	$(AR) cr libSQL.a tclSQL.o
	$(RANLIB) libSQL.a

test : tclmsql${CODA_LIB}/libmsql.a

tclmsql : tclAppInit.o tclSQL.o
	$(CC) $(CFLAGS) -o tclmsql tclAppInit.o tclSQL.o \
		$(TCL_LIBS) $(MSQL_LIBS)

tclAppInit.o : tclAppInit.c

tclSQL.o : tclSQL.c tclSQL.h
	$(CC) $(CFLAGS) -c tclSQL.c

clean:
	rm *.o

realclean:
	rm *.o *~ tcl_msql.tar tclmsql msqlwish

tar:
	tar cf tcl_msql.tar README Makefile tclSQL.c tclSQL.h \
		tclAppInit.c tkAppInit.c test.tcl test.tk
