################################################
# Makefile for saptcl and wishsap
#
# This make file is used to create tcl and tk extended
# to work with parts of the SAP RFC library.
#
# You will need to fix these up to match your system
# Certainly the location of the X11 and SAP libraries will be 
# different !
# 
# AUTHOR: 
#      Garth Kennedy (garth@comm.mot.com or garth@mcs.net) 
#      Land Mobile Products  Motorola Inc.  
#      Schaumburg, Ill. 
#
# COPYRIGHT NOTICE: 
#      Copyright 1995   Motorola Inc.; 
#      Permission to use, copy modify and distribute without charge 
#      this software, documentation etc. is granted, provided that 
#      this comment and the author's name is retained. Neither the 
#      author or Motorola assume any responsibility for problems 
#     resulting from the use of this software. 
# 
# Garth Kennedy     15 August 1995
###################################################

# TCL_LIB points to the tcl library (or substitute) used 
TCL_LIB = /usr/local/lib/libtcl7.4.a

# TK_LIB points to the TK library (or substitute) used
TK_LIB = /usr/local/lib/libtk4.0.a

# INCS points to non-standard Include directories 
# This needs to pick up X and tcl header files 
# SAP headers are defined in SAP_INC
INCS = /usr/local/include -I/usr/contrib/mitX11R5/include 

# X_LIB points to the X11 library directory
X_LIB= /usr/contrib/mitX11R5/lib

# SAP_INC points to the directory in which the saprfc.h file may be found
SAP_INC = /disc5/user1/sap/rfcsdk/include 

# SAP_LIB points to the directory in which the librfc.a library is located
SAP_LIB = /disc5/user1/sap/rfcsdk/lib

# INSTALL_BIN_DIR is the directory in which the binaries are to be installed
INSTALL_BIN_DIR = /usr/local/bin

# CFLAGs in the CC definition.
#CFLAGS = -g $(INCS)
CFLAGS= -O -Aa

# on HPs, the -Aa forces ANSI C.
#CC = gcc 
CC= cc -O -Aa -I$(INCS) -I$(SAP_INC) -D _INCLUDE_POSIX_SOURCE

#############################################
#  You Should not need to make any changes below this line 
###############################################
# SAP Interface files
#      Sap_CallRX.c Sap_Ckerr.c Sap_Open.c Sap_RFCPing.c Sap_Systeminfo.c
# TCL Files
#      tclMain.c tclInvoke.c
# TK Files
#     tkcustomMain.c



TCL_OBJS = tclMain.o tclInvoke.o Sap_CallRX.o Sap_Ckerr.o \
           Sap_Open.o Sap_RFCPing.o Sap_Systeminfo.o Sap_Help.o


TK_OBJS = tkCustomMain.o Sap_CallRX.o Sap_Ckerr.o Sap_Open.o \
           Sap_RFCPing.o Sap_Systeminfo.o Sap_Help.o

TCLSAP_BIN = tclsap
TKSAP_BIN = wishsap

all: tclsap wishsap

tclsap: $(TCL_OBJS)
	$(CC) -o tclsap $(TCL_OBJS) -L $(SAP_LIB) -lrfc $(TCL_LIB) -lm

wishsap: $(TK_OBJS)
	$(CC) -o wishsap $(TK_OBJS) -L $(SAP_LIB) -L $(X_LIB) $(TK_LIB) $(TCL_LIB) -lX11 -lm -lrfc


clean:
	-rm -f *.o
	
realclean:
	-rm -f *.o core tclsap wishsap dev_rfc

install:
	cp $(TCLSAP_BIN) $(INSTALL_BIN_DIR)
	cp $(TKSAP_BIN)  $(INSTALL_BIN_DIR)
	
