# Copyright  1999  Marshall R. Mayberry, III (martym@cs.utexas.edu)
# 
# 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.
#
#          Authors: Marshall R. Mayberry, III (martym@cs.utexas.edu)
#                   Risto P. Miikkulainen (risto@cs.utexas.edu)
#    Creation date: Sep 2, 1999
# Last file update: Sep 8, 1999
#
# This version of SIGNALSIM uses TCL 8.0 and TK 8.0 .so libraries
# It optionally uses BLT 2.3

#if using BLT
#USE_BLT=1
USE_BLT=0

BASE       = /public/linux
TKTCL_PATH = ${BASE}/lib
#BLTLIB     = -lBLT
BLTLIB     =
XLIB       = /lusr/X11R6/lib/libX11.so
TCLLIB     = ${TKTCL_PATH}/libtcl8.0.so
TKLIB      = ${TKTCL_PATH}/libtk8.0.so
INCLUDES   = -I. -I/lusr/X11R6/include -I${BASE}/include
LIBS       = -ldl $(TCLLIB) $(TKLIB) $(XLIB) $(BLTLIB) -lm

#CFLAGS = -g
CFLAGS = -O2
CC = gcc

# Some common definitions...
RM = rm -f

# Rule to create .o files from .c files
.c.o:
	$(RM) $@
	$(CC) -c  $(CFLAGS) $(INCLUDES) $*.c

# Targets
all: signalsim

TK_OBJS = main.o neuron.o network.o
signalsim: $(TK_OBJS)
	$(RM) $@
	$(CC) -Wl,-rpath -Wl,${LD_LIBRARY_PATH}:/p/lib -o $@ $(TK_OBJS) $(LIBS)
	mv $@ ..

clean: 
	$(RM) *.o signalsim
