#
# Makefile for Visual Ising Machine
#
# 

# Directory where the VIM package will be installed
VIM_DIR = /user/huffi/vim

# Directory of the Tix3.6 distribution
TIX_DIR = /user/huffi/tcl/Tix3.6a 

# Directory where the VIM bitmaps will be stored
BITMAP_DIR = $(VIM_DIR)/bitmaps

# Directory where the c-sources will be put
SRC_DIR = $(VIM_DIR)/src

# Directory where 
CFLAGS = -O2 -I/usr/include -I/usr/local/include -I/usr/local/include/tk
LDFLAGS = -ltk -ltcl -lm -lX11 -L/usr/local/lib

#==========================================================================
# You probably don't want to change anything below this line
#==========================================================================

TARGET = $(SRC_DIR)/ising

OBJECTS = $(SRC_DIR)/tkMain.o \
	$(SRC_DIR)/tkAppInit.o \
	$(SRC_DIR)/mcmodel.o \
	$(SRC_DIR)/IsingColor.o \
	$(SRC_DIR)/studButton.o \
	$(SRC_DIR)/triButton.o \
	$(SRC_DIR)/tkIsing.o

all: $(TARGET)

$(TARGET): $(OBJECTS)
	$(CC) $(CFLAGS) $(OBJECTS) $(LDFLAGS) -o $(TARGET)

install:
	echo "#---------------------------------------------------------------"	> $(VIM_DIR)/settings.tcl
	echo "#  This file has been generated by Makefile." >>  $(VIM_DIR)/settings.tcl
	echo "#  It sets some variables that VIM needs."	  >>  $(VIM_DIR)/settings.tcl
	echo "#---------------------------------------------------------------"	>>  $(VIM_DIR)/settings.tcl
	echo set VIM_PATH $(VIM_DIR)			>>   $(VIM_DIR)/settings.tcl
	echo set BITMAP_PATH $(BITMAP_DIR)		>>  $(VIM_DIR)/settings.tcl
	echo set TIX_PATH $(TIX_DIR) 			>>  $(VIM_DIR)/settings.tcl
	rm *.o 
	mv $(SRC_DIR)/ising $(VIM_DIR)/ising
