#
# A makefile for extensions files on Sun (with gcc)
#
# Copyright (C) 1993, 1994 Erick Gallesio - I3S - CNRS / UNSA <eg@unice.fr>
# 
#
# Permission to use, copy, and/or distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
# that both the above copyright notice and this permission notice appear in
# all copies and derived works.  Fees for distribution or use of this
# software or derived works may only be charged with express written
# permission of the copyright holder.  
# This software is provided ``as is'' without express or implied warranty.
#
#           Author: Erick Gallesio [eg@kaolin.unice.fr]
#    Creation date:  6-Mar-1994 15:49
# Last file update: 12-Jun-1994 14:31

include ../../config.make

#define here how to obtain Position Independant Code (pic) with your compiler
PIC   = -fpic

FILES = stklos.o gf.o 
INC   = -I../../Tk -I../../Tcl -I../../Src

CFLAGS= $(PIC) $(STKCFLAGS) -DUSE_TK $(INC) $(XINCLUDES) 

all: stklos.so hash.so

stklos.so: $(FILES)
	ld -assert pure-text -o stklos.so $(FILES)

hash.so: hash.o
	ld -assert pure-text -o hash.so hash.o

# Delete a previous version of stklos.so if it already exist (to avoid loading 
# of a pre 2.1 stklos.so)
install:
	if test -f $(libdir)/stklos.so; \
	then \
	  /bin/rm -f $(libdir)/stklos.so; \
	fi; \
	if test -f stklos.so; \
	then \
	  $(INSTALL) *.so $(libdir); \
	fi

clean:
	@/bin/rm -f *.o *.so core *~f
