#
#	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.3 2003/12/24 15:38:08 abbottd Exp $
#
# $Log: Makefile,v $
# Revision 1.3  2003/12/24 15:38:08  abbottd
#    Makefile for new vxWorks compiler
#
# Revision 1.2  1998/09/18 18:38:40  abbottd
# Fix vxWorks make for tcl_msql library
#
# 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}/VXWORKSPPC/lib
TCL_BIN=${CODA}/VXWORKSPPC/bin
VX_INC=$(WIND_BASE)/target/h

CC=ccppc
AR=arppc
RANLIB=ranlibppc
CFLAGS=-I$(TCL_INC) -I$(VX_INC) -L$(TCL_LIB) -O -mcpu=604 -DCPU=PPC604 -fno-builtin -fno-for-scope -mlongcall -D_GNU_TOOL -DVXWORKS -DVXWORKSPPC

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


all : libSQL.a

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

install :
	cp tclSQL.h ${TCL_INC}/
	cp libSQL.a ${TCL_LIB}/
	cp tclSQL.o ${TCL_BIN}/
	$(RANLIB) ${TCL_LIB}/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
