# Copyright (c) 1998 Zveno Pty Ltd
# http://www.zveno.com/

# tcl/Makefile --
#
# Builds the Tcl interface to expat

#CFLAGS=-g
CFLAGS=
#SHLIB_EXT=.so
SHLIB_EXT=.sl
LIB=tclexpat$(SHLIB_EXT)
TCL_OBJS=tclexpat.o

# These settings are from Tcl's lib/tclConfig.sh file.
# NB. Should use autoconf to build this file from the above script.

TCL_CC=gcc
# Solaris 2.5.1
#TCL_DEFS= -DTCL_THREADS=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_UNISTD_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TZNAME=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -Dstrtod=fixstrtod -DSTDC_HEADERS=1 -DNO_UNION_WAIT=1 -DNEED_MATHERR=1 -Dvfork=fork -DHAVE_SIGNED_CHAR=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 
# HPUX 10.10
TCL_DEFS= -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DNO_DLFCN_H=1 -DHAVE_UNISTD_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TZNAME=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DNO_UNION_WAIT=1 -DNEED_MATHERR=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_SYS_IOCTL_H=1 
#TCL_PREFIX=/usr/local/tcl8.0
#TCL_PREFIX=/usr/local/tcl8.1
TCL_PREFIX=/usr/local/tcltk/8.1a2
TCL_SHLIB_CFLAGS=-fPIC
# Solaris 2.5.1
#TCL_SHLIB_LD=/usr/ccs/bin/ld -G -z text
# HPUX 10.10
TCL_SHLIB_LD=ld -b

# These settings are from expat's own Makefile

# Use one of the next two lines; unixfilemap is better if it works.
FILEMAP_OBJ=../xmlwf/unixfilemap.o
#FILEMAP_OBJ=../xmlwf/readfilemap.o
OBJS=../xmltok/xmltok.o \
  ../xmltok/xmlrole.o \
  ../xmlwf/xmlwf.o \
  ../xmlwf/codepage.o \
  ../xmlparse/xmlparse.o \
  ../xmlparse/hashtable.o \
  $(FILEMAP_OBJ)

all:		$(LIB)

tclexpat.o:	tclexpat.c
	$(TCL_CC) $(CFLAGS) -c $(TCL_DEFS) $(TCL_SHLIB_CFLAGS) -I$(TCL_PREFIX)/include -I../xmlparse tclexpat.c

$(LIB):		tclexpat.o
	$(TCL_SHLIB_LD) -o $(LIB) $(OBJS) tclexpat.o

clean:
	rm -f *~ *.o *$(SHLIB_EXT)

