#
# Makefile for the ProTcl. It has been tried only on
# a Sun Sparc running SunOS 3.1 and only with SICStus 2.1 and ECLiPSe 3.4
#
# sccsid("@(#)makefile	1.4          93/12/16").
# sccscr("@(#)  Copyright 1993 ECRC GmbH ").
#
#
# Modify these values for your installation
#
# Adapted by Gertjan van Noord for HP-UX and Linux installation
# Only assumes SICStus now, for simplicity, and I don't want to
# suggest that it still works for quintus, eclipse.

# Note: tk.c has been patched to use tkSteal!!

# TCL_LIB points to directory which includes init.tcl
TCL_LIB=/users1/vannoord/lib/tcl

# TK_LIB points to directory which includes tk.tcl
TK_LIB=/users1/vannoord/lib/tk

X11=-L/usr/lib/X11R5
#X11=

# TCL and X include directory
# INCLUDES = -I/usr/include/tcl -I/usr/local/src/sicstus2.1
INCLUDES = -I/usr/include/X11R5 -I/users1/vannoord/include -I/usr/local/src/sicstus2.1

# Define GCC if you use gcc. gcc failed on the Tcl_Eval calls 
#     (with a `too many arguments' failure). Running gcc on HPUX
#     gives same error hence seems to be due to gcc and not linux.
#     I (Gertjan van Noord) have changed them a little...
# Define TK_TEST if you want to run all Tk test programs
# Define TKXACCESS if you want to use TkSteal's tkXAccess extensions
# also define TKSTEAL either to 1 or 0 (for communication to Prolog)
OPT	= -O -DTKXACCESS

TKSTEAL = 1

all: tk.o tk_common.ql dirs.ql

tk.o: tk.c dirs.pl
	cc $(OPT) -c $(INCLUDES) -DSICSTUS tk.c

dirs.pl :
	( echo "%% this file is generated by makefile";\
          echo "tcl_lib('$(TCL_LIB)'). ";\
	  echo ;\
          echo "tk_lib('$(TK_LIB)'). ";\
	  echo ;\
	  echo "x11_lib('$(X11)'). ";\
	  echo "tk_steal('$(TKSTEAL)'). ";\
	) > dirs.pl

# prolog used for making .ql files
PROLOG=/usr/local/bin/sicstus

PLFLAGS=compactcode

# loaded into module tk:
tk_common.ql: tk_common.pl
	-echo 'prolog_flag(compiling,_,$(PLFLAGS)), fcompile(tk:tk_common).' | $(PROLOG) -f

dirs.ql: dirs.pl
	-echo 'prolog_flag(compiling,_,$(PLFLAGS)), fcompile(tk:dirs).' | $(PROLOG) -f

clean:
	rm -f *.o *.ql dirs.pl *~ Makefile

