#
# This Makefile is for use when distributing Tcl to the outside world.
# It is simplified so that it doesn't include any Sprite-specific stuff.
#
SHELL=/bin/sh

#
#System V
#
#LIBS =
#RANLIB=:
#VOID= -DVOID=void
#MODEL=
#G=-g

#
#System III Xenix
#
LIBS = -lx
RANLIB= ranlib
VOID= -DVOID=int
MODEL= -Ml
G=

#
#BSD
#
#LIBS =
#RANLIB= ranlib
#VOID= -DVOID=void
#MODEL=
#G=-g

#
#HPUX
#
#LIBS = -lBSD
#RANLIB= ranlib
#VOID= -DVOID=void
#MODEL=
#G=-g

CFLAGS = -I. -DTCL_VERSION=\"2.1\" ${VOID} ${MODEL} ${G}

GLOB=
# GLOB=glob.o tclGlob.o

OBJS = ${GLOB} tclBasic.o tclCmdAH.o tclCmdIZ.o tclExpr.o \
	tclProc.o tclUtil.o

LIBOBJS = panic.o strerror.o strtol.o strtoul.o l_init.o \
	l_insert.o l_l_insert.o l_remove.o ckalloc.o argv.o \
	stream.o

HDRS=list.h sprite.h stdlib.h string.h tcl.h tclInt.h ckalloc.h
CSRCS = glob.c tclBasic.c tclCmdAH.c tclCmdIZ.c tclExpr.c \
	tclGlob.c tclProc.c tclUtil.c
LIBSRCS= ${LIBOBJS:.o=.c}

tcl.a: ${OBJS} ${LIBOBJS}
	rm -f tcl.a
	ar cr tcl.a ${OBJS} ${LIBOBJS}
	${RANLIB} tcl.a

tclTest: tclTest.o tcl.a
	cc ${CFLAGS} tclTest.o tcl.a ${LIBS} -o tclTest

clean:
	rm -f ${OBJS} ${LIBOBJS} tcl.a tclTest.o tclTest
	rm -f Part?? MANIFEST~

ALLFILES= Makefile README stream.5 tclTest.c $(HDRS) $(CSRCS) $(LIBSRCS)

tcl.shar: $(ALLFILES)
	shar $(ALLFILES) > tcl.shar

MANIFEST: $(ALLFILES)
	sh -c 'if [ -r MANIFEST ] ;\
		then makekit -m ;\
		else makekit -oMANIFEST $(ALLFILES) ;\
	fi'
